runserver error rectification

42 views
Skip to first unread message

Sanjay Malviya

unread,
Nov 26, 2018, 11:45:10 AM11/26/18
to django...@googlegroups.com
good evening, pls anyone help me in error out following command notification got after runserver command
PS C:\Users\AARVIND\mycode\mysite> python manage.py runserver
Performing system checks...

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x02AC3F60>
Traceback (most recent call last):
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 542, in url_patte
rns
    iter(patterns)
TypeError: 'module' object is not iterable
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
 fn(*args, **kwargs)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", li
ne 120, in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 364, in che
ck
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", li
ne 120, in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 364, in che
ck
    include_deployment_checks=include_deployment_checks,
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 351, in _ru
n_checks
    return checks.run_checks(**kwargs)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\registry.py", line 73, in run_
checks

    new_errors = check(app_configs=app_configs)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 13, in check_ur
l_config
    return check_resolver(resolver)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 23, in check_re
solver
    return check_method()
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 400, in check
    warnings.extend(check_resolver(pattern))
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 23, in check_re
solver
    return check_method()
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 399, in check
    for pattern in self.url_patterns:
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 549, in url_patte
rns
    include_deployment_checks=include_deployment_checks,
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 351, in _ru
n_checks
    return checks.run_checks(**kwargs)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\registry.py", line 73, in run_
checks

    new_errors = check(app_configs=app_configs)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 13, in check_ur
l_config
    return check_resolver(resolver)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 23, in check_re
solver
    return check_method()
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 400, in check
    warnings.extend(check_resolver(pattern))
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\checks\urls.py", line 23, in check_re
solver
    return check_method()
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 399, in check
    for pattern in self.url_patterns:
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Users\AARVIND\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py", line 549, in url_patte
rns

Jason

unread,
Nov 26, 2018, 1:57:13 PM11/26/18
to Django users
whatever you have as url patterns is not a list, tuple or other iterable.

Sanjay Malviya

unread,
Nov 27, 2018, 4:30:56 AM11/27/18
to django...@googlegroups.com
What modification to codes required, pls in project mysite/mysite/polls(app)
polls/views.py
from django.http import httpresponse
def index(request):
    return httpresponse('Hello, world, You're at the polls index')
polls/urls.py
from django.urls import path
from . import views
urlpatterns = [
    path('', views.index, name='index'),
]
mysite/mysite/urls.py
 from django.contrib import admin
from django.urls import include, path
urlpatterns = [
    path('polls/', include('polls.urls')),
    path('admin/', admin.site.urls),
]


On Mon, Nov 26, 2018 at 10:57 AM Jason <jjohn...@gmail.com> wrote:
whatever you have as url patterns is not a list, tuple or other iterable.

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20504ff8-1711-4b9b-9b60-300083a8a60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shiva kumar

unread,
Nov 27, 2018, 11:25:05 AM11/27/18
to django...@googlegroups.com
import polls in  mysite/mysite/urls.py
i think it will work


Reply all
Reply to author
Forward
0 new messages