wtreston
wtreston

Reputation: 1061

Django URLs aren't working

Keep getting a 404 error whenever I try and access the site.

This is my urls.py in my app called userprofile:

urlpatterns = [
    url(r'ˆ$', views.index, name = 'index')
]

These are my urls.py:

from userprofile import urls


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'ˆusers/', include('userprofile.urls')),
]

and this is my views.py:

def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")

I don't get any errors in the console.

Traceback:
Not Found: /users/
[11/Jun/2017 17:17:47] "GET /users/ HTTP/1.1" 404 2036

and I have tried /users/

Upvotes: 2

Views: 179

Answers (1)

Moses Koledoye
Moses Koledoye

Reputation: 78564

You're using a different albeit look-alike character instead of the regex line start character:

ˆ

Instead of:

^

>>> 'ˆ' == '^'
False

Upvotes: 2

Related Questions