Skip to content

Apexq/Django-PostgreSQL-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Listing Platform (Django + PostgreSQL)

A simple classifieds/listings platform (Sahibinden-style) — built with Django + PostgreSQL.

Screenshots

Homepage / Listings Homepage Listing Admin Page Add User Change User

Features

  • Users, categories, listings, listing photos, favorites
  • Search and filtering (city, price range, category)
  • Simple UI with Bootstrap, media support
  • PascalCase column names on PostgreSQL (requires quoting in SQL)

Tech Stack

  • Python 3.11+
  • Django 5.2.9
  • PostgreSQL (psycopg2-binary)
  • python-decouple (.env management)

Quick Start (Windows / PowerShell)

# 1) Virtual environment
python -m venv venv
.\n+venv\Scripts\Activate.ps1

# 2) Dependencies
pip install -r requirements.txt

# 3) Environment variables (.env)
Copy-Item .env.example .env
# Edit DB_* and SECRET_KEY values in .env

# 4) Database (PostgreSQL) — run migrations after DB exists
python manage.py migrate

# 5) Dev server
python manage.py runserver

.env Example

Copy and edit .env.example.

SECRET_KEY=change-me
DEBUG=True
DB_NAME=SahibindenDB
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=127.0.0.1
DB_PORT=5432
LANGUAGE_CODE=tr-TR
TIME_ZONE=Europe/Istanbul

Media Files

  • Local images live under media/listings/.
  • Filenames: listing_{listing_id}_photo_{i}.jpg
  • In development, Django serves media (DEBUG=True). In production, prefer Nginx/Whitenoise.

SQL Schema & Notes

  • Schema: schema.sql
  • Django models are configured to preserve PascalCase column names in PostgreSQL.
  • Therefore, quote identifiers in SQL:
SELECT "Title", "Price", "City" FROM listings WHERE "IsActive" = TRUE;

Otherwise, PostgreSQL lowercases unquoted identifiers (and you’ll get errors).

Useful Commands

# Create admin user
python manage.py createsuperuser

# Create/apply migrations
python manage.py makemigrations
python manage.py migrate

Project Structure (summary)

ilan_platform/           # Django project settings
ilanlar/                 # App (models, views, templates)
media/                   # Local images (gitignored)
static/                  # Static files
schema.sql               # PostgreSQL DDL
requirements.txt         # Dependencies
.env.example             # Env var template

License

Educational/demo use.

About

A simple classifieds/listings platform (Sahibinden-style) — built with Django + PostgreSQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors