Django error: Caught UnicodeEncodeError while rendering

565 views Asked by At

I'm trying to setup a Django site (OSQA) and can't get it working.

The site homepage is loading fine but when I tried to submit a form I got the following error. I have a bit of Python experience but I'm quite new to the Django framework. Can someone please shed some light on this?

The base.py file in question:

import django.dispatch
from django.utils.encoding import force_unicode, smart_unicode
from datetime import datetime, timedelta
import logging

TMP_MINICACHE_SECONDS = 5

class SettingSet(list):
    def __init__(self, name, title, description, weight=1000, markdown=False, can_preview=False):
        self.name = name
        self.title = title
        self.description = description
        self.weight = weight
        self.markdown = markdown
        self.can_preview = can_preview


class BaseSetting(object):
    @classmethod
    def add_to_class(cls, name):
        def wrapper(self, *args, **kwargs):
            return self.value.__getattribute__(name)(*args, **kwargs)

        setattr(cls, name, wrapper)

    def __init__(self, name, default, set=None, field_context=None):
        self.name = name
        self.default = default
        self.field_context = field_context or {}

        self._temp = None

        if set is not None:
            self.set = set

            if not set.name in Setting.sets:
                Setting.sets[set.name] = set

            Setting.sets[set.name].append(self)

    def __str__(self):
        return str(self.value)

    def __unicode__(self):
        return smart_unicode(self.value)

    @property
    def value(self):
        if self._temp:
            v, exp = self._temp
            if exp + timedelta(seconds=TMP_MINICACHE_SECONDS) > datetime.now():
                return v

        from forum.models import KeyValue

        try:
            kv = KeyValue.objects.get(key=self.name)
            v = kv.value
            self._temp = (v, datetime.now() + timedelta(seconds=TMP_MINICACHE_SECONDS))
            return v
        except KeyValue.DoesNotExist:
            self._temp = (self.default, datetime.now() + timedelta(seconds=TMP_MINICACHE_SECONDS))
            self.save(self.default)
        except Exception, e:
            logging.error("Error retrieving setting from database (%s): %s" % (self.name, str(e)))

        return self.default

    def set_value(self, new_value):
        new_value = self._parse(new_value)
        self._temp = None
        self.save(new_value)

    def save(self, value):
        from forum.models import KeyValue

        try:
            kv = KeyValue.objects.get(key=self.name)
        except KeyValue.DoesNotExist:
            kv = KeyValue(key=self.name)
        except Exception, e:
            logging.error("Error saving setting to database (%s): %s" % (self.name, str(e)))
            return

        kv.value = value
        kv.save()

    def to_default(self):
       self.set_value(self.default)

    def _parse(self, value):
        if not isinstance(value, self.base_type):
            try:
                return self.base_type(value)
            except:
                pass
        return value

class AnyTypeSetting(BaseSetting):
     def _parse(self, value):
       return value


class Setting(object):
    emulators = {}
    sets = {}

    def __new__(cls, name, default, set=None, field_context=None):
        if default is None:
            return AnyTypeSetting(name, default, set, field_context)

        deftype = type(default)

        if deftype in Setting.emulators:
            emul = Setting.emulators[deftype]
        else:
            emul = type(deftype.__name__ + cls.__name__, (BaseSetting,), {'base_type': deftype})

           fns = [n for n, f in [(p, getattr(deftype, p)) for p in dir(deftype) if not p in dir(cls)] if callable(f)]

            for n in fns:
               emul.add_to_class(n)

            Setting.emulators[deftype] = emul

        return emul(name, default, set, field_context)

Stack trace:

