UPDATE

I have deduced that somewhere along the way, I triggered configuration 
changes that have led me to this point. As I said originally, this all 
seems to have sprung from the simple desire to run a python script. I don't 
know why that should be the case, but there it is. Now I am up against 
AUTH_USER_MODEL, and I have been here before, in another project. If this 
isn't set at the very beginning, you are screwed, and the Django docs tell 
you so. But since I am the only user, I never worried about any of that - 
until now. If I don't get some help here, the only option I see is to 
simply back out of all these changes, get my data, forget about the python 
script and while I am at it, forget about Mezzanine. 

On Sunday, October 1, 2017 at 4:40:54 PM UTC-7, Malik Rumi wrote:
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to