2 Stimmen

Django: Fehler bei / falsches Zeichen im Gruppennamen

Ich war nach Apress - Practical Django Project von James Bennet und ich bekam diese böse Fehler aus heiterem Himmel. Können Sie mir helfen?

Jetzt geht's los:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.2.5
Python Version: 2.5.4

Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'django.contrib.flatpages',
 'cms.search',
 'coltrane',
 'tagging']

Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  91.                         request.path_info)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in resolve
  215.             for pattern in self.url_patterns:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_url_patterns
  244.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  239.             self._urlconf_module = import_module(self.urlconf_name)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/Users/danielcorreia/Sites/test_Django/cms/../cms/urls.py" in <module>
  21.   (r'', include('django.contrib.flatpages.urls')),
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/urls/defaults.py" in patterns
  24.             t = url(prefix=prefix, *t)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/urls/defaults.py" in url
  41.         return RegexURLPattern(regex, view, kwargs, name)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/urlresolvers.py" in __init__
  89.         self.regex = re.compile(regex, re.UNICODE)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py" in compile
  188.     return _compile(pattern, flags)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py" in _compile
  241.         raise error, v # invalid expression

Exception Type: error at /
Exception Value: bad character in group name

Oh! Ich bin ein Neuling in Django. Bitte seien Sie sanft :)

Hier ist die urls.py:

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'^cms/', include('cms.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'tiny_mce/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': '/Users/danielcorreia/Sites/tinymce/jscripts/tiny_mce' }),
    (r'^search/$', 'cms.search.views.search'),
    (r'^weblog/$', 'coltrane.views.entries_index'),
    (r'^weblog/(?P<year\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-\w]+)/$', 'coltrane.views.entry_detail'),
    (r'', include('django.contrib.flatpages.urls')),
)

CodeJaeger.com

CodeJaeger ist eine Gemeinschaft für Programmierer, die täglich Hilfe erhalten..
Wir haben viele Inhalte, und Sie können auch Ihre eigenen Fragen stellen oder die Fragen anderer Leute lösen.

Powered by:

X