Quantcast

Error running Django tutorial

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error running Django tutorial

Mike Kipling
I am working through the Django tutorial Writing your first Django app, part 1.
I am using Windows 10, python 3.5.1 and Django 1.9.2 .
 
In the Write your first view section: 
    after writing the polls/views.py and polls/urls.py files,
    and modifying the manage/urls.py file,
    and starting the server,
 
    When I go to http://localhost:8000/polls/ in the browser I get the following error:

Page not found (404)

Request Method: GET
Request URL: http://localhost:8000/polls/

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

  1. ^admin/

The current URL, polls/, didn't match any of these.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/adde5d06-3663-48d7-b359-c1b984b91ffc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

James Schneider


On Feb 27, 2016 11:49 AM, "Mike Kipling" <[hidden email]> wrote:
>
> I am working through the Django tutorial Writing your first Django app, part 1.
> I am using Windows 10, python 3.5.1 and Django 1.9.2 .
>  
> In the Write your first view section: 
>     after writing the polls/views.py and polls/urls.py files,
>     and modifying the manage/urls.py file,
>     and starting the server,
>  
>     When I go to http://localhost:8000/polls/ in the browser I get the following error:
>
> Page not found (404)
> Request Method:
> GET
> Request URL:
> http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
>
> ^admin/
>
> The current URL, polls/, didn't match any of these.
>

It doesn't appear that you've included your apps urls.py correctly using an include() in your project urls.py.

Can you post both of your urls.py files?

-James

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CA%2Be%2BciWixxatHfJ2736W9S8k8jCsgaF1DSu3j1AcTdDRZtbEMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling


On Saturday, February 27, 2016 at 2:06:42 PM UTC-6, James Schneider wrote:


On Feb 27, 2016 11:49 AM, "Mike Kipling" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Q1MVTCf3HgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kip...@...> wrote:
>
> I am working through the Django tutorial Writing your first Django app, part 1.
> I am using Windows 10, python 3.5.1 and Django 1.9.2 .
>  
> In the Write your first view section: 
>     after writing the polls/views.py and polls/urls.py files,
>     and modifying the manage/urls.py file,
>     and starting the server,
>  
>     When I go to <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/ in the browser I get the following error:
>
> Page not found (404)
> Request Method:
> GET
> Request URL:
> <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
>
> ^admin/
>
> The current URL, polls/, didn't match any of these.
>

It doesn't appear that you've included your apps urls.py correctly using an include() in your project urls.py.

Can you post both of your urls.py files?

-James

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/21babdd1-1113-4712-8ead-fa3e25c50df9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
Here are the two urls.py files:

polls/urls.py

from django.conf.urls import url

from . import views

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

mysite/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),
]

Mike



On Saturday, February 27, 2016 at 1:50:39 PM UTC-6, Mike Kipling wrote:
I am working through the Django tutorial Writing your first Django app, part 1.
I am using Windows 10, python 3.5.1 and Django 1.9.2 .
 
In the Write your first view section: 
    after writing the polls/views.py and polls/urls.py files,
    and modifying the manage/urls.py file,
    and starting the server,
 
    When I go to <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/ in the browser I get the following error:

Page not found (404)

Request Method: GET
Request URL: <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/

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

  1. ^admin/

The current URL, polls/, didn't match any of these.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/57003bfd-6df6-4531-84f1-50747f2389eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Igor Makarov
Mike, do you have the server restarted? 
As for me, the shell window says: 
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.



воскресенье, 28 февраля 2016 г., 18:15:24 UTC+3 пользователь Mike Kipling написал:
Here are the two urls.py files:

polls/urls.py

from django.conf.urls import url

from . import views

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

mysite/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),
]

Mike



On Saturday, February 27, 2016 at 1:50:39 PM UTC-6, Mike Kipling wrote:
I am working through the Django tutorial Writing your first Django app, part 1.
I am using Windows 10, python 3.5.1 and Django 1.9.2 .
 
In the Write your first view section: 
    after writing the polls/views.py and polls/urls.py files,
    and modifying the manage/urls.py file,
    and starting the server,
 
    When I go to <a href="http://localhost:8000/polls/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/ in the browser I get the following error:

Page not found (404)

Request Method: GET
Request URL: <a href="http://localhost:8000/polls/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/

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

  1. ^admin/

The current URL, polls/, didn't match any of these.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/86c567ef-db30-4fde-b334-3c4a0931420d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
Yes, the server was started.  Here are the contents of the command window, including after trying to go to the website.


