A simple classifieds/listings platform (Sahibinden-style) — built with Django + PostgreSQL.
- 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)
- Python 3.11+
- Django 5.2.9
- PostgreSQL (psycopg2-binary)
- python-decouple (.env management)
# 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 runserverCopy 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
- 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.
- 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).
# Create admin user
python manage.py createsuperuser
# Create/apply migrations
python manage.py makemigrations
python manage.py migrateilan_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
Educational/demo use.




