django-如何手动设置sys.path?

django-如何手动设置sys.path?,django,Django,到目前为止,我一直在对django生产服务器进行更改(是的,非常糟糕:p)。我想转到git进程,在部署之前创建一个本地测试服务器。因此,我下载了python文件,并运行了一个: python manage.py runserver 希望和祈祷。。。但这还不够,我犯了一个很好的错误: django.core.exceptions.ImproperlyConfigured: WSGI application 'issc.issc.wsgi.application' could not be loa

到目前为止,我一直在对django生产服务器进行更改(是的,非常糟糕:p)。我想转到git进程,在部署之前创建一个本地测试服务器。因此,我下载了python文件,并运行了一个:

python manage.py runserver
希望和祈祷。。。但这还不够,我犯了一个很好的错误:

django.core.exceptions.ImproperlyConfigured: WSGI application 'issc.issc.wsgi.application' could not be loaded; Error importing module: 'No module named issc.wsgi'
我在文章中读到,[manage.py]是自动创建的,并设置了几个关键部分:

In addition, manage.py is automatically created in each Django project. manage.py is a thin wrapper around django-admin.py that takes care of several things for you before delegating to django-admin.py:
  It puts your project’s package on sys.path.
    It sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project’s settings.py file.
    It calls django.setup() to initialize various internals of Django.

我的问题是:如何手动设置这些变量?因为在我的例子中,我下载了任意目录下的所有文件,但这还不够。所有内容都在这里,但它缺少指向此所有内容的链接….

如果要手动设置配置文件的地址,可以使用以下内容设置
DJANGO\u设置\u模块

export-DJANGO\u SETTINGS\u MODULE='SETTINGS\u to\u load'


你可以这样设置你所有的环境变量,它应该可以工作。我建议至少使用Virtualenv。

您不需要设置
os.path
,您需要设置
sys.path
。但实际上您可能需要修复代码(我假设
issc.wsgi
是您的代码),以便正常加载所有内容。您不需要在路径上放置代码。