Adding a database to the Django Project using Sqlite3 with Python 2.7

前端 未结 2 587
孤独总比滥情好
孤独总比滥情好 2020-12-16 03:16

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\         


        
相关标签:
2条回答
  • 2020-12-16 03:53

    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 os
    os.environ.setdefault('LANG','en_US')
    

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

    0 讨论(0)
  • 2020-12-16 03:55

    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..

    0 讨论(0)
提交回复
热议问题