在Centos7中启动django时报错:
Watching for file changes with StatReloader
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib64/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/usr/lib64/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 54, in wrapper
fn(*args, **kwargs)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 109, in inner_run
autoreload.raise_last_exception()
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 77, in raise_last_exception
raise _exception0.with_traceback(_exception[2])
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 54, in wrapper
fn(*args, **kwargs)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/init.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/apps/registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/apps/config.py”, line 90, in create
module = import_module(entry)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “
Traceback (most recent call last):
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/apps/registry.py”, line 155, in get_app_config
return self.app_configs[app_label]
KeyError: ‘admin’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/init.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 60, in execute
super().execute(*args, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 95, in handle
self.run(**options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 564, in start_django
reloader.run(django_main_thread)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 272, in run
get_resolver().urlconf_module
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/functional.py”, line 80, in get
res = instance.dict[self.name] = self.func(instance)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/urls/resolvers.py”, line 564, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “
Traceback (most recent call last):
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/apps/registry.py”, line 155, in get_app_config
return self.app_configs[app_label]
KeyError: ‘admin’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “manage.py”, line 21, in
main()
File “manage.py”, line 17, in main
execute_from_command_line(sys.argv)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/init.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 60, in execute
super().execute(*args, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 95, in handle
self.run(**options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py”, line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 579, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 564, in start_django
reloader.run(django_main_thread)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/autoreload.py”, line 272, in run
get_resolver().urlconf_module
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/utils/functional.py”, line 80, in get
res = instance.dict[self.name] = self.func(instance)
File “/root/.virtualenvs/test_env/lib/python3.6/site-packages/django/urls/resolvers.py”, line 564, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “