473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Django error: django.db.utils.DatabaseError: You mustnot use 8-bit bytesrings

11
When I run "python manage.py syncdb" and after I input that I want to create a superuser, cmd told me the error below:

django.db.utils.DatabaseError: You mustnot use 8-bit bytesrings unless you use a text_factory that can interpret 8-bit bytestings (like text_factory = str). It is highly recommend that you instead just switch your application to Unicode strings.

Could you help me solve the problem? Thanks!
Mar 6 '12 #1

✓ answered by Smygis

I don't know if its enough to add
Expand|Select|Wrap|Line Numbers
  1. #coding: UTF-8
at the top of the program. Or if there is some other setting you need to change. Or you could convert the string to unicode using:
Expand|Select|Wrap|Line Numbers
  1. unicode(string) #or when you create the string:
  2. a = u"string"

2 2648
Smygis
126 100+
I don't know if its enough to add
Expand|Select|Wrap|Line Numbers
  1. #coding: UTF-8
at the top of the program. Or if there is some other setting you need to change. Or you could convert the string to unicode using:
Expand|Select|Wrap|Line Numbers
  1. unicode(string) #or when you create the string:
  2. a = u"string"
Mar 6 '12 #2
imhomer
11
I changed the settings of region in control panel and it worked. Thanks all the same!
Mar 8 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JZ | last post by:
http://www.djangoproject.com/ -- JZ
28
by: flamesrock | last post by:
Firstly, this topic is NOT intended for trolling or starting any flame wars. I want to know if anyone has experience with these frameworks, and if so, how do they compare? Which one do you...
13
by: Ilias Lazaridis | last post by:
I have implemented a simple schema evolution support for django, due to a need for a personal project. Additionally, I've provided an Audit: http://case.lazaridis.com/wiki/DjangoAudit As a...
92
by: Ray | last post by:
I just moved to another company that's mainly a Java/.NET shop. I was happy to find out that there's a movement from the grassroot to try to convince the boss to use a dynamic language for our...
2
by: Ray | last post by:
support Oracle and MS SQL Server? I just realized that's gonna be a big blow for my case against RoR because we use both databases almost exclusively, we don't use any of Django supported database...
2
by: Antal Rutz | last post by:
Hi, I want to manage database(sql) tables through the web: actions like insert/edit/list/delete. An application often needs just a database table to be easily managable through the web by the...
2
by: cuongvt | last post by:
Hello I'm new to both Django and Python. I'm mainly developing on PHP. I tend to move to Django. But I want to confirm as below: I heard that Django is mainly used for something like content...
6
by: kang jia | last post by:
hi this is my database in models.py in the Django application, however, i don not know where is the error, i have tried many times, but always got error to set up database, sometimes they claim...
1
by: Pradip | last post by:
Hello every body. I am new to this forum and also in Python. Read many things about multi threading in python. But still having problem. I am using Django Framework with Python having PostgreSQL...
1
by: idev | last post by:
Hi all, May be this is a dump question, but it makes me crazy in my research. I am not a developer but I have experience with web development (PHP) in a past. Most my activities are around...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.