How use model objects in ver1.9 WITHOUT an app and get rid off "Model class doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS." error mssg?
67 views
Skip to first unread message
Chris Seberino
unread,
Apr 4, 2016, 5:23:42 PM4/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I'm trying to create a simple stripped down skeleton Django application. Django ver1.9 forces everything to be in apps which are not needed for this application.
When I try using models I get an error like the following:
"Model class doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS."
Is there an easy sane/safe way to deal with this so Django can run without any "apps" defined?
Thanks,
Chris
Mike Dewhirst
unread,
Apr 4, 2016, 8:03:29 PM4/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
On 5/04/2016 7:23 AM, Chris Seberino wrote:
> I'm trying to create a simple stripped down skeleton Django
> application. Django ver1.9 forces
> everything to be in apps which are not needed for this application.
>
> When I try using models I get an error like the following:
>
> "Model class doesn't declare an explicit app_label and isn't in an
> application in INSTALLED_APPS."
>
> Is there an easy sane/safe way to deal with this so Django can run
> without any "apps" defined?
Just think of an app actually being a namespace rather than an app.
Django uses INSTALLED_APPS entries just like a search path added to the
BASE_DIR so it can find your models.
If you don't want the app name in your table name in the database I
believe you can specify the db_table in your model meta options
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Just think of an app actually being a namespace rather than an app.
Django uses INSTALLED_APPS entries just like a search path added to the
BASE_DIR so it can find your models.
Ah yes thanks. That helped a lot. I just needed to basically mention
the directory in settings.py and then all was fine.