Django. Core. Exceptions. ImproperlyConfigured: Put 'django. Contrib. Contenttypes' in your INSTALLED_APPS setting in order to use the admin application.
But setting. Py in existing django. Contrib. Contenttypes
INSTALLED_APPS=[
'the django. Contrib. Admin,
'the django. Contrib. Auth',
'the django. Contrib. Contenttypes',
'the django. Contrib. Sessions',
'the django. Contrib. Messages',
'the django. Contrib. Staticfiles',
'xadmin'
'crispy_forms'
This is my admin. Py the code in the
from the django. Contrib import admin
# Register your models here.
The import xadmin
From the models import Profile
Xadmin. Site. Register (Profile. Objects)
There is an error in front of an error
Traceback (the most recent call last) :
The File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ threading py", line 916, in _bootstrap_inner
The self. The run ()
The File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ threading py", line 864, in the run
Self. _target (, * * * self. _args self. _kwargs)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 54, wrapper in
Fn (* args, * * kwargs)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django/core/management/commands \ runserver then executes py", line 109, in inner_run
Autoreload. Raise_last_exception ()
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 77, in raise_last_exception
Raise _exception [0] (_exception [1]). With_traceback (_exception [2])
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 54, wrapper in
Fn (* args, * * kwargs)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ set py", line 24, setup in
Apps. The populate (Settings. The INSTALLED_APPS)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ apps \ registry py", line 122, in the populate
App_config. Ready ()
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ contrib \ admin \ apps py", 24, line ready in
The self. The module. Autodiscover ()
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ contrib \ admin \ set py", 26, the line in autodiscover
Autodiscover_modules (' admin 'register_to=site)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ module_loading py", line 47, in autodiscover_modules
Import_module (' % s. % s' % (app_config. Name, module_to_search))
The File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ importlib \ set py", line 126, in import_module
Return _bootstrap. _gcd_import (name [level:], package, level)
The File "& lt; Frozen importlib. _bootstrap & gt;" , line 994, in _gcd_import
The File "& lt; Frozen importlib. _bootstrap & gt;" , line 971, in _find_and_load
The File "& lt; Frozen importlib. _bootstrap & gt;" , line 955, in _find_and_load_unlocked
The File "& lt; Frozen importlib. _bootstrap & gt;" , line 665, in _load_unlocked
The File "& lt; Frozen importlib. _bootstrap_external & gt;" , line 678, in exec_module
The File "& lt; Frozen importlib. _bootstrap & gt;" , line 219, in _call_with_frames_removed
The File "C: \ Users \ CRXB \ PycharmProjects \ djangoProject4 \ rb \ admin py", line 8, the in & lt; module>
Xadmin. Site. Register (Profile. Objects)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ xadmin \ sites py", line 97, in the register
If isinstance (model_or_iterable, ModelBase) or issubclass (model_or_iterable, BaseAdminView) :
TypeError: issubclass (arg) 1 must be a class
Use native admin will prompt an error
Traceback (the most recent call last) :
The File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ threading py", line 916, in _bootstrap_inner
The self. The run ()
The File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ threading py", line 864, in the run
Self. _target (, * * * self. _args self. _kwargs)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 54, wrapper in
Fn (* args, * * kwargs)
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django/core/management/commands \ runserver then executes py", line 109, in inner_run
Autoreload. Raise_last_exception ()
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 77, in raise_last_exception
Raise _exception [0] (_exception [1]). With_traceback (_exception [2])
File "C: \ Users \ CRXB \ AppData \ Local \ designed \ Python \ Python36-32 \ lib \ site - packages \ django \ utils \ autoreload py", line 54, wrapper in
Fn (* args, * * kwargs)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull