this is my urlpattern code:
urlpatterns = [
path(' ', include('calc.urls')),
path('admin/', admin.site.urls),
]
path(' ', include('calc.urls')),
path('admin/', admin.site.urls),
]
And I am facing this error and i don't know what this error is:
python manage.py runserverWatching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py", line 717, in url_patterns
iter(patterns)
TypeError: 'module' object is not iterable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Python310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\management\base.py", line 475, in check
all_issues = checks.run_checks(
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\checks\registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\checks\urls.py", line 24, in check_resolver
return check_method()
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py", line 495, in check
messages.extend(check_resolver(pattern))
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\core\checks\urls.py", line 24, in check_resolver
return check_method()
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\utils\functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\Talha Imran\AppData\Roaming\Python\Python310\site-packages\django\urls\resolvers.py", line 725, in url_patterns
raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'calc.urls' from 'C:\\Users\\Talha Imran\\OneDrive\\Documents\\project\\m
y_django_project\\calc\\urls.py'>' does not appear to have any patterns in it. If you see the 'urlpatterns' variable with valid patterns in the file
then the issue is probably caused by a circular import.
On Thursday, April 13, 2017 at 9:07:49 AM UTC+2 cou...@gmail.com wrote:
Lynn, you should really start your own thread. If you have an error, copy/paste it entirely, this make debugging a lot easier. And don't hesitate to share your code.There is a lot of things that can go wrong when we begin and most give more or less the same result.On 12 Apr 2017 9:27 pm, "Lynn Capps" <lynnc...@gmail.com> wrote:Shah,
Did you get this figured out? I am having the same issue as you did.
On Friday, December 9, 2016 at 1:50:22 PM UTC-6, shah wrote:Hi, I am facing the same issue with the tutorial.I have got my program correct. But after running the sever. It shows an error on chrome.Page not found (404)
Request Method: GET Request URL: http://localhost:8000/polls/ Using the URLconf defined in
mysite.urls
, Django tried these URL patterns, in this order:
- ^admin/
The current URL,
polls/
, didn't match any of these.You're seeing this error because you have
DEBUG = True
in your Django settings file. Change that toFalse
, and Django will display a standard 404 page.Since this is first ste of tutorial. I am not able to move forward. Thanx for rely in advance.
On Tuesday, 11 October 2016 02:12:30 UTC+5:30, Johnny McClung wrote:I am getting an error when I try to run the Django server.>> mysite >> polls >> urls.pyfrom django.conf.urls import urlfrom . import viewsurlpatters = [url(r'^$', views.index, name='index'),]>> mysite >> mysite >> urls.pyfrom django.conf.urls import include, urlfrom django.contrib import adminurlpatterns = [url(r'^polls/', include('polls.urls'))url(r'^admin/', admin.site.urls),]Error:E:\Dropbox\Python Scripts\mysite>python manage.py runserverPerforming system checks...Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x03F616A8>Traceback (most recent call last):File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\autoreload.py", line 226, in wrapperfn(*args, **kwargs)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\commands\runserver.py", line 121, in inner_runself.check(display_num_errors=True)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py", line 374, in checkinclude_deployment_checks=include_deployment_checks,File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\management\base.py", line 361, in _run_checksreturn checks.run_checks(**kwargs)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\registry.py", line 81, in run_checksnew_errors = check(app_configs=app_configs)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_configreturn check_resolver(resolver)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolverfor pattern in resolver.url_patterns:File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\urls\resolvers.py", line 313, in url_patternspatterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\utils\functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\site-packages\django\urls\resolvers.py", line 306, in urlconf_modulereturn import_module(self.urlconf_name)File "C:\Users\geek\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py", line 126, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File "<frozen importlib._bootstrap>", line 986, in _gcd_importFile "<frozen importlib._bootstrap>", line 969, in _find_and_loadFile "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlockedFile "<frozen importlib._bootstrap>", line 673, in _load_unlockedFile "<frozen importlib._bootstrap_external>", line 661, in exec_moduleFile "<frozen importlib._bootstrap_external>", line 767, in get_codeFile "<frozen importlib._bootstrap_external>", line 727, in source_to_codeFile "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removedFile "E:\Dropbox\Python Scripts\mysite\mysite\urls.py", line 21url(r'^admin/', admin.site.urls),^SyntaxError: invalid syntaxAny help would be appreciated. Thank you.--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dcf60cd3-3b1d-4efc-b215-78f166423e88%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d078b61a-de7f-4435-b788-22c86c1abf2dn%40googlegroups.com.
No comments:
Post a Comment