开发者

Django and Django CMS Error

开发者 https://www.devze.com 2023-03-19 11:52 出处:网络
I\'ve just done a fresh install of Django and Django-CMS from the ground up (including a brand new virtualenv and python build). I\'m getting this bizzarre error.. google has been no help. Ideas?

I've just done a fresh install of Django and Django-CMS from the ground up (including a brand new virtualenv and python build). I'm getting this bizzarre error.. google has been no help. Ideas?

TemplateSyntaxError at /
Caught AttributeError while rendering: 'str' object has no attribute 'regex'

In template /Users/bdunlay/python/python-2.5/lib/python2.5/site-packages/django_cms2.1.0.beta3-py2.5.egg/cms/templates/cms/new.html, error at line 37

Here's the line:

37: <li>Log into <a href="{% url admin:index %}">admin</a> and <a href="{% url pages-root %}admin/cms/page/add/">add</a> some pages.</li>

more stuff

/Users/bdunlay/python/python-2.5/lib/python2.5/site-packages/Django-1.3-py2.5.egg/django/core/urlresolvers.py in _populate
    return '<%s %s (%s:%s) %s>' % (self.__class__.__name__, self.urlconf_name, self.app_name, self.namespace, self.regex.pattern)
def _populate(self):
    lookups = MultiValueDict()
    namespaces = {}
    apps = {}
    for pattern in reversed(self.url_patterns):
-->     p_pattern = pattern.regex.pattern ...
        if p_pattern.startswith('^'):
            p_pattern = p_pattern[1:]
        if isinstance(pattern, RegexURLResolver):
            if pattern.namespace:
                namespaces[pattern.namespace] = (p_pattern, pattern)
                if pattern.app_n开发者_高级运维ame:


Just had this error. In my case it was caused by having tripple quoted string (comment) in urls.py patterns.
Actually it was not interpreted as a comment and was passed to function!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号