A Django gallery app to upload images, tag them, search by text, filter by tags, open a detail page with similar images, and manage content (edit/delete).
- Python 3.13
- Django 6
- SQLite (default)
manage.py: Django entrypointimgs/: Django project settings/urlsgallery/: Main app (models, views, templates, static, fixtures)media/: Uploaded files served in developmentsample_images/: Local sample source images (renamed fromimg/)
- Create and activate a virtual environment (if needed), then install dependencies:
python -m venv env
.\env\Scripts\Activate.ps1
pip install -r requirements.txt- Apply migrations:
python manage.py migrate- Start the development server:
python manage.py runserver- Open:
- Home:
http://127.0.0.1:8000/ - Upload:
http://127.0.0.1:8000/upload/
This repository includes:
- Fixture file:
gallery/fixtures/initial_data.json - Source sample images:
sample_images/ - Served media copies used by fixture:
media/sample_images/
Load dummy data:
python manage.py loaddata gallery/fixtures/initial_data.jsonThe fixture references real files from sample_images by filename
(served from media/sample_images/ in development).
If your current database already has rows with the same primary keys, loaddata can fail.
For a clean reset:
Remove-Item db.sqlite3
python manage.py migrate
python manage.py loaddata gallery/fixtures/initial_data.jsonThen run:
python manage.py runserver- Drag and drop is supported in the upload view.
- Gallery images are draggable to other browser areas/apps (URL drag payload).