Reputation: 1296
So, I have created a django app here: http://fpaste.org/bkFf/ without using django-admin.
I want the model that I have created in models.py (http://fpaste.org/i1Vd/) to automatically create the table in the database, as specified in settings.py (http://fpaste.org/GBz0/).
I run the command django-admin syncdb --settings=settings.py, which gives me the following: http://fpaste.org/tgvK/ - but no tables are created (because it should say created table X after Creating tables....)
As I didn't create it using django-admin.py, I have no 'project' - so I have no application to add to an INSTALLED_APPS variable of settings.py.
Ultimately, my question it - how can I get my models to initialise the tables in the database, without needing to use django-admin (other than using the syncdb flag).
Thanks in advance
Upvotes: 1
Views: 529
Reputation: 599490
I have no 'project' - so I have no application to add to an INSTALLED_APPS
This makes no sense at all. Projects have nothing to do with INSTALLED_APPS. You have a settings.py, and you have a models.py. Put the name of the module containing models.py into INSTALLED_APPS, and things will work.
Upvotes: 4