Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the 
current point everything was running smoothly, then I hit a wall that I 
cannot figure out. Maybe I am too focused on following, anyways I need some 
help.

After I updated Polls/urls.py:

from django.conf.urls import patterns, include, url


from polls import views


urlpatterns = patterns('',

   # ex: /polls/

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

   # ex: /polls/5/

   url(r'^(?P\d+)/$',

   views.detail, name='detail'),

   # ex: /polls/5/results/

   url(r'^(?P\d+)/results/$',

   views.results, name='results'),

   # ex: /polls/5/vote/

   url(r'^(?P\d+)/vote/$',

   views.vote, name='vote'),

   )

The next step is "Take a look in your browser, at “/polls/34/”. It’ll run 
the detail() method and display whatever ID you provide in the URL. Try 
“/polls/34/results/” and “/polls/34/vote/” too – these will display the 
placeholder results and voting pages." I tried and nothing. It generates a 
404 error. Where exactly is the 34 coming from? I like to think things 
through but as a beginner in django following a tutorial I need more when 
it comes to this section.

Thanks,

Derrick
 

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
Mauro,
I kind of thought that may be the case. I guess my main issue it is very 
confusing. Creating views is brand new to me, then the authors tell me to 
do something that  up to that point has not been created. Up to that point 
there is 1 record, where did they come up with 34? And where this tutorial 
has been revised many times I am trusting that it is correct and I should 
follow it to the letter. The tutorial needs to be clarified. And of course 
your recommendation worked.

On Wednesday, August 21, 2013 10:23:12 AM UTC-3, Mauro Rocco wrote:
>
> Hi,
> The 34 is the id of the pool record in the database. This means that you 
> don't have a pool with that ID in the database.
> If you already created some pool object you will probably see something if 
> you navigate to this url /polls/1/results/.
> If also in this case you got 404 make sure you actually have some pool 
> object in the db.
>
> Regards
>
> On Wednesday, August 21, 2013 6:02:16 AM UTC+2, Diek Kearney wrote:
>>
>> I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the 
>> current point everything was running smoothly, then I hit a wall that I 
>> cannot figure out. Maybe I am too focused on following, anyways I need some 
>> help.
>>
>> After I updated Polls/urls.py:
>>
>> from django.conf.urls import patterns, include, url
>>
>>
>> from polls import views
>>
>>
>> urlpatterns = patterns('',
>>
>># ex: /polls/
>>
>>url(r'^$', views.index, name='index'),
>>
>># ex: /polls/5/
>>
>>url(r'^(?P\d+)/$',
>>
>>views.detail, name='detail'),
>>
>># ex: /polls/5/results/
>>
>>url(r'^(?P\d+)/results/$',
>>
>>views.results, name='results'),
>>
>># ex: /polls/5/vote/
>>
>>url(r'^(?P\d+)/vote/$',
>>
>>views.vote, name='vote'),
>>
>>)
>>
>> The next step is "Take a look in your browser, at “/polls/34/”. It’ll 
>> run the detail() method and display whatever ID you provide in the URL. 
>> Try “/polls/34/results/” and “/polls/34/vote/” too – these will display the 
>> placeholder results and voting pages." I tried and nothing. It generates 
>> a 404 error. Where exactly is the 34 coming from? I like to think things 
>> through but as a beginner in django following a tutorial I need more when 
>> it comes to this section.
>>
>> Thanks,
>>
>> Derrick
>>  
>>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
Thomas, like I explained to Mauro it was just confusing. Really I should 
have known the problem, I was working on it all last night and I guess I 
needed a break. That said, the tutorial is not clear. In line with the rest 
of the tutorial they should have used 1, vice 34. It works perfect with 1.

Thanks for the help, and that shell trick was quite helpful.

On Wednesday, August 21, 2013 10:50:18 AM UTC-3, Thomas wrote:
>
>
> On 2013-08-20, at 9:02 PM, Diek Kearney > 
> wrote:
>
> I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the 
> current point everything was running smoothly, then I hit a wall that I 
> cannot figure out. Maybe I am too focused on following, anyways I need some 
> help.
> ...
> The next step is "Take a look in your browser, at “/polls/34/”. It’ll run 
> the detail() method and display whatever ID you provide in the URL. Try 
> “/polls/34/results/” and “/polls/34/vote/” too – these will display the 
> placeholder results and voting pages." I tried and nothing. It generates 
> a 404 error. Where exactly is the 34 coming from? I like to think things 
> through but as a beginner in django following a tutorial I need more when 
> it comes to this section.
>
>
>
> Hmm. This *is* confusing since the tutorial should call out the "34" as an 
> example but does not. And at that point in the tutorial it has not given 
> you instruction to enter a particular poll, and not shown you how to get 
> the poll id for any poll you actually did enter.
>
> I was going to suggest that you go to "/polls" to see a list of available 
> polls, but at that point in the tutorial the view for that does not yet 
> exist so no luck there either.
>
> You can try something like:
>
>   python manage.py shell
> from polls.models import Poll
> Poll.objects.all().values()
>
> which will give you a keyword:value list of all fields in your poll model, 
> including the "id" field. That is the value to use in their example query, 
> not the arbitrary "34". Once you have the id (primary key) for a poll, you 
> can try the detailed view which they *have* defined!
>
> You can also look in the database itself for the same info. Try
>
>   python manage.py dbshell
> select * from polls_poll;
>
> hth
>
>   - Tom
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.5 Tutorial Part 3, Test after Update of Polls/urls.py

2013-08-21 Thread Diek Kearney
And I forgot to say thanks, I appreciate the help and guidance.

derrick

On Wednesday, August 21, 2013 10:23:12 AM UTC-3, Mauro Rocco wrote:
>
> Hi,
> The 34 is the id of the pool record in the database. This means that you 
> don't have a pool with that ID in the database.
> If you already created some pool object you will probably see something if 
> you navigate to this url /polls/1/results/.
> If also in this case you got 404 make sure you actually have some pool 
> object in the db.
>
> Regards
>
> On Wednesday, August 21, 2013 6:02:16 AM UTC+2, Diek Kearney wrote:
>>
>> I am going through the Tutorial Django 1.5 Tutorial Part 3, and up to the 
>> current point everything was running smoothly, then I hit a wall that I 
>> cannot figure out. Maybe I am too focused on following, anyways I need some 
>> help.
>>
>> After I updated Polls/urls.py:
>>
>> from django.conf.urls import patterns, include, url
>>
>>
>> from polls import views
>>
>>
>> urlpatterns = patterns('',
>>
>># ex: /polls/
>>
>>url(r'^$', views.index, name='index'),
>>
>># ex: /polls/5/
>>
>>url(r'^(?P\d+)/$',
>>
>>views.detail, name='detail'),
>>
>># ex: /polls/5/results/
>>
>>url(r'^(?P\d+)/results/$',
>>
>>views.results, name='results'),
>>
>># ex: /polls/5/vote/
>>
>>url(r'^(?P\d+)/vote/$',
>>
>>views.vote, name='vote'),
>>
>>)
>>
>> The next step is "Take a look in your browser, at “/polls/34/”. It’ll 
>> run the detail() method and display whatever ID you provide in the URL. 
>> Try “/polls/34/results/” and “/polls/34/vote/” too – these will display the 
>> placeholder results and voting pages." I tried and nothing. It generates 
>> a 404 error. Where exactly is the 34 coming from? I like to think things 
>> through but as a beginner in django following a tutorial I need more when 
>> it comes to this section.
>>
>> Thanks,
>>
>> Derrick
>>  
>>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.