A beginner-friendly Django project to connect PostgreSQL locally and online and perform full CRUD operations. This project helps understand PostgreSQL integration with Django in both development and production environments.
🌐 # Live Demo : https://django-postgresql-ngqr.onrender.com
📁 # Source Code : https://github.com/SimpleCyber/Django-PostgreSQL-
- 🔄 Create, Read, Update, Delete operations using Django
- 🗃️ PostgreSQL as a database (local & online)
- 🌐 Hosted on Render
- 📦 Proper model & admin integration
- 🧪 Tested with Django ORM
- 🧑💻 Minimal & clean UI using Django Templates
- Backend: Django (Python)
- Database: PostgreSQL
- Frontend: HTML5, CSS3, Django Templates
- Hosting: Render
- Tools: Git, GitHub, PgAdmin (for local DB)
-
Clone the repository
git clone https://github.com/SimpleCyber/Django-PostgreSQL-.git cd Django-PostgreSQL-
-
Create a virtual environment and activate
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Setup your
.env
fileDEBUG=True SECRET_KEY=your_secret_key DATABASE_NAME=your_db_name DATABASE_USER=your_db_user DATABASE_PASSWORD=your_db_password DATABASE_HOST=localhost DATABASE_PORT=5432
-
Run migrations
python manage.py makemigrations python manage.py migrate
-
Start the server
python manage.py runserver
- Use
pgAdmin
orpsql
to create a database - Update your
.env
with correct credentials - Use Django’s ORM to auto-create tables
- Add a PostgreSQL service on Render
- Connect using the database URL and map it in
settings.py
- Make sure to set
ALLOWED_HOSTS
,DEBUG=False
and usedj-database-url
for parsing
- 🟢 Create – Add new items through a form
- 🟡 Read – Display all entries on the homepage
- 🔵 Update – Edit existing entries
- 🔴 Delete – Remove entries with confirmation
Contributions and suggestions are welcome! Open an issue or fork the repo to suggest improvements.
This project is licensed under the MIT License.