disqus_export.py「django-disqus」のコマンドを使用して、コメントdjango.contrib.commentsを disqus にエクスポートしようとしています。
disqus_export.py外側のプロジェクト フォルダー (場所) で使用すると、manage.py次のように返されます。
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\disqus\management\commands\disqus_export.p
y", line 5, in <module>
from django.contrib import comments
File "C:\Python27\lib\site-packages\django\contrib\comments\__init__.py", line
4, in <module>
from django.contrib.comments.models import Comment
File "C:\Python27\lib\site-packages\django\contrib\comments\models.py", line 1
, in <module>
from django.contrib.auth.models import User
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 5, in
<module>
from django.db import models
File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in <modul
e>
if DEFAULT_DB_ALIAS not in settings.DATABASES:
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 184, in
inner
self._setup()
File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 40, in _set
up
raise ImportError("Settings cannot be imported, because environment variable
%s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SE
TTINGS_MODULE is undefined.
別の同様の質問の回答によると、「これを確認してください: python manage.pyshell then import sys. sys.pathIs the project directory on that path? Exit out. Enter the regular python shell python. Then import sys. sys.pathIs the project directory on that path?」
私はそれを行い、私のプロジェクトディレクトリは最初の呼び出しで返されましたが、後者では返されませんでした。しかし、この指示をしたコメンターは、OPがそこから何をしなければならないかを理解したので、次に何をすべきかを言いませんでした.
プロジェクトディレクトリを後者に追加する必要sys.pathがあると思いますが、方法がわからないので、ここの誰かが私を助けてくれることを願っています.