This is a simple news feed web app.
- Tech: Django, Django Forms, SQLite (file-based DB per request).
- Features: Create news items with title, publication date & time, body text, and optional multiple images.
- Feed: Paginated with adjustable page size (10, 20, 50).
- Display: All news fields displayed, including image gallery.
Note: The original test mentions MySQL/PostgreSQL. This build uses SQLite for local development as requested. Switching to MySQL/PostgreSQL requires only changing
DATABASESinnewsfeed/settings.pyand installing the appropriate driver.
- Python 3.9+ recommended. Create & activate a virtualenv.
- Install deps:
pip install -r requirements.txt
- Apply migrations and run the server:
python manage.py migrate python manage.py runserver
- Open http://127.0.0.1:8000/ — create news and browse the feed.
- Uploaded images are stored under
media/.
Use the drop-down at the bottom (10 / 20 / 50). The value is passed via ?per_page= query param.
newsfeed_project/
├─ manage.py
├─ requirements.txt
├─ README.md
├─ db.sqlite3 # created after running migrations
├─ media/ # uploaded images
├─ static/ # static assets
├─ templates/ # base templates
├─ newsfeed/ # project configs
└─ news/ # app with models/forms/views/templates