如果您的settings.py
文件位于/home/rhpt/myapp/my_app/settings.py中
那么这一部分
# add your project directory to the sys.path project_home = u'/home/rhpt'
需要是
# add your project directory to the sys.path project_home = u'/home/rhpt/myapp'
并保持这一点
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_app.settings'