django packages list
TRANSCRIPT
Django packages
Michele Mattioni@mattions
Three main categories
● Serving static files● Users registration● Settings splitting
Serving Static
● Ready to deploy● collectstatic● Launching gunicorn
You could read the docs...
● Django does not serve static.● You have to run collect static● You need to server them via nginx or apache
For an easy solution
● Use WhiteNoise!
https://pypi.python.org/pypi/whitenoise
Static files: the struggle
Writing time● SASS● LESS● CooffeScript● Javascript
Serving time● One file for CSS● One file for JS
Use django-pipeline
https://django-pipeline.readthedocs.org● Automatically Compiles SASS and LESS in
CSS during debug time● Minification and concatanation happens at
collectstatic time.
Let's go to the User Registration
User registration
● Starting a django project with User registration already embedded?
https://github.com/pinax/pinax-project-account
django-admin.py startproject --template=https://github.com/pinax/pinax-project-account/zipball/master <project_name>
Goodies
● Sign In/Log in● Email with link to activate user● Password reset● Account Deletion● Based on bootstrap3 forms
Settings split
settings.py → settings/__init__.py
settings/common.py
settings/dev.py
settings/prod.py
Pick the proper settings settings:● DJANGO_MODULE_SETTINGS=myproject.settings.dev
● DJANGO_MODULE_SETTINGS=myproject.settings.prod
How to combine settings
# dev.py
from common import *
DEBUG = True
# prod.py
from common import *
DEBUG = False
Conclusion
● django-whitenoise● django-pipeline● pinax-account-project● Split settings into singular file
Thank you