Skip to content

Alexmhack/django_postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django_postgresql

using postgresql database with django

INSTALLATION

Install the postgresql database in your local computer first from the .exe file on the offical site.

Install the postgresql package for python - psycopg2 using pip in virtualenv

CONFIGURE

Create a new virtualenv and then install all the dependencies for our project there

Create a new django project

Create a new database using the postgresql command line.

CREATE DATABASE blog

Inside our django project settings.py, set the database as the postgresql like so,

    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'blog',
        'USER': 'postgres',
        'PASSWORD': 'admin',
        'HOST': 'localhost',
        'PORT': '',
}

DJANGO USAGE

Just create models and run makemigrations and migrate command, the new database should work fine.

About

using postgresql database with django

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published