Hello to all. Tell me. Perhaps someone faced the same problem.

I'm trying to deal with django and python 2.7. I read this book here:

Press here

There is such a command:

django-admin.py startproject megaproject 

She creates a project. But due to the fact that python 2.7 is not friendly with Cyrillic again, I get this little thing (of course, I'm interested in Russian-speaking ways; everything is fine with English-speaking ones):

 D:\Job\РАН\База Данных. Сомнология>django-admin.py startproject megaproject Traceback (most recent call last): File "C:\Python27\Scripts\django-admin.py", line 5, in <module> management.execute_from_command_line() File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line utility.execute() File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 357, in run_from_argv self.stderr.write('%s: %s' % (e.__class__.__name__, e)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 8: ordinal not in range(128) 

As far as I understand, this problem is due to the fact that the encodings in the command line and inside the python are different. But how to coordinate them, I do not know. Adding a line with an encoding to the file header did not help (to all appearances, you need to add to all files that are pulled by django-admin.py, but this is impossible). Changing the encoding in cmd also did not go, because, firstly, it is impossible to read the paths (all the symbols are floating), and secondly, this, in any case, does not help.

Tell me what to do?

  • If you want to write on python without such golovnikov, then go to Linux - Donil

1 answer 1

There is no way in windows to use django in directories whose paths contain characters other than Latin.