Skip to content Skip to sidebar Skip to footer

Adding A Database To The Django Project Using Sqlite3 With Python 2.7

I am trying to add a database to the Django Project using Sqlite3 and Python 2.7. This is how my setting.py looks like: DATABASES = { 'default': { 'ENGINE': 'django.db

Solution 1:

Type this before you execute the python manage.py syncdb

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

This will solve the error.. Btw i was using mac os x python which was in /usr/bin/python.

Add it to the ./.bash_profile file so that it calls it automatically..

Solution 2:

I actually ran into this on windows recently. This is a hack, not a fix or an answer, but it might get you through your problem:

Put this at the top of your manage.py script

import osos.environ.setdefault('LANG','en_US')

http://keeyai.com/2012/02/17/django-deployment-create-superuser-fails-with-locale-error/

Post a Comment for "Adding A Database To The Django Project Using Sqlite3 With Python 2.7"