01/10/2018, 09:47

Chạy python manage.py runserver bị lỗi?

Mình đang tự học Django, đến đoạn chạy cái này thì bị lỗi như này, nhờ các bác giúp:

Unhandled exception in thread started by <function check_errors..wrapper at 0x000002329F0CFEA0>
Traceback (most recent call last):
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangoutilsautoreload.py”, line 227, in wrapper
fn(*args, **kwargs)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocoremanagementcommands unserver.py”, line 125, i
n inner_run
self.check(display_num_errors=True)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocoremanagementase.py”, line 359, in check
include_deployment_checks=include_deployment_checks,
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocoremanagementase.py”, line 346, in run_checks
return checks.run_checks(**kwargs)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocorechecks egistry.py”, line 81, in run_checks
new_errors = check(app_configs=app_configs)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocorechecksurls.py”, line 16, in check_url_config
return check_resolver(resolver)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangocorechecksurls.py”, line 26, in check_resolver
return check_method()
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangourls esolvers.py”, line 254, in check
for pattern in self.url_patterns:
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangoutilsfunctional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangourls esolvers.py”, line 405, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangoutilsfunctional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “C:Python36libsite-packagesdjango-1.11.1-py3.6.eggdjangourls esolvers.py”, line 398, in urlconf_module
return import_module(self.urlconf_name)
File "C:Python36libimportlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 978, in _gcd_import
File “”, line 961, in _find_and_load
File “”, line 950, in _find_and_load_unlocked
File “”, line 655, in _load_unlocked
File “”, line 674, in exec_module
File “”, line 781, in get_code
File “”, line 741, in source_to_code
File “”, line 205, in _call_with_frames_removed
File “C:UsershaidragonseaDesktopwebsitewebsiteurls.py”, line 2
from django.conf.urls import url import include, url
^
SyntaxError: invalid syntax

Nguyễn Duy Hùng viết 11:50 ngày 01/10/2018

Ngay dòng 2 import thư viện sai cú pháp kìa _

Bài liên quan
0