Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

489
Vistas
how to overcome the following url issue?

Hello I am beginner learning Django I am triying to follow this tutorial:

https://docs.djangoproject.com/en/1.11/intro/tutorial01/

I created an app called Polls to test my site:

Since I dont have idea where to put the file called urls.py I put this file at the following directories:

Django/mysite/polls/urls.py
Django/mysite/polls/migrations/urls.py

This file contains:

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]

And finally I added the following lines:

at this level:

Django/mysite/mysite/urls.py

this file contains:

from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls import url
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^polls/', include('polls.urls')),

]

I dont know where is the issue but when I run:

Django/mysite$ python3 manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.

April 21, 2017 - 15:59:43
Django version 1.10.5, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

I got in the page the following:

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^admin/
^polls/
The current URL, , 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.

So I really appreciate support to overcome this issue, thanks for the support

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

the urls.py doesn't go into the migrations folder.

Did you register your Polls app in the settings.py file? you need to add the name of the Polls app to the INSTALLED_APPS list.

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'example: add app name here', 
'polls',]

you then need to create a url.py file within your polls app.

polls/
     urls.py

In that file you would add:

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]

the url you want to use in your browser would be something like this:

 http://127.0.0.1:8000/polls
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda