0

From here, I have changed my model like this:

class MyModel(User):

    class Meta:
        verbose_name=u"my app verbose name"
        app_label = u"My Members"
        db_table = "members_mymodel"

Now I have an error when going to app in django admin:

Traceback (most recent call last):



File "/Library/Python/2.6/site-packages/django/core/servers/basehttp.py", line 283, in run
    self.result = application(self.environ, self.start_response)

  File "/Library/Python/2.6/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return self.application(environ, start_response)

  File "/Library/Python/2.6/site-packages/django/core/handlers/wsgi.py", line 272, in __call__
    response = self.get_response(request)

  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 146, in get_response
    response = debug.technical_404_response(request, e)

  File "/Library/Python/2.6/site-packages/django/views/debug.py", line 294, in technical_404_response
    'reason': smart_str(exception, errors='replace'),

  File "/Library/Python/2.6/site-packages/django/utils/encoding.py", line 123, in smart_str
    errors) for arg in s])

  File "/Library/Python/2.6/site-packages/django/utils/encoding.py", line 124, in smart_str
    return unicode(s).encode(encoding, errors)

  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 191, in __repr__
    return '<%s %s (%s:%s) %s>' % (self.__class__.__name__, self.urlconf_name, self.app_name, self.namespace, self.regex.pattern)

  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 191, in __repr__
    return '<%s %s (%s:%s) %s>' % (self.__class__.__name__, self.urlconf_name, self.app_name, self.namespace, self.regex.pattern)

UnicodeEncodeError: 'ascii' codec can't encode character u'\u0130' in position 17: ordinal not in range(128)

admin link :

http://localhost:8000/admin/My%20Members/

How can I solve this problem?

Thanks in advance

Community
  • 1
  • 1
TheNone
  • 5,684
  • 13
  • 57
  • 98

1 Answers1

0

Sounds like you have an odd character (\u0130) somewhere in your codebase. That character is a "latin capital letter i with a dot above": İ. Try searching for that and removing it.

If you're using UTF-8 characters in your .py files, declare them as being UTF-8 by adding this as the first line:

# -*- coding: utf-8 -*-
Sam Starling
  • 5,298
  • 3
  • 35
  • 52