Unhandled exception in thread started by
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 30, in check_all_models
errors.extend(model.check(kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 1283, in check
errors.extend(cls._check_fields(kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 1358, in _check_fields
errors.extend(field.check(kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 913, in check
errors = super(AutoField, self).check(kwargs)
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 219, in check
errors.extend(self._check_backend_specific_checks(*kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 321, in check_backend_specific_checks
if router.allow_migrate(db, app_label, model_name=self.model._meta.model_name):
File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 293, in allow_migrate
for router in self.routers:
File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get_
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 251, in routers
router = import_string(r)()
File "/usr/local/lib/python2.7/site-packages/django/utils/module_loading.py", line 20, in import_string
module = import_module(module_path)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named db_router
db_router 文件是我新建的分配数据库的,我在 settings 里也引入了这个文件
配置是按照这样来的
https://blog.csdn.net/weixin_42282496/article/details/80795261
我 python2.7
求大神指点