C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
February 28, 2016 - 21:05:58
Django version 1.9.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /polls/
[28/Feb/2016 21:06:30] "GET /polls/ HTTP/1.1" 404 1921
Not Found: /favicon.ico
[28/Feb/2016 21:06:31] "GET /favicon.ico HTTP/1.1" 404 1936


On Saturday, February 27, 2016 at 1:50:39 PM UTC-6, Mike Kipling wrote:
I am working through the Django tutorial Writing your first Django app, part 1.
I am using Windows 10, python 3.5.1 and Django 1.9.2 .
 
In the Write your first view section: 
    after writing the polls/views.py and polls/urls.py files,
    and modifying the manage/urls.py file,
    and starting the server,
 
    When I go to <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/ in the browser I get the following error:

Page not found (404)

Request Method: GET
Request URL: <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/

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

  1. ^admin/

The current URL, polls/, didn't match any of these.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/33ec29f2-9800-44b5-af10-1f1a2a5d9713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
Igor,

Yes, the server was started.  Here are the contents of the command window including after trying to go to the website.


C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
February 28, 2016 - 21:05:58
Django version 1.9.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /polls/
[28/Feb/2016 21:06:30] "GET /polls/ HTTP/1.1" 404 1921
Not Found: /favicon.ico
[28/Feb/2016 21:06:31] "GET /favicon.ico HTTP/1.1" 404 1936

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/b1e75624-85f9-437f-b507-34ae0f6c2594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

jorrit787
Did you add 'polls' to your list of INSTALLED_APPS in your settings.py? After that you should run > python manage.py migrate like the terminal is suggesting to you.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/b4f497cd-4653-47ae-a935-33358b3a7569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
Jorr,

No, I did not modify the settings.py file, because the tutorial specifically states: 

Note

Ignore the warning about unapplied database migrations for now; we’ll deal with the database shortly.


Here is a link to the tutorial: https://docs.djangoproject.com/en/1.9/intro/tutorial01/





--
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 [hidden email].
To post to this group, send email to [hidden email].
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/faaf04fa-6c50-4648-9ef6-d2f1b3c1e497%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

jorrit787
Well that's strange... The problem appears to be that your polls.urls file is not getting included in your project's URLConf (since the error message in your first post says that the only URL tried was admin/ ). I'm not sure if adding the app to INSTALLED_APPS is necessary for an app's URLConf to be able to be included, but it's worth a try. In FirstApp/settings.py add 'polls' to the list of INSTALLED_APPS so that it looks something like this:

INSTALLED_APPS = [
   
'django.contrib.admin',
   
'django.contrib.auth',
   
'django.contrib.contenttypes',
   
'django.contrib.sessions',
   
'django.contrib.messages',
   
'django.contrib.staticfiles',
   
'polls.apps.PollsConfig',
]



Otherwise it does seem like it could be a file refresh problem.


On Monday, February 29, 2016 at 4:03:42 PM UTC+1, Mike Kipling wrote:
Jorr,

No, I did not modify the settings.py file, because the tutorial specifically states: 

Note

Ignore the warning about unapplied database migrations for now; we’ll deal with the database shortly.


Here is a link to the tutorial: <a href="https://docs.djangoproject.com/en/1.9/intro/tutorial01/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.9%2Fintro%2Ftutorial01%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNGzuhXfVaLYPKNUyJoNcEX11VhiEg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.9%2Fintro%2Ftutorial01%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNGzuhXfVaLYPKNUyJoNcEX11VhiEg&#39;;return true;">https://docs.djangoproject.com/en/1.9/intro/tutorial01/





--
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 [hidden email].
To post to this group, send email to [hidden email].
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/d00ca4a7-856e-4045-bc99-7b03c037b46f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
I added polls to settings.py :
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'polls.apps.PollsConfig',
]

Then I tried the migration:
C:\Data\Django_Code\FirstApp\mysite>python manage.py migrate
Operations to perform:
  Apply all migrations: admin, sessions, contenttypes, auth
Running migrations:
  No migrations to apply.

Then I started the server and tried going to the address, but got the same results:
C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
February 29, 2016 - 14:16:37
Django version 1.9.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /polls/
[29/Feb/2016 14:16:46] "GET /polls/ HTTP/1.1" 404 1921

I am working on a Windows OS, so I thought that perhaps changing the '/' in the mysite\urls.py to '\\' might help, but it did not.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/8cc60a51-0c12-4404-a03a-5f6a857f533e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