TemplateSyntaxError at /questions/ask/
Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
Request Method: POST
Request URL:    http://123.243.100.125/questions/ask/
Django Version: 1.3.4
Exception Type: TemplateSyntaxError
Exception Value:    
Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
Exception Location: /usr/local/src/osqa/forum/settings/base.py in __str__, line 42
Python Executable:  /usr/bin/python
Python Version: 2.6.6
Python Path:    
['/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg',
 '/usr/lib/python2.6/site-packages/elementtree-1.2.7_20070827_preview-py2.6.egg',
 '/usr/lib/python2.6/site-packages/Markdown-2.2.0-py2.6.egg',
 '/usr/lib/python2.6/site-packages/html5lib-0.95-py2.6.egg',
 '/usr/lib/python2.6/site-packages/django_rosetta-0.6.8-py2.6.egg',
 '/usr/lib64/python26.zip',
 '/usr/lib64/python2.6',
 '/usr/lib64/python2.6/plat-linux2',
 '/usr/lib64/python2.6/lib-tk',
 '/usr/lib64/python2.6/lib-old',
 '/usr/lib64/python2.6/lib-dynload',
 '/usr/lib64/python2.6/site-packages',
 '/usr/lib64/python2.6/site-packages/PIL',
 '/usr/lib64/python2.6/site-packages/gst-0.10',
 '/usr/lib64/python2.6/site-packages/gtk-2.0',
 '/usr/lib64/python2.6/site-packages/webkit-1.0',
 '/usr/lib/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
 '/usr/local/src',
 '/usr/local/src/osqa',
 '/usr/local/src/osqa/forum/markdownext']
Server time:    ???, 24 ?? 2012 22:36:54 +1100
Template error

In template /usr/local/src/osqa/forum/skins/default/templates/notifications/newquestion.html, error at line 3
Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
1   {% load i18n extra_tags email_tags %}
2   
3   {% declare %}
4       prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX)
5       app_name = settings.APP_SHORT_NAME
6       safe_app_name = html.mark_safe(settings.APP_SHORT_NAME)
7       question_author = html.mark_safe(question.author.username)
8       question_url = settings.APP_URL + question.get_absolute_url()
9       question_title = html.mark_safe(question.title)
10      question_tags = html.mark_safe(question.tagnames)
11      safe_body = html.html2text(question.html)
12      author_link = html.objlink(question.author, style=settings.EMAIL_ANCHOR_STYLE)
13      question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
Traceback Switch to copy-and-paste view

/usr/lib/python2.6/site-packages/django/core/handlers/base.py in get_response
            response = callback(request, *callback_args, **callback_kwargs) ...
? Local vars
/usr/local/src/osqa/forum/modules/decorators.py in decorated
        return decoratable(*args, **kwargs) ...
? Local vars
/usr/local/src/osqa/forum/modules/decorators.py in __call__
    res = self._callable(*args, **kwargs) ...
? Local vars
/usr/local/src/osqa/forum/modules/decorators.py in <lambda>
        self._callable = lambda *args, **kwargs: fn(origin, *args, **kwargs) ...
? Local vars
/usr/local/src/osqa/forum_modules/akismet/startup.py in wrapper
    return origin(request, *args, **kwargs) ...
? Local vars
/usr/local/src/osqa/forum/views/writers.py in ask
            send_template_email([u], "notifications/newquestion.html", {'question': question, "exclude_finetune": True}) ...
? Local vars
/usr/local/src/osqa/forum/utils/mail.py in send_template_email
    t.render(Context(context)) ...
? Local vars
/usr/lib/python2.6/site-packages/django/template/base.py in render
        return self._render(context) ...
? Local vars
/usr/lib/python2.6/site-packages/django/template/base.py in _render
    return self.nodelist.render(context) ...
? Local vars
/usr/lib/python2.6/site-packages/django/template/base.py in render
        bits.append(self.render_node(node, context)) ...
? Local vars
/usr/lib/python2.6/site-packages/django/template/debug.py in render_node
        result = node.render(context) ...
? Local vars
/usr/local/src/osqa/forum/templatetags/extra_tags.py in render
            context[m.group(1).strip()] = eval(m.group(3).strip(), d) ...
? Local vars
/usr/lib/python2.6/site-packages/django/utils/safestring.py in mark_safe
    return SafeString(str(s)) ...
? Local vars
/usr/local/src/osqa/forum/settings/base.py in __str__
    return str(self.value) ...
? Local vars
Request information

