Hi everybody. I recently started working on a project involving heavy
Django usage.
I basically retrieve data in xml from a SOAP web service using suds,
parse the xml into a db and then (I should) popuate a web page.
I'm a beginner both in Python and Django, please bear with me and my
possibly ill-formed questions!
I've formed a reduced set of correct views and templates for the
purpose of testing but i cannot step through this:
<snip>
Exception Type: SyntaxError at /comunali/
Exception Value: invalid syntax (urls.py, line 23)
which I confirmed by trying to import urls py fin the shell.
I'm quite puzzled by the fact that line 23 in my file is not a line of
code, since urls.py has only 22 lines. I looked through it in search
of tab/whitespace misuse or punctuation errors (that I often get when
first running any script I made).
Here is urls.py:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
#Example:
url('^$','comunali.views.index', name='comunali_index'),
url(r'^provincia/(?P<nome>[^/]+)/','comunali.views. provincia',
name = 'comunali_provincia'),
url(r'^comune/(?P<nome>[^/]+)/', 'comunali.views.comune', name
= 'comunali_comune'),
url(r'^ballottaggio/(?P<nome>[^/]+)/',
'comunali.views.ballottaggio', name = 'comunali_ballottaggio'),
url(r'^province/(?P<regione>[^/]
+)/','comunali.views.province', name = 'comunali_province'),
url(r'^province/$','comunali.views.province', name =
'comunali_province'),
url(r'^comuni/(?P<provincia>[^/]+)/', 'comunali.views.comuni',
name = 'comunali_regioni'),
url(r'^comuni/$', 'comunali.views.comuni', name =
'comunali_regioni'),
url(r'^search/(?P<key>[^/]+)/',
'comunali.views.search_comuni', name = 'comunali_search_comuni'),
url(r'^(?P<elezione>[^/]+)/comune/(?P<nome>[^/]+)/',
'comunali.views.comune', name = 'comunali_comune'),
url(r'^incluso/', 'comunali.views.inc', name =
'comunali_incluso'),
#Uncomment the admin/doc line below and add
'django.contrib.admindocs'
#to INSTALLED_APPS 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)),
any suggestions are welcome.
Indeed, you're missing a line 23, which would close the parentheses opened in the first line.
--
DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zfNEhB7f3lQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment