[Django] #31781: Not Found The requested resource was not found on this server

18 views
Skip to first unread message

Django

unread,
Jul 12, 2020, 11:42:56 AM7/12/20
to django-...@googlegroups.com
#31781: Not Found The requested resource was not found on this server
-------------------------------------------+------------------------
Reporter: Achar007 | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: 3.0
Severity: Normal | Keywords: django
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------------+------------------------
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 ?

--
Ticket URL: <https://code.djangoproject.com/ticket/31781>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 13, 2020, 12:23:13 AM7/13/20
to django-...@googlegroups.com
#31781: Not Found The requested resource was not found on this server
---------------------------------+--------------------------------------
Reporter: Achar007 | Owner: nobody
Type: Uncategorized | Status: closed

Component: Template system | Version: 3.0
Severity: Normal | Resolution: invalid

Keywords: django | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by felixxm):

* 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>

Reply all
Reply to author
Forward
0 new messages