GET
No GET data
POST
Variable    Value
text    
u'The e-mail settings of this community are not configured yet. '
tags    
u'test'
expert_email    
u''
title   
u'The e-mail settings of this community are not configured yet. '
FILES
No FILES data
COOKIES
Variable    Value
sessionid   
'1e7a11ca5a8631425ad03fd4973e57dc'
META
Variable    Value
mod_wsgi.listener_port  
'80'
HTTP_REFERER    
'http://123.243.100.125/questions/ask/'
mod_wsgi.listener_host  
''
SERVER_SOFTWARE 
'Apache/2.2.15 (CentOS)'
SCRIPT_NAME 
u''
mod_wsgi.handler_script 
''
SERVER_SIGNATURE    
'<address>Apache/2.2.15 (CentOS) Server at 123.243.100.125 Port 80</address>\n'
REQUEST_METHOD  
'POST'
PATH_INFO   
u'/questions/ask/'
HTTP_ORIGIN 
'http://123.243.100.125'
SERVER_PROTOCOL 
'HTTP/1.1'
QUERY_STRING    
''
CONTENT_LENGTH  
'160'
HTTP_ACCEPT_CHARSET 
'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
HTTP_USER_AGENT 
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4'
HTTP_CONNECTION 
'keep-alive'
HTTP_COOKIE 
'sessionid=1e7a11ca5a8631425ad03fd4973e57dc'
SERVER_NAME 
'123.243.100.125'
REMOTE_ADDR 
'123.243.100.125'
mod_wsgi.request_handler    
'wsgi-script'
wsgi.url_scheme 
'http'
PATH_TRANSLATED 
'/usr/local/src/osqa/osqa.wsgi/questions/ask/'
SERVER_PORT 
'80'
wsgi.multiprocess   
False
mod_wsgi.input_chunked  
'0'
SERVER_ADDR 
'192.168.0.10'
DOCUMENT_ROOT   
'/usr/local/src/osqa/forum'
mod_wsgi.process_group  
'osqa'
SCRIPT_FILENAME 
'/usr/local/src/osqa/osqa.wsgi'
SERVER_ADMIN    
'[email protected]'
wsgi.input  
<mod_wsgi.Input object at 0x7f1da157ea30>
HTTP_HOST   
'123.243.100.125'
wsgi.multithread    
True
mod_wsgi.callable_object    
'application'
HTTP_CACHE_CONTROL  
'max-age=0'
REQUEST_URI 
'/questions/ask/'
HTTP_ACCEPT 
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
wsgi.version    
(1, 1)
GATEWAY_INTERFACE   
'CGI/1.1'
wsgi.run_once   
False
wsgi.errors 
<mod_wsgi.Log object at 0x7f1da164a0f0>
REMOTE_PORT 
'11430'
HTTP_ACCEPT_LANGUAGE    
'en-GB,en-US;q=0.8,en;q=0.6'
mod_wsgi.version    
(3, 2)
CONTENT_TYPE    
'application/x-www-form-urlencoded'
mod_wsgi.application_group  
'localhost.localdomain|'
mod_wsgi.script_reloading   
'1'
wsgi.file_wrapper   
''
HTTP_ACCEPT_ENCODING    
'gzip,deflate,sdch'
Settings
Using settings module osqa.settings
Setting Value
USE_L10N    
False
USE_THOUSAND_SEPARATOR  
False
APP_PROTOCOL    
'http'
LANGUAGE_CODE   
'zh_CN'
ROOT_URLCONF    
'urls'
MANAGERS    
()
APP_URL 
'http://127.0.0.1'
DEFAULT_CHARSET 
'utf-8'
APP_DOMAIN  
'127.0.0.1'
STATIC_ROOT 
''
TEST_DATABASE_CHARSET   
None
LOG_FILENAME    
'django.osqa.log'
MESSAGE_STORAGE 
'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
DATABASE_HOST   
'127.0.0.1'
IGNORABLE_404_STARTS    
('/cgi-bin/', '/_vti_bin', '/_vti_inf')
SEND_BROKEN_LINK_EMAILS 
False
URL_VALIDATOR_USER_AGENT    
'Django/1.3.4 (http://www.djangoproject.com)'
STATICFILES_FINDERS 
('django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder')
SESSION_COOKIE_DOMAIN   
None
SESSION_COOKIE_NAME 
'sessionid'
ADMIN_FOR   
()
TIME_INPUT_FORMATS  
('%H:%M:%S', '%H:%M')
DATABASES   
{'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'HOST': '127.0.0.1',
         'NAME': 'osqa',
         'OPTIONS': {},
         'PASSWORD': '********************',
         'PORT': '',
         'TEST_CHARSET': None,
         'TEST_COLLATION': None,
         'TEST_MIRROR': None,
         'TEST_NAME': None,
         'TIME_ZONE': 'Australia/Melbourne',
         'USER': 'uosqa'}}
