deploy Django, using Nginx and Gunicorn
executing python manage.py collectstatic, The following error occurs:: Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line (sys.argv)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 376, In execute_from_command_line
utility.execute ()
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 368, in execute
self.fetch_command (subcommand). Run_from_argv (self.argv)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute ( args,) * cmd_options)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle ( args, * options)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, In handle
collected = self.collect ()
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect
handler (path, prefixed_path, storage)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 357, in copy_file
self.log ("Copying"% s""% source_path, Level=1)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 218, in log
self.stdout.write (msg)
File "/ home/toptran/sites/nbtoptran.com/env/lib/python3.4/site-packages/django/core/management/base.py", line 110, In write
self._out.write (force_str (style_func (msg)
UnicodeEncodeError: "ascii" codec can"t encode characters in position 69-74: ordinal not in range (128)
then configure the following code in the setting of the django project
import sys,io
sys.stdout = io.TextIOWrapper (sys.stdout.buffer,encoding="utf-8")
but also prompts the following error:
UnicodeEncodeError: "utf-8" codec can"t encode character" udce5" in position 69: surrogates not allowed
it is said on the Internet that this is a path problem. I don"t know what path it is and how to change it. Xiaobai, it is the first time to use django, to find a solution!