我读过this tutorial,但不知道如何实现以下部分:
First, remove the
os
import and theBASE_DIR
definition and add the following imports:from decouple import config from unipath import Path import dj_database_urlDefine the
PROJECT_DIR
:PROJECT_DIR = Path(__file__).parent
我尝试了以下方法,但似乎不正确:
import os
from decouple import config
from unipath import Path
import dj_database_url
PROJECT_DIR = "/home/diegonode/simple_django_skeleton/proyecto"
PROJECT_DIR
的正确值是多少
只需将
PROJECT_DIR = Path(__file__).parent
放入settings.py
文件这样
PROJECT_DIR
设置即使您将项目移到其他地方(其他本地目录、其他计算机)也会起作用相关问题 更多 >
编程相关推荐