Home:ALL Converter>Django: Error with django content type

Django: Error with django content type

Ask Time:2018-04-24T17:28:31         Author:Lola

Json Formatter

I got error:

django.db.utils.IntegrityError: insert or update on table "auth_permission" violates foreign key constraint "auth_content_type_id_508cf46651277a81_fk_django_content_type_id"
 DETAIL:  Key (content_type_id)=(1) is not present in table "django_content_type".

I found this post but no recommendation helps:

ContentType.objects.clear_cache()

move 'django.contrib.contenttypes' before 'django.contrib.auth' in INSTALLED_APPS

Has anyone found a solution to this problem?

For details: my settings.py

INSTALLED_APPS = (
    'django.contrib.contenttypes',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.postgres',
    'webpack_loader',
    'rest_framework',
    'corsheaders',
    'common',
    'humans',
    'validations',
    'accounts',
    'comments',
    'errors',  
    'django_nose',
    'reports',
    'dashboards',
    'cacheops',
    'djcelery',
)

Author:Lola,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49998053/django-error-with-django-content-type
yy