Writing Reusable Django Apps
summary
A reusable ratings app called django polarize gets built end to end: models use a generic foreign key and the AUTH_USER_MODEL string, migrations move from South hacks to Django 1.7’s migrations, tests run via a runtests.py harness and pass locally and on Travis CI build matrix (Python 2.7/3.4, Django 1.5/1.6/1.7 RC), packaged with setup.py and uploaded to PyPI — roughly half the work is app logic, half reusable-app plumbing, and the example works.
AI-written summary · about
chapters (28)
- 0:00Writing Reusable Django Apps Jacob Haslehurst
- 1:04What are reusable apps?
- 1:15Solve one problem
- 1:30Reuse code between your own projects
- 1:43Share you work with others
- 1:54Reduce size of your Project
- 2:09Independently testable
- 2:21Examples of good reusable apps
- 2:31django-taggit
- 2:52django-imagekit
- 3:03python-social-auth
- 3:37django-generic-follow
- 3:59remote-fixtures
- 4:17Writing a ratings app
- 4:39Basic Setup
- 5:43Models & Migrations
- 7:09Testing
- 8:20How do we run our tests?
- 10:17Distribution
- 11:03$ ./setup.py register
- 11:19$ pip install django-polarize
- 11:32Documentation
- 11:57Installation
- 12:31App Refactor
- 13:36$ python manage.py makemigrations polarize
- 14:13Reusable apps have non-trivial overhead
- 14:42Benefits often win out
- 15:02Questions?
related talks
31m"Notes on Over-Engineering: A Project Post-Mortem"
19mPatterns for Extensibility
01h 06mEffective Django
47mBuilding Scalable Web Apps
41mProduction Django: Building a Highly Scalable, Secure Django Site
26mWhat it's really like building RESTful APIs with Django
53mDjango productivity tips and tricks
27mDjango REST Framework: Taking your API to the next level
