10. Philosophies
• Loose coupling
• Less code
• Quick development
• Don t repeat yourself (DRY)
• Explicit is better than implict
• Consistency
https://docs.djangoproject.com/en/1.4/misc/design-philosophies/
Speaker: @hirokiky
12年9月18日火曜日
11. Killer features
• Automatically-generated admin site
• Form library
• Generic views
Speaker: @hirokiky
12年9月18日火曜日
12. Admin site
• Automatically-generated
• Easy to customize
Speaker: @hirokiky
12年9月18日火曜日
13. Demo: Admin (15m)
• startproject, create models, run admin site(10m)
• Introduction of django-blog-zinnia (5m)
Speaker: @hirokiky
12年9月18日火曜日
14. Read Docs
and some codes
If you want to learn more
Speaker: @hirokiky
12年9月18日火曜日
15. Useful Django1.4
• About me
• About Django
• Useful things of Django > 1.0
Speaker: @hirokiky
12年9月18日火曜日
16. Django > 1.0
• project template
• <del>Class Based View</del> <!-- Because of time constraints -->
Speaker: @hirokiky
12年9月18日火曜日
18. Project template provide
• easy deploy to a specific environment
• archiving some best practices
Speaker: @hirokiky
12年9月18日火曜日
19. Boring tasks after startproject
• Judging environments (DEBUG, True or False.
• A application should put in project/apps. (not default,
but good know-how
• Writing dependences.
• Dealing informations we want to write in settings
(SECRET_KEY, PASSWORD
Speaker: @hirokiky
12年9月18日火曜日
20. Solving all of these
by templating
Speaker: @hirokiky
12年9月18日火曜日
21. How to use
project template
django-admin.py startproject --template=/path/to/template myproject
--template=/path/to/template
also URL
Speaker: @hirokiky
12年9月18日火曜日
23. template
├──
fabfile.py
├──
gunicorn.py.ini
├──
manage.py
├──
Procfile
├──
reqs
│
├──
common.txt template is like this
│
├──
dev.txt
│
└──
prod.txt
├──
requirements.txt
├──
project_name
│
├──
apps
│
│
└──
__init__.py
This name will be
│
├──
__init__.py
│
├──
libs
│
│
└──
__init__.py
replaced with
│
├──
settings
│
│
├──
common.py project s name
│
│
├──
dev.py
│
│
├──
__init__.py
│
│
└──
prod.py
│
├──
templates
│
│
├──
404.html
│
│
└──
500.html
│
└──
urls.py
└──
wsgi.py
Speaker: @hirokiky
12年9月18日火曜日
24. Also .py files
if
__name__
==
"__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"{{
project_name
}}.settings.dev")
from
django.core.management
import
execute_from_command_line
execute_from_command_line(sys.argv)
• project_name
• project_directory
• secret_key
• Also another files specified by option
Speaker: @hirokiky
12年9月18日火曜日
25. In essence
You can use own project template,
instead of django/conf/project_template
Speaker: @hirokiky
12年9月18日火曜日
26. Example: django-skel
• heroku + S3 platform
• Filled with best practices that rdegges have
learned for four years.
https://github.com/rdegges/django-skel
Speaker: @hirokiky
12年9月18日火曜日
40. Project template provide
• easy deploy to a specific environment
• archiving some best practices
Speaker: @hirokiky
12年9月18日火曜日
41. Luke of Django
• Deploy project avoiding HELL
• Learn best practices through reading
good project templates
Speaker: @hirokiky
12年9月18日火曜日
42. Yoda of Django
• Without remembering best practices
and adapting to new project to these
• Create Django s default standards in
the form of project template
Speaker: @hirokiky
12年9月18日火曜日
43. Killer Feature of Django1.4
is not only {% elif %}
Speaker: @hirokiky
12年9月18日火曜日
44. Announce
• I held DjangoSprint
• 2012 September 17
• It don t force you what to do.
• http://2012.pycon.jp/en/program/sprints.html
Speaker: @hirokiky
12年9月18日火曜日
48. django-docs-ja
• We are translating Django1.4 documents to Japanese
https://github.com/django-docs-ja/django-docs-ja
Speaker: @hirokiky
12年9月18日火曜日