django.core.exceptions.ImproperlyConfigured: The included URLconf 'simplesocial.urls' does not appear to have any patterns in it

Hi friends since 2 days i am having this above error and sear many time in google and stackoverflow but couldn’t solved the problem yet.
please instruct me?
blew is the error code.

File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 407, in check
for pattern in self.url_patterns:
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 588, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 581, in urlconf_module
return import_module(self.urlconf_name)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\importlib_init_.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 779, in exec_module
File “”, line 916, in get_code
File “”, line 846, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “D:\Django_Projects\simplesocial\simplesocial\urls.py”, line 27
path(‘thanks/’,views.ThanksPage.as_view(),name = ‘thanks’)
^
SyntaxError: invalid syntax

(MyDjangoEnv) D:\Django_Projects\simplesocial>python manage.py makemigrations accounts
Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 590, in url_patterns
iter(patterns)
TypeError: ‘module’ object is not iterable

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 “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management_init_.py”, line 401, in execute_from_command_
line
utility.execute()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management_init_.py”, line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 328, in run_from_argv
self.execute(*args, **cmd_options)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 366, in execute
self.check()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 392, in check
all_issues = self._run_checks(
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 382, in run_checks
return checks.run_checks(**kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\registry.py”, line 72, in run_checks
new_errors = check(app_configs=app_configs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 13, in check_url_config
return check_resolver(resolver)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 407, in check
for pattern in self.url_patterns:
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 588, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 581, in urlconf_module
return import_module(self.urlconf_name)
File "C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “D:\Django_Projects\simplesocial\simplesocial\urls.py”, line 19, in
from accounts import views
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 8, in
class SignUp(CreateView):
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 10, in SignUp
success_url = reverse(‘login’)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\base.py”, line 87, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 617, in _reverse_with_prefix
self._populate()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 455, in _populate
for url_pattern in reversed(self.url_patterns):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 597, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ‘simplesocial.urls’ does not appear to have any patterns in it. If you see
valid patterns in the file then the issue is probably caused by a circular import.

(MyDjangoEnv) D:\Django_Projects\simplesocial>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks…

Exception in thread django-main-thread:
Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 590, in url_patterns
iter(patterns)
TypeError: ‘module’ object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 932, in _bootstrap_inner
self.run()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\autoreload.py”, line 53, in wrapper
fn(*args, **kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\commands\runserver.py”, line 117, in inner_run
self.check(display_num_errors=True)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 392, in check
all_issues = self._run_checks(
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 382, in run_checks
return checks.run_checks(**kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\registry.py”, line 72, in run_checks
new_errors = check(app_configs=app_configs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 13, in check_url_config
return check_resolver(resolver)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 407, in check
for pattern in self.url_patterns:
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 588, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 581, in urlconf_module
return import_module(self.urlconf_name)
File "C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “D:\Django_Projects\simplesocial\simplesocial\urls.py”, line 19, in
from accounts import views
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 8, in
class SignUp(CreateView):
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 10, in SignUp
success_url = reverse(‘login’)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\base.py”, line 87, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 617, in _reverse_with_prefix
self._populate()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 455, in _populate
for url_pattern in reversed(self.url_patterns):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 597, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ‘simplesocial.urls’ does not appear to have any patterns in it. If you see
valid patterns in the file then the issue is probably caused by a circular import.

(MyDjangoEnv) D:\Django_Projects\simplesocial>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks…

Exception in thread django-main-thread:
Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 590, in url_patterns
iter(patterns)
TypeError: ‘module’ object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 932, in _bootstrap_inner
self.run()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\autoreload.py”, line 53, in wrapper
fn(*args, **kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\commands\runserver.py”, line 117, in inner_run
self.check(display_num_errors=True)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 392, in check
all_issues = self._run_checks(
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 382, in run_checks
return checks.run_checks(**kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\registry.py”, line 72, in run_checks
new_errors = check(app_configs=app_configs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 13, in check_url_config
return check_resolver(resolver)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 407, in check
for pattern in self.url_patterns:
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 588, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 581, in urlconf_module
return import_module(self.urlconf_name)
File "C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “D:\Django_Projects\simplesocial\simplesocial\urls.py”, line 19, in
from accounts import views
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 8, in
class SignUp(CreateView):
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 10, in SignUp
success_url = reverse(‘login’)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\base.py”, line 87, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 617, in _reverse_with_prefix
self._populate()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 455, in _populate
for url_pattern in reversed(self.url_patterns):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 597, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ‘simplesocial.urls’ does not appear to have any patterns in it. If you see
valid patterns in the file then the issue is probably caused by a circular import.

(MyDjangoEnv) D:\Django_Projects\simplesocial>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks…

Exception in thread django-main-thread:
Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 590, in url_patterns
iter(patterns)
TypeError: ‘module’ object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 932, in _bootstrap_inner
self.run()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\threading.py”, line 870, in run
self._target(*self._args, **self._kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\autoreload.py”, line 53, in wrapper
fn(*args, **kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\commands\runserver.py”, line 117, in inner_run
self.check(display_num_errors=True)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 392, in check
all_issues = self._run_checks(
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\management\base.py”, line 382, in run_checks
return checks.run_checks(**kwargs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\registry.py”, line 72, in run_checks
new_errors = check(app_configs=app_configs)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 13, in check_url_config
return check_resolver(resolver)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 407, in check
for pattern in self.url_patterns:
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 588, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 581, in urlconf_module
return import_module(self.urlconf_name)
File "C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “D:\Django_Projects\simplesocial\simplesocial\urls.py”, line 19, in
from accounts import views
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 8, in
class SignUp(CreateView):
File “D:\Django_Projects\simplesocial\accounts\views.py”, line 10, in SignUp
success_url = reverse(‘login’)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\base.py”, line 87, in reverse
return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 617, in _reverse_with_prefix
self._populate()
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 455, in _populate
for url_pattern in reversed(self.url_patterns):
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\utils\functional.py”, line 48, in get
res = instance.dict[self.name] = self.func(instance)
File “C:\ProgramData\Miniconda2\envs\MyDjangoEnv\lib\site-packages\django\urls\resolvers.py”, line 597, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
django.core.exceptions.ImproperlyConfigured: The included URLconf ‘simplesocial.urls’ does not appear to have any patterns in it. If you see
valid patterns in the file then the issue is probably caused by a circular import.

Did you read up on circular imports? https://stackabuse.com/python-circular-imports/

Do all your url confs define a urlpatterns variable?

1 Like

Thanks I had misspelt the urlpatterns variable.