Greetings/ I am trying to run a python script on Mezzanine, and have run into a slew of errors I have not seen before. I have been using Mezzanine for about 3 months. This is the first time I have run a python script on it, however.
I assume these errors are coming now because of the python script: https://docs.djangoproject.com/en/1.11/ref/applications/#initialization-process However, once I got past the first error, new ones kept coming, in rapid succession, as if my entire settings are wrong, and that strikes me as odd, and questionable, since everything was working before. I am hoping someone can help illuminate what is going on here. These are my errors, in order: Error 1: DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. Solution: $ export DJANGO_SETTINGS_MODULE="my.settings" Error 2: raise AppRegistryNotReady("Apps aren't loaded yet.") Solution: Added django.setup() to settings. Error 3: NameError: name 'django_setup' is not defined Solution: Added imports for os, sys, and django to settings, added explicit os.environ setting to settings for django settings module, and appended to sys.path Error 4: raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.") Solution: This really confused me at first. Then I saw that SECRET_KEY was in local_settings.py, along with DEBUG = True, the database settings, and the fabric settings. But since it has been working without issue before now, for some reason it was no longer going over to local_settings.py and finding SECRET_KEY there. I don't know why. Since this is purely a local install, I just commented the exec to local_settings out, and moved all that into my main settings. Error 5: RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. Solution: django.contrib.sites.models.Site is not in INSTALLED APPS, but django.contrib.sites is. I dug it up and put an app label on Site. But, why do I even need Site? Error 6: RuntimeError: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. Solution: As you can see, this is exactly the same error, it just moved on to the next app in line. I see no reason to have to go through all my apps putting labels on them (but obviously I might have to). It was at this point that I stopped to post here and see if someone could explain wtf is going on here with all these config errors? Thanks. -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.