Django PostgreSQL installation, database construction

■ Environment

Windows10home  Python3.7  PostgresSQL10.12

■ Installation / setting procedure

① PostgresSQL download and installation (omitted)

② Change environment variables

"Control Panel"-"System"-"Detailed System Settings" + "Environment Variables"

3Path edit PostgresQL added

image.png

④ Check the version of PSQL

 C:\python_project\venv_python_dev\Private_Diary_project>psql --version
psql (PostgreSQL) 10.12

■ Database creation

① psql login

psql -U postgres

C:\python_project\venv_python_dev\Private_Diary_project>psql -U postgres

② Database creation

create database XXXXXXXXX;

postgres=# create database XXXXXXXXXXXXX_db;

CREATE DATABASE appears.

③ Check the database list. .. I want to

psql=# |  I can't hear the vertical bar!

④ Get out of psql

psql=# \q

■ Install driver (psycopg2) for python connection

① pip installation

pip install psycopg2-binary

C:\python_project\venv_python_dev\Private_Diary_project>pip install psycopg2-binary

that's all

Recommended Posts

Django PostgreSQL installation, database construction
Django environment construction
django environment construction
django installation location
PostgreSQL 10.0 installation procedure
Django project environment construction
Django development environment construction memo
Docker + Django + React environment construction
Django installation and operation check
django project development environment construction
Mac + Eclipse (PyDev) + Django environment construction
Python practice_Virtual environment setup ~ Django installation
[Django] Memorandum of environment construction procedure
[For beginners] Django -Development environment construction-
[Beginner] Get from Django Query database