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:
Environment: Request Method: GET Request URL: http://www.quotidiano.net/elezioni_2012/comunali/ Django Version: 1.1.1 Python Version: 2.4.3 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'comunali', 'client_soap'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response 82. callback, callback_args, callback_kwargs = resolver.resolve( File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in resolve 216. for pattern in self.url_patterns: File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in _get_url_patterns 245. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in _get_urlconf_module 240. self._urlconf_module = import_module(self.urlconf_name) File "/usr/lib/python2.4/site-packages/django/utils/importlib.py" in import_module 35. __import__(name) 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. -- 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.