0

I am following the answers on this question using django 1.10, how ever I'm getting following the error:

RuntimeError: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

I tried adding the app it complains about to INSTALLED_APPS but I still get an error. How can I get my example code below to work?

from django.conf import settings

DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2',
  'HOST': '',
  'NAME': 'mydb',
  'PASSWORD': '',
  'PORT': '',
  'USER': ''}}
DATABASES['default']['ATOMIC_REQUESTS'] = True


settings.configure(
    INSTALLED_APPS = ['django.contrib.contenttypes', 'ob_site.strats.apps.StratsConfig'],
    DATABASES = DATABASES,
    TIME_ZONE = 'UTC')

import django
django.setup() # error is thrown here
pyCthon
  • 11,746
  • 20
  • 73
  • 135
  • 1
    Well you haven't added that app, which is django.contrib.auth. – Daniel Roseman Jul 09 '17 at 17:51
  • @DanielRoseman That was it! What's weird is I don't have `django.contrib` in my actual `settings.py` but essentially every other `django.contrib.*` please write that as an answer. – pyCthon Jul 09 '17 at 17:54

0 Answers0