TEST_DATABASE_NAME  
None
FILE_UPLOAD_PERMISSIONS 
None
FILE_UPLOAD_HANDLERS    
('django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE    
'text/html'
OSQA_DEFAULT_SKIN   
'default'
APPEND_SLASH    
True
FIRST_DAY_OF_WEEK   
0
DATABASE_ROUTERS    
[]
YEAR_MONTH_FORMAT   
'F Y'
STATICFILES_STORAGE 
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES  
{'default': {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
         'LOCATION': '/usr/local/src/osqa/cache'}}
MODULES_FOLDER  
'/usr/local/src/osqa/forum_modules'
SERVER_EMAIL    
'root@localhost'
ALLOW_FILE_TYPES    
('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
USE_X_FORWARDED_HOST    
False
ALLOW_MAX_FILE_SIZE 
1048576
IGNORABLE_404_ENDS  
('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')
MIDDLEWARE_CLASSES  
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'forum.middleware.extended_user.ExtendedUser',
 'forum.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'forum.middleware.request_utils.RequestUtils',
 'forum.middleware.cancel.CancelActionMiddleware',
 'forum.middleware.admin_messages.AdminMessagesMiddleware',
 'django.middleware.transaction.TransactionMiddleware']
USE_I18N    
True
THOUSAND_SEPARATOR  
','
SECRET_KEY  
'********************'
LANGUAGE_COOKIE_NAME    
'django_language'
FILE_UPLOAD_TEMP_DIR    
'/usr/local/src/osqa/tmp'
TRANSACTIONS_MANAGED    
False
LOGGING_CONFIG  
'django.utils.log.dictConfig'
TEMPLATE_LOADERS    
['django.template.loaders.filesystem.load_template_source',
 'django.template.loaders.app_directories.load_template_source',
 'forum.modules.template_loader.module_templates_loader',
 'forum.skins.load_template_source']
TEMPLATE_DEBUG  
True
CSRF_COOKIE_NAME    
'csrftoken'
TEST_DATABASE_COLLATION 
None
EMAIL_HOST_PASSWORD 
'********************'
CACHE_BACKEND   
'file:///usr/local/src/osqa/cache'
SESSION_COOKIE_SECURE   
False
CSRF_COOKIE_DOMAIN  
None
FILE_CHARSET    
'utf-8'
DEBUG   
True
MODULES_PACKAGE 
'forum_modules'
SESSION_FILE_PATH   
None
DEFAULT_FILE_STORAGE    
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS  
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'django.contrib.markup',
 'forum']
