runserver SyntaxError: invalid syntax

Hello to all,

I am currently encountering a problem when I type the runserver command I get an error. I looked on the forum and on other sites, but I could not solve the problem. It’s been 2 days that I’m blocked, if someone could help me, it would be really great ? thanks a lot

The error is as follows:

(walterenv) fafoo@faridchalal-dev:~/development/walter/walter$ python manage.py runserver 0.0.0.0:8000
Watching for file changes with StatReloader
Performing system checks…

Exception in thread django-main-thread:
‘’‘Traceback (most recent call last):’‘’
File “/usr/lib/python3.10/threading.py”, line 1009, in _bootstrap_inner
self.run()
File “/usr/lib/python3.10/threading.py”, line 946, in run
self._target(*self._args, **self._kwargs)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/utils/autoreload.py”, line 64, in wrapper
fn(*args, **kwargs)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/core/management/commands/runserver.py”, line 134, in inner_run
self.check(display_num_errors=True)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/core/management/base.py”, line 487, in check
all_issues = checks.run_checks(
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/core/checks/registry.py”, line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/core/checks/urls.py”, line 14, in check_url_config
return check_resolver(resolver)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/core/checks/urls.py”, line 24, in check_resolver
return check_method()
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/urls/resolvers.py”, line 480, in check
for pattern in self.url_patterns:
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/utils/functional.py”, line 49, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/urls/resolvers.py”, line 696, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/utils/functional.py”, line 49, in get
res = instance.dict[self.name] = self.func(instance)
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/urls/resolvers.py”, line 689, in urlconf_module
return import_module(self.urlconf_name)
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “”, line 883, in exec_module
File “”, line 241, in _call_with_frames_removed
File “/home/fafoo/development/walter/walter/walter/urls.py”, line 21, in
path(‘’, include(‘landing.urls’)),
File “/home/fafoo/development/walter/walterenv/lib/python3.10/site-packages/django/urls/conf.py”, line 38, in include
urlconf_module = import_module(urlconf_module)
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
File “/home/fafoo/development/walter/walter/landing/urls.py”, line 2
from . Import views
^^^^^‘’’
SyntaxError: invalid syntax

Hey there

Did you mean import ?

yes. here is my urls.py 's file

from django.urls import path
from . import views

urlpatterns = [
path(‘’, views.home, name=‘home’)
]

Does that solved your issue?

No i dont solve the probleme

Please post a new traceback of the problem you’re currently encountering.

When you copy/paste code, templates, tracebacks, etc here, enclose them between lines of three backtick - ` characters. This means you’ll have a line of ```, then the traceback (or code or whatever), then another line of ```. This forces the forum software to keep it all properly formatted. (The lines of ``` must be lines by themselves.)