Opened 5 years ago
Closed 5 years ago
#31781 closed Uncategorized (invalid)
Not Found The requested resource was not found on this server
| Reported by: | Achar007 | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | 3.0 |
| Severity: | Normal | Keywords: | django |
| Cc: | bharath_achar@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
I installed django and virtual env.
I created a project(nandiasgarden-project) and an app(pizza).
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 ?
Note:
See TracTickets
for help on using tickets.
Please don't use Trac as a support channel. Closing per TicketClosingReasons/UseSupportChannels.