#3893 closed (fixed)
inspectdb correction(introspect)
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | inspectdb, introspect | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On this page - http://www.djangoproject.com/documentation/legacy_databases/
Auto-generate the models Django comes with a utility that can create models by introspecting an existing database. You can view the output by running this command: django-admin.py inspectdb --settings=path.to.settings Save this as a file by using standard Unix output redirection: django-admin.py inspectdb --settings=path.to.settings > models.py This feature is meant as a shortcut, not as definitive model generation. See the django-admin.py documentation for more information. Once you’ve cleaned up your models, name the file models.py and put it in the Python package that holds your app. Then add the app to your INSTALLED_APPS setting.
This will generate environment errors
the command should be
python manage.py inspectdb > models.py
Change History (2)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [4964]) Added note to docs/django-admin.txt about the examples using django-admin.txt but the examples being just as relevant for manage.py. Refs #3893