from django.conf.urls import url from django.conf.urls import include from django.conf.urls import polls\ from django.contrib import admin
urlpatterns = [ url(r'^polls/', include('polls.urls')), url(r'^admin/', include('admin.site.urls')), ] Here is a copy of the the mysite.py file. I'm not sure how, but the error stopped after I imported imclude and polls this way. On Tuesday, March 7, 2017 at 6:55:47 AM UTC-5, Vanja Falck wrote: > > Hi, > I am also facing the same problems with the djangoproject tutorial - I > have changed the settings.py file to add the polls app, but it did not > solve the issue: > When runserver: I get the admin page, but not the polls page. Get a > similar 404 error page as Kipling, but with the ˆpolls/ url in the list. > > Running in virtualenv - with python 3.5.2 and django 10.1.6 on Ubuntu > 16.04. Any idea of what is wrong? > > Here is my code: > > # Your first view: opprettet polls/urls.py > > from django.conf.urls import url > > from . import views > > urlpatterns = [ > url(r'ˆ$', views.index, name='index'), > ] > > # Your first view polls/views.py > > from django.http import HttpResponse > > def index(request): > return HttpResponse("Hoppla, polls index her..") > > # Site/urls.py > > from django.conf.urls import include, url > from django.contrib import admin > > urlpatterns = [ > url(r'ˆpolls/', include('polls.urls')), > url(r'^admin/', admin.site.urls), > ] > # Site/settings.py > # Application definition > > INSTALLED_APPS = [ > 'django.contrib.admin', > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.messages', > 'django.contrib.staticfiles', > 'polls.apps.PollsConfig', > > > > > > torsdag 17. mars 2016 21.56.04 UTC+1 skrev Bruno Barbosa følgende: >> >> Ruth, >> >> Show me the code! >> >> How is your urls.py? and the views.py? >> >> paste your code in https://gist.github.com/ and reply this email. >> >> -- >> Bruno Barbosa >> Web Developer >> *brunobarbosa.com.br <http://brunobarbosa.com.br>* >> >> On Thu, Mar 17, 2016 at 3:50 PM, Ruth <rmi...@contextualgenomics.com> >> wrote: >> >>> Hi, >>> I am getting the same problem, despite having include in my >>> mysite\urls.py file. >>> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS. >>> Could it by a Python 2.7 problem? >>> Thanks, >>> Ruth >>> >>> On Wednesday, March 2, 2016 at 12:19:16 PM UTC-8, jorr...@gmail.com >>> wrote: >>>> >>>> Glad you got it solved!! >>>> >>>> >>>> On Monday, February 29, 2016 at 10:10:58 PM UTC+1, Mike Kipling wrote: >>>>> >>>>> I found the problem. >>>>> >>>>> When the mysite\urls.py file is created, it has this line already in >>>>> it. >>>>> >>>>> from django.conf.urls import url >>>>> >>>>> The tutorial asks you to add the following lines to the file. >>>>> >>>>> from django.conf.urls import include, url >>>>> from django.contrib import admin >>>>> >>>>> urlpatterns = [ >>>>> url(r'^polls/', include('polls.urls')), >>>>> url(r'^admin/', admin.site.urls), >>>>> ] >>>>> >>>>> I must did not notice that the 'include' was different, and so I had >>>>> not placed it into the file. I changed the file to add the 'include' and >>>>> everything worked. >>>>> >>>>> Thank you for the help. >>>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to django-users...@googlegroups.com. >>> To post to this group, send email to django...@googlegroups.com. >>> Visit this group at https://groups.google.com/group/django-users. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ba72910a-d249-4e15-bd5d-117f696b22ba%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.