Sunday, August 29, 2010

manage.py: syncdb/sql do not pick up models from custom directory structure

Hi,

I am working on a pretty big application and somewhat changed the
default directory structure a bit. I now have an app called "lib" in
my project dir. This application contains two folders: "models" and
"templatetags". The __init__.py files are present in all
subdirectories. Whenever I want to use models from the lib-app, I
would use "from myproject.lib.models import FooModel" and it would use
the models from lib/models/FooModel.py.

The problem is that the manage.py script does not seem to be aware of
these models. I added "myproject.lib" to the INSTALLED_APPS section in
the settings file, but manage.py still cannot find any models.

How can I tell manage.py to also look in the lib/models subdirectory for models?


Regards,
Dan

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment