I am following a youtube tutorial, and am getting an error...
getting an error
The requested URL /hello was not found on this server.
site/urls.py
urlpatterns = patterns('',
url(r'^hello/$', article.views.hello),
...
)
article/views.py
from django.shortcuts import render
from django.http import HttpResponse
def hello(request):
name = 'mike'
html = '<html><body> sup %s </body></html> ' %name
return HttpRequest(html)
site/settings.py
INSTALLED_APPS = (
...
'article',
)
The request url /hello
does not have a trailing slash (/
). You can make the url pattern match /
optionally by appending ?
:
url(r'^hello/?$', article.views.hello),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With