For 2.:

I didn't try it, but if you're putting the path in quotes, include
tries to import it by itself, but there is no module named admin. It
is django.contrib.admin. admin.site.urls without quotes works, because
you probably allready imported it, e.g. to use admin.autodiscover().
That's the reason why play_django without quote doesn't work - that
module is not known to the code, putting it into quotes puts django
into the responsibility to load the appropriate module.

On Jun 21, 3:17 am, tekion <tek...@gmail.com> wrote:
> All,
> I noticed that putting single quote around include argument makes a
> different, for example:
>  (r'^admin/', include(admin.site.urls)),
>  (r'^polls/', include('play_django.polls.urls')),
> works.  Where as:
>  (r'^admin/', include(admin.site.urls)),
>  (r'^polls/', include(play_django.polls.urls)),
>
> yield this error:
> NameError at /polls/
>
> name 'play_django' is not defined
>
> Request Method:         GET
> Request URL:    http://127.0.0.1:8000/polls/
> Exception Type:         NameError
> Exception Value:
>
> name 'play_django' is not defined
>
> Two question:
> 1. why putting single quotes works, no NameError was thrown for
> play_django.
> 2. why admin.site.urls works without quote and putting quote around it
> doesn't, this is an inconsistency that really bothers me.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to