Is it possible that the problem is not in this urls.py, but rather in
'polls.urls'?

I'd check line 20 there, just to see if there's an obvious python
syntax error.

HTH

c

On Jan 4, 8:08 am, hank23 <hversem...@stchas.edu> wrote:
> After removing the commented code, saving urls.py, restarting the
> server and then requesting the sites admin page now I get the admin
> login screen. But after I type in my username and pw then it again
> gives me the following screen:
>
> TemplateSyntaxError at /admin/
> Caught SyntaxError while rendering: invalid syntax (urls.py, line
> 20)Request Method: GET
> Request URL:http://127.0.0.1:8000/admin/
> Django Version: 1.2.3
> Exception Type: TemplateSyntaxError
> Exception Value: Caught SyntaxError while rendering: invalid syntax
> (urls.py, line 20)
> Exception Location: C:\Python27\lib\site-packages\django\utils
> \importlib.py in import_module, line 35
> Python Executable: C:\Python27\python.exe
> Python Version: 2.7.1
> Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> Server time: Tue, 4 Jan 2011 09:45:54 -0600
>
> and still references the same line in urls.py, which is confusing
> because now it shouldn't have a line 20. Here's what urls.py currently
> looks like:
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
>     (r'^polls/', include('polls.urls')),
>     (r'^admin/', include(admin.site.urls)),
> )
>
> Could this problem be related to windows 7 environment variables not
> being set properly? I ask because I was upgraded recently from Win XP
> to Windows 7 and have been working to set up my environment variables
> back to where they should be. I thought I had previously fixed all of
> them, but maybe I missed something. Please advise. Thanks.
>
> On Jan 4, 9:36 am, Piotr Zalewa <zal...@gmail.com> wrote:
>
>
>
> > what happens if you'remove the commented lines?
>
> > On 01/04/11 15:22, hank23 wrote:
>
> > > Can someone explain to me what the following error is trying to tell
> > > me:
>
> > > SyntaxError at /polls/1
> > > invalid syntax (urls.py, line 20)Request Method: GET
> > > Request URL:http://127.0.0.1:8000/polls/1
> > > Django Version: 1.2.3
> > > Exception Type: SyntaxError
> > > Exception Value: invalid syntax (urls.py, line 20)
> > > Exception Location: C:\Python27\lib\site-packages\django\utils
> > > \importlib.py in import_module, line 35
> > > Python Executable: C:\Python27\python.exe
> > > Python Version: 2.7.1
> > > Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> > > \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> > > 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> > > \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> > > Server time: Tue, 4 Jan 2011 09:12:32 -0600
>
> > > The urls.py module that it is referring to looks like this:
>
> > > from django.conf.urls.defaults import *
>
> > > # Uncomment the next two lines to enable the admin:
> > > from django.contrib import admin
> > > admin.autodiscover()
>
> > > #urlpatterns = patterns('',
> > >     # Example:
> > >     # (r'^mysite/', include('mysite.foo.urls')),
> > >     # Uncomment the admin/doc line below to enable admin
> > > documentation:
> > >     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> > >     # Uncomment the next line to enable the admin:
> > >     # (r'^admin/', include(admin.site.urls)),    (r'^polls/$',
> > > 'polls.views.index'),
> > > #    (r'^polls/(?P<poll_id>\d+)/$', 'polls.views.detail'),
> > > #    (r'^polls/(?P<poll_id>\d+)/results/$', 'polls.views.results'),
> > > #    (r'^polls/(?P<poll_id>\d+)/vote/$', 'polls.views.vote'),
> > > #    (r'^admin/', include(admin.site.urls)),
> > > #)
>
> > > urlpatterns = patterns('',
> > >     (r'^polls/', include('polls.urls')),
> > >     (r'^admin/', include(admin.site.urls)),
> > > )
>
> > > and I thought it had previously worked ok when I last tried to use it
> > > back on the 23rd. I would appreciate any help or direction in
> > > debugging this since I'm relatively new to both django and python.
> > > Thanks.
>
> > --
> > blog  http://piotr.zalewa.info
> > jobs  http://webdev.zalewa.info
> > twit  http://twitter.com/zalun
> > face  http://facebook.com/zaloon-Hide quoted text -
>
> > - Show quoted text -

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