下载并安装PostgreSQL
安装依赖psycopg2
bash
python -m pip install psycopg2
📌编辑 mysite/settings.py 文件前,先设置 TIME_ZONE 为你自己时区。
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
bash
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "postgres",
"USER": "postgres",
"PASSWORD": "12345678",
"HOST": "127.0.0.1",
"PORT": "5432",
}
}
数据库迁移
bash
python manage.py migrate
关于如何在指定位置创建conda环境,更多内容请看这篇创建Jupyter Notebook项目目录-CSDN博客