jorrit787
Can you attach your entire project's code in a ZIP file? I'm curious to test this myself...


On Monday, February 29, 2016 at 9:23:20 PM UTC+1, Mike Kipling wrote:
I added polls to settings.py :
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'polls.apps.PollsConfig',
]

Then I tried the migration:
C:\Data\Django_Code\FirstApp\mysite>python manage.py migrate
Operations to perform:
  Apply all migrations: admin, sessions, contenttypes, auth
Running migrations:
  No migrations to apply.

Then I started the server and tried going to the address, but got the same results:
C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
February 29, 2016 - 14:16:37
Django version 1.9.2, using settings 'mysite.settings'
Starting development server at <a href="http://127.0.0.1:8000/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q&#39;;return true;">http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /polls/
[29/Feb/2016 14:16:46] "GET /polls/ HTTP/1.1" 404 1921

I am working on a Windows OS, so I thought that perhaps changing the '/' in the mysite\urls.py to '\\' might help, but it did not.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/bc913fc7-fe00-427f-87c7-cd5d52783551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Mike Kipling
In reply to this post by Mike Kipling
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 [hidden email].
To post to this group, send email to [hidden email].
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/baedaefb-d570-4154-9ed1-95fba413ff71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

jorrit787
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 [hidden email].
To post to this group, send email to [hidden email].
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/4ce4dd13-aa8b-4981-8a0a-727a16ac19ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Ruth
In reply to this post by Mike Kipling
I am getting the very same problem, despite adding include to my mysite\urls.py file.
I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS
Could it be a python 2.7 problem?
Thanks,
Ruth

On Saturday, February 27, 2016 at 11:50:39 AM UTC-8, Mike Kipling wrote:
I am working through the Django tutorial Writing your first Django app, part 1.
I am using Windows 10, python 3.5.1 and Django 1.9.2 .
 
In the Write your first view section: 
    after writing the polls/views.py and polls/urls.py files,
    and modifying the manage/urls.py file,
    and starting the server,
 
    When I go to <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/ in the browser I get the following error:

Page not found (404)

Request Method: GET
Request URL: <a href="http://localhost:8000/polls/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A8000%2Fpolls%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE0WQ47CxFPdH4O4KgMqKCW66NpKA&#39;;return true;">http://localhost:8000/polls/

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

  1. ^admin/

The current URL, polls/, didn't match any of these.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/68e5fd69-2581-4f56-b413-36bdf57aad2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Ruth
In reply to this post by jorrit787
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, [hidden email] 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 [hidden email].
To post to this group, send email to [hidden email].
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.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Bruno Barbosa-2
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

On Thu, Mar 17, 2016 at 3:50 PM, Ruth <[hidden email]> 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, [hidden email] 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 [hidden email].
To post to this group, send email to [hidden email].
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.

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 [hidden email].
To post to this group, send email to [hidden email].
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/CAHxcCH4nmFpXeHmVhFJddeB9f0BACF636McCUu7DNr84mwz0Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Noam Gal
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,
I'm having the same problem, already read few forums... no answer...
It would be great if someone could give an answer.
I'm windows 7, Django 1.9.5.
Thanks!

mysite.rar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

David Bon
In reply to this post by Bruno Barbosa-2
I was having the exact same problem.

In fact I was not modiying the right urls.py

On windows dirs i've got:
mysite/
     urls.py


In fact there the in your

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/32a8c6ca-047a-4bf4-9e6a-e7e2121a2dc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error running Django tutorial

Vanja Falck
In reply to this post by Bruno Barbosa-2
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 <a href="https://gist.github.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG9eZTMJSrRIUGgGjzZU6NvSwJaPQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG9eZTMJSrRIUGgGjzZU6NvSwJaPQ&#39;;return true;">https://gist.github.com/ and reply this email.

--
Bruno Barbosa
Web Developer
<a href="http://brunobarbosa.com.br" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbrunobarbosa.com.br\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEEMtu-cK7H3wubTDbcB3Tgpz00lQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fbrunobarbosa.com.br\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEEMtu-cK7H3wubTDbcB3Tgpz00lQ&#39;;return true;">brunobarbosa.com.br

On Thu, Mar 17, 2016 at 3:50 PM, Ruth <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZWoYqN_OJAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">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, [hidden email] 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZWoYqN_OJAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZWoYqN_OJAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To post to this group, send email to [hidden email].
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/d6671326-c2ca-4f9e-98c8-4fe3c9eee9ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
12
Loading...