0
私のフォームは、私が手にエラーがSHP_UPLOAD_DIRがsettings.pyで宣言されていないで、このDjangoでzipファイルをアップロード中にエラーが発生しました。これをデバッグするには?
def handle(self,filefield_data):
""" Upload the file data, in chunks, to the SHP_UPLOAD_DIR specified in settings.py.
"""
# ensure the upload directory exists
if not os.path.exists(settings.SHP_UPLOAD_DIR):
os.makedirs(settings.SHP_UPLOAD_DIR)
# contruct the full filepath and filename
downloaded_file = os.path.normpath(os.path.join(settings.SHP_UPLOAD_DIR, filefield_data.name))
のように見えます。私はsettings.pyでディレクトリを宣言する必要があることを理解していますが、それをsettings.pyでどのように宣言し、SHP_UPLOAD_DIRも作成する必要があります。そのようなディレクトリを作成しなければならない場合、そのパスは何でしょうか?
settings.pyは編集可能なファイルです。どうしたの? –