在远程服务器上 运行 “python manage.py runserver”报错
来源:10-8 pycharm远程代码调试-2_1
Hilbert孔
2018-02-18
Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/root/.virtualenvs/mxshop/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/root/.virtualenvs/mxshop/lib/python2.7/site-packages/django/core/management/__init__.py", line 307, in execute settings.INSTALLED_APPS File "/root/.virtualenvs/mxshop/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__ self._setup(name) File "/root/.virtualenvs/mxshop/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup self._wrapped = Settings(settings_module) File "/root/.virtualenvs/mxshop/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/klx/projects/mxshop/MxShop/settings.py", line 32 SyntaxError: Non-ASCII character '\xe5' in file /home/klx/projects/mxshop/MxShop/settings.py on line 32, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
在本地没有遇到过这种问题,求老师和各位大神帮忙解答
写回答
1回答
-
文件中包含中文的问题, 你是不是settings文件的开始没有申明utf8编码?
012018-02-22
Python前后端分离开发Vue+Django REST framework实战
Django REST framework课程视频,RESTFul API前后端分离开发
2873 学习 · 2457 问题
相似问题