LANGUAGES   
(('ar', 'Arabic'),
 ('az', 'Azerbaijani'),
 ('bg', 'Bulgarian'),
 ('bn', 'Bengali'),
 ('bs', 'Bosnian'),
 ('ca', 'Catalan'),
 ('cs', 'Czech'),
 ('cy', 'Welsh'),
 ('da', 'Danish'),
 ('de', 'German'),
 ('el', 'Greek'),
 ('en', 'English'),
 ('en-gb', 'British English'),
 ('es', 'Spanish'),
 ('es-ar', 'Argentinian Spanish'),
 ('es-mx', 'Mexican Spanish'),
 ('es-ni', 'Nicaraguan Spanish'),
 ('et', 'Estonian'),
 ('eu', 'Basque'),
 ('fa', 'Persian'),
 ('fi', 'Finnish'),
 ('fr', 'French'),
 ('fy-nl', 'Frisian'),
 ('ga', 'Irish'),
 ('gl', 'Galician'),
 ('he', 'Hebrew'),
 ('hi', 'Hindi'),
 ('hr', 'Croatian'),
 ('hu', 'Hungarian'),
 ('id', 'Indonesian'),
 ('is', 'Icelandic'),
 ('it', 'Italian'),
 ('ja', 'Japanese'),
 ('ka', 'Georgian'),
 ('km', 'Khmer'),
 ('kn', 'Kannada'),
 ('ko', 'Korean'),
 ('lt', 'Lithuanian'),
 ('lv', 'Latvian'),
 ('mk', 'Macedonian'),
 ('ml', 'Malayalam'),
 ('mn', 'Mongolian'),
 ('nl', 'Dutch'),
 ('no', 'Norwegian'),
 ('nb', 'Norwegian Bokmal'),
 ('nn', 'Norwegian Nynorsk'),
 ('pa', 'Punjabi'),
 ('pl', 'Polish'),
 ('pt', 'Portuguese'),
 ('pt-br', 'Brazilian Portuguese'),
 ('ro', 'Romanian'),
 ('ru', 'Russian'),
 ('sk', 'Slovak'),
 ('sl', 'Slovenian'),
 ('sq', 'Albanian'),
 ('sr', 'Serbian'),
 ('sr-latn', 'Serbian Latin'),
 ('sv', 'Swedish'),
 ('ta', 'Tamil'),
 ('te', 'Telugu'),
 ('th', 'Thai'),
 ('tr', 'Turkish'),
 ('uk', 'Ukrainian'),
 ('ur', 'Urdu'),
 ('vi', 'Vietnamese'),
 ('zh-cn', 'Simplified Chinese'),
 ('zh-tw', 'Traditional Chinese'))
DATABASE_ENGINE 
'postgresql_psycopg2'
DATABASE_NAME   
'osqa'
COMMENTS_FIRST_FEW  
0
PREPEND_WWW 
False
SESSION_COOKIE_HTTPONLY 
False
DATABASE_PORT   
''
DEBUG_PROPAGATE_EXCEPTIONS  
False
MONTH_DAY_FORMAT    
'F j'
LOGIN_URL   
'/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE 
False
TIME_FORMAT 
'P'
DATE_INPUT_FORMATS  
('%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y')
AUTHENTICATION_BACKENDS 
['django.contrib.auth.backends.ModelBackend']
FORCE_SCRIPT_NAME   
''
PASSWORD_RESET_TIMEOUT_DAYS 
'********************'
CACHE_MIDDLEWARE_ALIAS  
'default'
SESSION_SAVE_EVERY_REQUEST  
False
ADMIN_MEDIA_PREFIX  
'/admin_media/'
NUMBER_GROUPING 
0
SESSION_ENGINE  
'django.contrib.sessions.backends.db'
CSRF_FAILURE_VIEW   
'django.views.csrf.csrf_failure'
COMMENTS_SKETCHY_USERS_GROUP    
None
LOGIN_REDIRECT_URL  
'/accounts/profile/'
SESSION_COOKIE_PATH 
'/'
LOGGING 
{'disable_existing_loggers': False,
 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
                  'level': 'ERROR'}},
 'loggers': {'django.request': {'handlers': ['mail_admins'],
                'level': 'ERROR',
                'propagate': True}},
 'version': 1}
