Django ContentTypes required?

446 views
Skip to first unread message

JJ Zolper

unread,
Jul 6, 2020, 2:33:19 PM7/6/20
to Django users
Hello,

I am not using any of the ContentType relations, etc right now in my Django 2.12 Python 3.6 application, am I able to run the application without having django.contrib.contenttypes in the INSTALLED_APPS? Is there a piece I am not understanding that Django uses it for in the background?

I thought I had it working with it removed but I am getting:

Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

I have nothing in the INSTALLED_APPS except my apps and:

'django.contrib.staticfiles',
'rest_framework',

Was trying an attempt where I avoided migrating contenttypes into a legacy database.

Best,

JJ

Dan Madere

unread,
Jul 6, 2020, 8:26:26 PM7/6/20
to Django users
I agree that it should work. Django uses ContentType in the admin and user authentication, but you mention that you have removed these from INSTALLED_APPS, so I don't get it. I'd try clearing .PYC files first. Then maybe a sanity check.. double check what settings file you're actually using, and if INSTALLED_APPS contains what you expect.

Dan

JJ Zolper

unread,
Jul 10, 2020, 11:53:19 AM7/10/20
to Django users
Dan,

Thank you so much. I was able to get it figured out after I smoothed out an issue with the database. My assumption is something with the database was causing it to throw this confusing and unrelated error. I changed the settings files around too but really did not change or remove anything that would have made a difference. Or should have. The app was not included, etc.

Best,

JJ

Chaos Chameleon

unread,
Feb 5, 2022, 10:43:07 AM2/5/22
to Django users

hello.I have the same problem,can you share how to sovling this? thanks very much. I just remove the default apps of INSTALLED_APPS, too
Reply all
Reply to author
Forward
0 new messages