'manage.py shell'在settings.py中给出语法错误

时间:2014-01-05 10:16:39

标签: django

File "/home/jc/tryout/mydjangoproject/mydjangoproject/settings.py", line 1
\"""
   ^
SyntaxError: unexpected character after line continuation character

我的settings.py是:

"""
Django settings for mydjangoproject project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'nurokm67=6qezctkfa-o-g+k$=u$nete3pw)d*q!6j_$g7i#0l'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

1 个答案:

答案 0 :(得分:-1)

我遇到了同样的问题,我写道:

def__str__(self): 

而不是

def __str__(self):

要解决问题,只需在def__str

之间留出空格