Edited pizza.views under pizza
{{{
from django.shortcuts import render
# Create your views here.
def home(request):
return render(request, 'pizza/home.html')
def order(request):
return render(request, 'pizza/order.html')
}}}
created 2 html files under - pizza/templates/pizza/
home.html
{{{
<h1>Nandia's Garden</h1>
<a href="{% url 'order' %}">Order a Pizza</a>
}}}
order.html
{{{
<h1>Order a Pizza</h1>
}}}
settings as below:
{{{
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'pizza',
]
}}}
And finally urls as
{{{
from django.contrib import admin
from django.urls import path
from pizza import views
urlpatterns = [
path('admin/', admin.site.urls),
path('',views.home name='home'),
path('order',views.order name='order'),
}}}
when run server and then fire the website, I get below:
Not Found The requested resource was not found on this server
How to fix this and what's the resolution ?
--
Ticket URL: <https://code.djangoproject.com/ticket/31781>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Please don't use Trac as a support channel. Closing per
TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/31781#comment:1>