Skip to content

tvhimanshu/myProject

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python ORM for PostgreSQL

This project is a Python script that serves as an Object-Relational Mapping (ORM) for PostgreSQL. It allows you to interact with a PostgreSQL database using Python objects and provides functionality to perform common database operations.

Prerequisites:-
Python 3
PostgreSQL

Libraries Used:-
Alembic
SQLAlchemy
Psycopg2

Installation:-
To install the required external modules, run:
pip install alembic
pip install sqlalchemy psycopg2-binary

Database Configuration:-
Before running the script, you need to set up a PostgreSQL database. Follow these steps:

Install PostgreSQL if you haven't already. 
Create a new PostgreSQL database and user. You can use the following SQL commands as an example:
CREATE DATABASE testdb;
CREATE USER postgres WITH PASSWORD '1234';
Update the database configuration in server.py. You'll need to provide the database name, username, password, and host. Here's an example:

# Database configuration
DATABASE_NAME = 'testdb'
DATABASE_USER = 'postgres'
DATABASE_PASSWORD = '1234'
DATABASE_HOST = 'localhost'  # or your PostgreSQL host address
DATABASE_PORT = '5432'  # or your PostgreSQL port
How to Run the Script

Execute the following command:
python server.py
The server will run on port 8000 by default.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.5%
  • Mako 5.5%