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