Django - Sobre urls.py y su contenido

 
Vista:
Imágen de perfil de Ernesto
Val: 2
Ha aumentado 1 puesto en Django (en relación al último mes)
Gráfica de Django

Sobre urls.py y su contenido

Publicado por Ernesto (2 intervenciones) el 08/03/2017 16:59:36
Buenas, soy nuevo en Django, y estoy tratando de visualizar una pagina que hice, que se llama principal.html

en URLS.PY, lo llene asi

1
2
3
4
5
6
from django.conf.urls import url
from PInvest.vista import entrada
 
urlpatterns = [
    url(r'^entrada/$',entrada),
]


y mi vista.py

1
2
3
4
from django.http import HttpResponse
 
def entrada(request):
    return HttpResponse("principal.html")


pero cuando voy al navegador me dice


Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/principal.html

Using the URLconf defined in PInvest.urls, Django tried these URL patterns, in this order:

^entrada/$

The current URL, principal.html, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.


Que me puede estar pasando
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder