I have problem with Django 1.4 and apache2. I have following code:
from django.db import models
from django.contrib.auth.models import User, SiteProfileNotAvailable
from django.conf import settings
....
*.... so many includes....*
.....
try:
app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
Profile = models.get_model(app_label, model_name)
except (ImportError, ImproperlyConfigured):
raise SiteProfileNotAvailable
if not Profile:
raise SiteProfileNotAvailable
It raise SiteProfileNotAvailable error, below if not Profile: statement. This means models.get_model is failed get profile model. Same code in my local test environment works greatly. What can go wrong?
Edit: my AUTH_PROFILE_MODULE is as follows in settings.py file.
AUTH_PROFILE_MODULE = 'profile.Profile'
I renamed profile model to uprofile (now it’s like uprofile.uprofile), everything worked.