On 3 déc, 13:22, Alan <[EMAIL PROTECTED]> wrote:
> Hi, so I did the tutorial and did a simple modification in order to
> get 'polls' views and 'admin' view too but I am failing.
>
> It's that:
>
> for mysite/urls.py:
> from django.conf.urls.defaults import *
> from django.contrib import admin
> admin.autodiscover()
> urlpatterns = patterns('',
>     (r'^admin/(.*)', admin.site.root),
>     (r'^polls/', include('mysite.polls.urls')),
> )
>
> But, if so, then admin pages failed (http://localhost:8000/admin/):
> TemplateSyntaxError at /admin/
> Caught an exception while rendering: Tried vote in module
> mysite.polls.views. Error was: 'module' object has no attribute 'vote'
> ...
>
> If I want 'admin' view, then I have to comment out line "(r'^polls/',
> include('mysite.polls.urls')),"

I strongly suspect an error in either your polls.urls module or your
polls.views module. It seems you're trying to access some unexisting
symbol of the polls.views module (a view function perhaps ?) named
'vote'.

> Well, I must confess that my knowledge on regexp is limited. So, in
> the end, what should I do about mysite/urls.py in order to get both
> admin and polls pages working?

first make sure the whole thing works correctly without the admin
part.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to