CACHE_MIDDLEWARE_KEY_PREFIX 
''
LOCALE_PATHS    
()
TEMPLATE_STRING_IF_INVALID  
''
COMMENTS_ALLOW_PROFANITIES  
False
LOGOUT_URL  
'/accounts/logout/'
EMAIL_USE_TLS   
False
TEMPLATE_DIRS   
('/usr/local/src/osqa/forum/skins',)
FIXTURE_DIRS    
()
EMAIL_HOST  
'localhost'
DATE_FORMAT 
'N j, Y'
MEDIA_ROOT  
''
ADMINS  
()
FORMAT_MODULE_PATH  
None
DEFAULT_FROM_EMAIL  
'webmaster@localhost'
STATICFILES_DIRS    
()
MEDIA_URL   
''
DATETIME_FORMAT 
'N j, Y, P'
EMAIL_SUBJECT_PREFIX    
'[Django] '
DJANGO_VERSION  
1.3
SITE_ID 
1
DISALLOWED_USER_AGENTS  
()
ALLOWED_INCLUDE_ROOTS   
()
DECIMAL_SEPARATOR   
'.'
SHORT_DATE_FORMAT   
'm/d/Y'
DATABASE_USER   
'uosqa'
MODULE_LIST 
[<module 'osqa.forum_modules.sximporter' from '/usr/local/src/osqa/forum_modules/sximporter/__init__.pyc'>,
 <module 'osqa.forum_modules.pgfulltext' from '/usr/local/src/osqa/forum_modules/pgfulltext/__init__.pyc'>,
 <module 'osqa.forum_modules.default_badges' from '/usr/local/src/osqa/forum_modules/default_badges/__init__.pyc'>,
 <module 'osqa.forum_modules.akismet' from '/usr/local/src/osqa/forum_modules/akismet/__init__.pyc'>,
 <module 'osqa.forum_modules.exporter' from '/usr/local/src/osqa/forum_modules/exporter/__init__.pyc'>,
 <module 'osqa.forum_modules.localauth' from '/usr/local/src/osqa/forum_modules/localauth/__init__.pyc'>,
 <module 'osqa.forum_modules.robotstxt' from '/usr/local/src/osqa/forum_modules/robotstxt/__init__.pyc'>,
 <module 'osqa.forum_modules.facebookauth' from '/usr/local/src/osqa/forum_modules/facebookauth/__init__.pyc'>,
 <module 'osqa.forum_modules.oauthauth' from '/usr/local/src/osqa/forum_modules/oauthauth/__init__.pyc'>]
TEST_RUNNER 
'django.test.simple.DjangoTestSuiteRunner'
SITE_SRC_ROOT   
'/usr/local/src/osqa'
TIME_ZONE   
'Australia/Melbourne'
FILE_UPLOAD_MAX_MEMORY_SIZE 
2621440
APP_BASE_URL    
'http://127.0.0.1'
EMAIL_BACKEND   
'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE  
''
TEMPLATE_CONTEXT_PROCESSORS 
['django.core.context_processors.request',
 'forum.context.application_settings',
 'forum.user_messages.context_processors.user_messages',
 'django.core.context_processors.auth']
SESSION_COOKIE_AGE  
1209600
ONLINE_USERS    
{}
SETTINGS_MODULE 
'osqa.settings'
USE_ETAGS   
False
DISABLED_MODULES    
['books', 'recaptcha', 'project_badges']
LANGUAGES_BIDI  
('he', 'ar', 'fa')
DEFAULT_INDEX_TABLESPACE    
''
INTERNAL_IPS    
('127.0.0.1',)
STATIC_URL  
None
EMAIL_PORT  
25
SHORT_DATETIME_FORMAT   
'm/d/Y P'
ABSOLUTE_URL_OVERRIDES  
{}
DATABASE_OPTIONS    
{}
CACHE_MIDDLEWARE_SECONDS    
600
BANNED_IPS  
()
DEBUG_TOOLBAR_CONFIG    
{'INTERCEPT_REDIRECTS': True}
DATETIME_INPUT_FORMATS  
('%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M',
 '%Y-%m-%d',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M',
 '%m/%d/%Y',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M',
 '%m/%d/%y')
DATABASE_PASSWORD   
'********************'
COMMENTS_MODERATORS_GROUP   
None
PROFANITIES_LIST    
'********************'
EMAIL_HOST_USER 
''
COMMENTS_BANNED_USERS_GROUP 
None
1

There are 1 answers

0
Allen Qin On BEST ANSWER

I've downloaded the latest dev code of OSQA and re-installed it. The problem is no longer occurring on this new build.

Thanks for the help @Daniel and @Ngure.