manage.py depends on django.contrib.contenttypes et al.
|Reported by:||TheRoSS||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I intended to use django.contrib.auth with my own backends, so I included 'django.contrib.auth.middleware.AuthenticationMiddleware' into 'MIDDLEWARE_CLASSES', excluded 'django.contrib.auth' from 'INSTALLED_APPS' and created my own authentication application.
But if I named my authentication application as 'project.auth', django used models from 'django.contrib.auth'.
If I gave it any other name, 'project.auth2' for example, models were mine.
MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) INSTALLED_APPS = ( 'project.auth', # DOESN'T WORK! 'project.auth2', # works well )
I tracked down the source code and realized that django.db.models.loading.app_models dictionary has a record named 'auth' taken from 'django.contrib.auth' (upon middleware processing I suppose) which prevents my 'auth' application to be used.
Change History (12)
comment:6 Changed 5 years ago by
|Summary:||my application project.auth takes models from django.contrib.auth → manage.py depends on django.contrib.contenttypes et al.|
|Triage Stage:||Unreviewed → Accepted|