Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 936 Bytes

2. Connecting With Postgre.md

File metadata and controls

54 lines (40 loc) · 936 Bytes

📌 Connecting With Postgre

  • Access Postgree terminal as admin:
sudo -u postgres psql
  • Create Database
CREATE DATABASE django_tasks_app;
  • Transfer database possession to your user:
ALTER DATABASE django_test_dabase OWNER TO zaaz;
  • Connect database to Dbeaver ( or any other administrator ):
Database: your_database_name;
Username: zaaz
Password: 5318
  • Install Postgre dependency ( if not installed ):
pip install psycopg2-binary
  • Set the Postgre connection on "Settings.py" ( you need an active postgree database to use ):
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'django_tasks_app',
        'USER': 'zaaz',
        'PASSWORD': '5318',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}
  • Migrate to solve Errors:
python manage.py migrate