The Python Framework's Django album component
Yes, yes, and Django, although the study notes have been affixed, but the study notes are based on, Django, regardless of what is said or a lot of things to learn naturally will not only use more than 10 blog post can learn the end. Okay, nonsense. Today's introduction to Django is an open source component Photologue, the component was placed on GitHub by the author, want to see the source click here.
Preparatory work
- Download the component. Here: http://code.google.com/p/django-photologue/
- After decompression, proceed to the command line installation under directory:
1 python setup.py install
- To detect if the installation was successful:
Go to a once Django project and then execute
1 python manage.py shell2 Import Photologue 3 >>> Photologue. VERSION4 (2, 2)
- add" settings.py "to photologue in the following way:
Span style= "color: #008080;" >1 installed_apps = ( 2 # 3 " photologue ' 4 )
- Add the following code to your project's urls.py file:
1 from Import Admin 2 3 Admin.autodiscover ()
Of course, if you are normal to use the command line to build the project, then it is in the original there are these, you can not join ~
- Sync your database
1 Python manage.py syncdb
- To initialize the component:
1 python manage.py plinit
- add Photologue to the urls.py of your project
1 # 2 urlpatterns + = patterns ( "
3 (R '
9. Add a template module to your project: see the Python Framework's Django Learning Note (10) for a template addition
If you want to learn more, see the official documentation: HTTP://ITECHES.COM/ARCHIVES/65083.
PS: This blog welcome forwarding, but please specify the blog address and author ~
Blog Address: http://www.cnblogs.com/voidy/
<. ))) ≦
The Python Framework's Django album component