15π
If your talking about needing to see the SQL schema, run ./manage.py sqlall <appname>
If you want a visualisation of the schema you can get django-extensions
and run ./manage.py graph_models -a -g -o my_project.png
. This will produce a pretty schema graph for you, but generally omits border conditions. you may want to check the options to add more data. http://readthedocs.org/docs/django-extensions/en/latest/graph_models.html
- Django- Factory boy failing for no apparent reason in just one factory
- In Django admin, how can I hide Save and Continue and Save and Add Another buttons on a model admin?
- Python/Django: sending emails in the background
2π
Using Your DB
As mentioned in the tutorial, you can use your databaseβs command line client to get the schema.
Example using sqlite:
python manage.py dbshell
> .schema
You may need to install sqlite3 for this to work.
Using Django
You used to be able to use python manage.py sql ...
, but it has been deprecated in 1.9 in favor of migrations. You can check out the initial migration scripts using:
python manage.py sqlmigrate myapp 0001_initial
- Django Prefetch with custom queryset which uses managers method
- PhoneGap with Django Backend
- Make a Django model read-only?
- Convert negative number to positive number in django template?
- Create JSON Response in Django with Model