hi,运行如下命令尝试启动server时报错:
python3 manage.py runserver 0.0.0.0:8001
报错如下,网上查找好久没有解决办法,大神能否帮忙看下,感谢🙏:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/local/python3/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, self._kwargs)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "/usr/local/python3/lib/python3.5/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/python3/lib/python3.5/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/usr/local/python3/lib/python3.5/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/python3/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/usr/local/python3/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 133, in
class ContentType(models.Model):
File "/usr/local/python3/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 134, in ContentType
app_label = models.CharField(max_length=100)
File "/usr/local/python3/lib/python3.5/site-packages/django/db/models/fields/init.py", line 985, in init
self.validators.append(validators.MaxLengthValidator(self.max_length))
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, cmd_options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, *options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(args, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 599, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 584, in start_django
reloader.run(django_main_thread)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 299, in run
self.run_loop()
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 305, in run_loop
next(ticker)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 345, in tick
for filepath, mtime in self.snapshot_files():
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 361, in snapshot_files
for file in self.watched_files():
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 260, in watched_files
yield from iter_all_python_module_files()
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 105, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
TypeError: resolve() got an unexpected keyword argument 'strict'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 341, in run_from_argv
connections.close_all()
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 225, in close_all
for alias in self:
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 219, in iter
return iter(self.databases)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, cmd_options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, *options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(args, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 602, in run_with_reloader
sys.exit(exit_code)
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 341, in run_from_argv
connections.close_all()
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 225, in close_all
for alias in self:
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 219, in iter
return iter(self.databases)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
hi,运行如下命令尝试启动server时报错: python3 manage.py runserver 0.0.0.0:8001 报错如下,网上查找好久没有解决办法,大神能否帮忙看下,感谢🙏: Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/local/python3/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/local/python3/lib/python3.5/threading.py", line 862, in run self._target(*self._args, self._kwargs) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, *kwargs) File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception raise _exception[1] File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 357, in execute autoreload.check_errors(django.setup)() File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(args, kwargs) File "/usr/local/python3/lib/python3.5/site-packages/django/init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/python3/lib/python3.5/site-packages/django/apps/registry.py", line 114, in populate app_config.import_models() File "/usr/local/python3/lib/python3.5/site-packages/django/apps/config.py", line 211, in import_models self.models_module = import_module(models_module_name) File "/usr/local/python3/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/usr/local/python3/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 133, in
class ContentType(models.Model):
File "/usr/local/python3/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 134, in ContentType
app_label = models.CharField(max_length=100)
File "/usr/local/python3/lib/python3.5/site-packages/django/db/models/fields/init.py", line 985, in init
self.validators.append(validators.MaxLengthValidator(self.max_length))
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
Traceback (most recent call last): File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 328, in run_from_argv self.execute(*args, cmd_options) File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 60, in execute super().execute(*args, *options) File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 369, in execute output = self.handle(args, options) File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 95, in handle self.run(options) File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 102, in run autoreload.run_with_reloader(self.inner_run, options) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 599, in run_with_reloader start_django(reloader, main_func, *args, **kwargs) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 584, in start_django reloader.run(django_main_thread) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 299, in run self.run_loop() File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 305, in run_loop next(ticker) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 345, in tick for filepath, mtime in self.snapshot_files(): File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 361, in snapshot_files for file in self.watched_files(): File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 260, in watched_files yield from iter_all_python_module_files() File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 105, in iter_all_python_module_files return iter_modules_and_files(modules, frozenset(_error_files)) File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 141, in iter_modules_and_files resolved_path = path.resolve(strict=True).absolute() TypeError: resolve() got an unexpected keyword argument 'strict'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 341, in run_from_argv
connections.close_all()
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 225, in close_all
for alias in self:
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 219, in iter
return iter(self.databases)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, cmd_options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, *options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 369, in execute
output = self.handle(args, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(options)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, options)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/autoreload.py", line 602, in run_with_reloader
sys.exit(exit_code)
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python3/lib/python3.5/site-packages/django/core/management/base.py", line 341, in run_from_argv
connections.close_all()
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 225, in close_all
for alias in self:
File "/usr/local/python3/lib/python3.5/site-packages/django/db/utils.py", line 219, in iter
return iter(self.databases)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/python3/lib/python3.5/site-packages/django/utils/functional.py", line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.