Skip to content

in this repository we will try together to invade django models and its integeration with posgresql

Notifications You must be signed in to change notification settings

123usef/Django-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Models with PostgreSQL

This repository explores Django models and their integration with PostgreSQL. You'll learn how to set up Django to work with a PostgreSQL database step by step.

Installation

To integrate with PostgreSQL, follow these steps:

1. Install PostgreSQL Engine

You need to install the PostgreSQL engine using the psycopg2 package. Run this command:

pip install psycopg2

This command installs the PostgreSQL engine, which enables PostgreSQL connections and data manipulation through Django's Object-Relational Mapping (ORM).

  1. Configure settings.py Next, you need to configure your Django project's settings.py to work with PostgreSQL. Open your settings.py file and modify the DATABASES setting as follows:
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'test',          # Your database name
        'USER': 'postgres',      # Your database username
        'PASSWORD': '',          # Your database password (leave empty if not needed)
        'HOST': 'localhost',     # Hostname (use 'localhost' for local development or specify the instance IP for remote)
        'PORT': '',              # PostgreSQL default port is 5432 (leave blank for default)
    }
}

Make sure to replace 'test', 'postgres', and '' with your actual database name, username, and password.

That's it! You've successfully configured your Django project to work with PostgreSQL.

Usage

Explain how to use the repository or provide examples of how Django models are used with PostgreSQL in your project.

Contributing

If you'd like to contribute to this project, please follow these guidelines for code contributions, bug reporting, and feature requests.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgments

Give credit to any individuals, projects, or libraries that inspired or helped you with this project.

In this revised version, I've broken down the installation steps and provided clear

About

in this repository we will try together to invade django models and its integeration with posgresql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages