I\'m following the tutorial on Django\'s site to create a simple poll app. However, Django is unable to resolve \"//127.0.0.1:8000/polls\" , even though I\'ve defined the re
i had the same issue and got it resolved by adding /polls after http://server:port/ and so final address in server looks like: http://server:port/polls
You're accessing to http://yourdomain.com/, and you don't have any URL defined for "/".
You have two options:
If you want to access to the index page of your polls application you have to enter the URL: yourdomain.com/polls
You can also modify you mySite/urls.py file to access from just yourdomain.com
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', include('polls.urls')),
)
Depending on where you put your ROOT urls.py, you set your ROOT_URLCONFIG accordingly, if you have it in your outermost folder containing manage.py then "urls" is ok. if you have it in someother folder then you have to do ".urls"
Credit for the answer to jerryh91
For more info about how it works, check How Django processes a request
In my case, it was a stupid mistake. I wanted to integrate the plugin django-tinymce, and test it. So following this guide, I did the step 3 and exported the variable to the path. As the server runned again, I received the not found error, showing the message:
Using the URLconf defined in testtinymce.urls, Django tried these URL patterns, in this order: ....
But I didn't know what exactly it was, until I remembered exporting the variable DJANGO_SETTINGS_MODULE
running unset DJANGO_SETTINGS_MODULE
in terminal solved my issue. Hope that it helps someone too.
Actually the problem is that you didn't notice that mysite/urls.py and polls/urls.py are two different files and you modified polls/urls.py instead of putting mysite/urls.py in the urls.py file in ...mysite\mysite folder.
2017-10-05_12:03 ~/mysite/mysite
$ vi urls.py
2017-10-05_12:04 ~/mysite/mysite
$ cd ../..
2017-10-05_12:04 ~
$ mv mysite SENSIBLE_NAME_DJANGO_ROOT