Django and Databases: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Category:PostgreSQL Category:Django Category:Python Category:Web Development == Updating database structure == === Workflow <ref>[https://docs.djangoproject.c...") |
|||
| Line 21: | Line 21: | ||
$ pip install ~/develop/labs/shared/django-addresses/dist/django-addresses-1.2.1.tar.gz | $ pip install ~/develop/labs/shared/django-addresses/dist/django-addresses-1.2.1.tar.gz | ||
</syntaxhighlight> | </syntaxhighlight> | ||
:* (See also [[Reusable Django Packages/Apps]]) | |||
== Notes == | == Notes == | ||
<references /> | <references /> | ||
Revision as of 18:02, 1 September 2015
Updating database structure
Workflow [1]
After changing the structure of a model in the Django code,
$ python manage.py makemigrations $ python manage.py migrate
Editing models in a reusable package/app
- Edit
models.pyin the package. - Repackage the app.[2]
python setup.py sdist(from within the root package directory)
- Update the package/app, e.g:
$ pip uninstall django-addresses $ pip install ~/develop/labs/shared/django-addresses/dist/django-addresses-1.2.1.tar.gz
- (See also Reusable Django Packages/Apps)
Notes
- ↑ Migrations - Django Documentation (v1.8)
- ↑ How to Write Reusable Apps - Django Documentation