Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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 ...
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 fi...
Use django-pipeline
https://django-pipeline.readthedocs.org
● Automatically Compiles SASS and LESS in
CSS during debug tim...
Let's go to the User Registration
User registration
● Starting a django project with User registration
already embedded?
https://github.com/pinax/pinax-proj...
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 sett...
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
Django packages list
Upcoming SlideShare
Loading in …5
×

Django packages list

1,507 views

Published on

A presentation that I gave at the django meetup http://www.meetup.com/Django-Cambridge/events/220966071/ with some of my favourite packages.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Django packages list

  1. 1. Django packages Michele Mattioni @mattions
  2. 2. Three main categories ● Serving static files ● Users registration ● Settings splitting
  3. 3. Serving Static ● Ready to deploy ● collectstatic ● Launching gunicorn
  4. 4. 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
  5. 5. For an easy solution ● Use WhiteNoise! https://pypi.python.org/pypi/whitenoise
  6. 6. Static files: the struggle Writing time ● SASS ● LESS ● CooffeScript ● Javascript Serving time ● One file for CSS ● One file for JS
  7. 7. 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.
  8. 8. Let's go to the User Registration
  9. 9. 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>
  10. 10. Goodies ● Sign In/Log in ● Email with link to activate user ● Password reset ● Account Deletion ● Based on bootstrap3 forms
  11. 11. 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
  12. 12. How to combine settings # dev.py from common import * DEBUG = True # prod.py from common import * DEBUG = False
  13. 13. Conclusion ● django-whitenoise ● django-pipeline ● pinax-account-project ● Split settings into singular file
  14. 14. Thank you

×