Re: Decoupling the URLconfs Tutorial 3 Problem
Thanks Karen. On Apr 14, 11:33 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 3:03 AM, garazy <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am going through the tutorial and have come to Decoupling the > > URLconfs @http://www.djangoproject.com/documentation/tutorial03/ > > > When I decouple the page athttp://192.168.0.101:8000/polls/just > > gives me a "It Worked!" welcome page. I've attached my urls.py configs > > > Thanks for your help, > > > Gary > > > mysite/urls.py > > =-=-=-=-=-=-=-= > > > from django.conf.urls.defaults import * > > > urlpatterns = patterns( > >(r'^polls/', include('mysite.polls.urls')), > > ) > > You are missing the first argument to patterns() here, which is the view > prefix. For your case it should be an empty string: > > urlpatterns = patterns('', >(r'^polls/', include('mysite.polls.urls')), > ) > > Karen > > > > > mysite/polls/urls.py > > =-=-=-=-=-=-=-=-=-= > > > from django.conf.urls.defaults import * > > > urlpatterns = patterns('mysite.polls.views', > >(r'^$', 'index'), > >(r'^(?P\d+)/$', 'detail'), > >(r'^(?P\d+)/results/$', 'results'), > >(r'^(?P\d+)/vote/$', 'vote'), > > ) > > > mysite/polls/views.py > > =-=-=-=-=-=-=-=-=-=-= > > > from django.shortcuts import render_to_response, get_object_or_404 > > from mysite.polls.models import Poll > > > def index(request): > >latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] > >return render_to_response('polls/index.html', {'latest_poll_list': > > latest_poll_list}) > > > def detail(request, poll_id): > >p = get_object_or_404(Poll, pk=poll_id) > >return render_to_response('polls/detail.html', {'poll': p}) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Decoupling the URLconfs Tutorial 3 Problem
Hi, I am going through the tutorial and have come to Decoupling the URLconfs @ http://www.djangoproject.com/documentation/tutorial03/ When I decouple the page at http://192.168.0.101:8000/polls/ just gives me a "It Worked!" welcome page. I've attached my urls.py configs Thanks for your help, Gary mysite/urls.py =-=-=-=-=-=-=-= from django.conf.urls.defaults import * urlpatterns = patterns( (r'^polls/', include('mysite.polls.urls')), ) mysite/polls/urls.py =-=-=-=-=-=-=-=-=-= from django.conf.urls.defaults import * urlpatterns = patterns('mysite.polls.views', (r'^$', 'index'), (r'^(?P\d+)/$', 'detail'), (r'^(?P\d+)/results/$', 'results'), (r'^(?P\d+)/vote/$', 'vote'), ) mysite/polls/views.py =-=-=-=-=-=-=-=-=-=-= from django.shortcuts import render_to_response, get_object_or_404 from mysite.polls.models import Poll def index(request): latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list}) def detail(request, poll_id): p = get_object_or_404(Poll, pk=poll_id) return render_to_response('polls/detail.html', {'poll': p}) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django Tutorial Site not in Admin
Apologies, I thought the class Admin was at the base didn't realise it was under the class Polls. That has fixed it now. Gary On Apr 13, 8:31 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 13-Apr-08, at 3:54 PM, garazy wrote: > > > It does not appear in the admin when I login with the superuser > > account that got created when I installed the project. Please let me > > know what other information you need me to provide to debug this large > > problem. > > please post your models.py file > > -- > > regards > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Django Tutorial Site not in Admin
Hi, I am using the SVN version of Django version 0.97-pre-SVN-7419 on Ubuntu Edgy with mysql database. I have followed the tutorial, the shell code works fine and my DB is hooked up correctly. I have the admin working, I added the class Admin: pass to the mysite/polls/models.py file It does not appear in the admin when I login with the superuser account that got created when I installed the project. Please let me know what other information you need me to provide to debug this large problem. Please help, Gary --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---