I started working on same project recently and I have noticed some strange problem I can’t resolve.
After running Django developement server, and typing address into the browset I get following output in terminal:
[02/Oct/2012 00:38:08] "GET / HTTP/1.1" 200 482
[02/Oct/2012 00:38:09] "GET /static/style.css HTTP/1.1" 200 349
[02/Oct/2012 00:38:09] "GET / HTTP/1.1" 200 482
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 241, in __call__
response = self.get_response(request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 146, in get_response
response = debug.technical_404_response(request, e)
File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 432, in technical_404_response
'reason': smart_str(exception, errors='replace'),
File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", line 116, in smart_str
return str(s)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 235, in __repr__
return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__, self.urlconf_name, self.app_name, self.namespace, self.regex.pattern))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 52: ordinal not in range(128)
Page is displayed properly and server is still working, but I think this is annoying. And I’m also curious what is this about.
So, after a while I figured out, that if I comment out second pattern in my urls.py the error message is no longer displayed. My urls.py:
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'apps.articles.views.index', name='homepage'),
url(r'', include('articles.urls', namespace='articles')),
url(r'^admin/', include(admin.site.urls)),
)
and apps/users/urls.py:
# -*- encoding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('articles.views',
url(r'^articles/$', 'article_list', {'all': True}, name='article_list'),
)
I’ve also noticed, that my style.css file isd/*position: absolute;
not working properly. I’ve set border aroun
Does your application name have non-ascii characters?