Skip to content

EhudDavid/Django-Blog-Dynamic-CRUD-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Blog — Dynamic CRUD Application

A simple Django blog application demonstrating dynamic CRUD operations for posts and categories, templates, static assets, and basic admin integration. This project includes management commands to populate demo data and a small set of migrations.

Features

  • Create, Read, Update, Delete (CRUD) for blog posts
  • Categories and category-based filtering
  • Slugs and image URL handling for posts
  • Custom management commands to populate demo categories and posts
  • Templates with reusable header/footer includes and a responsive stylesheet

Tech stack

  • Python 3.10+ / 3.11+ (tested with CPython)
  • Django 4.x
  • SQLite (default development DB)

Quick start (development)

  1. Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1

On cmd.exe use:

python -m venv .venv
.\.venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

If requirements.txt is not present, install Django:

pip install django
  1. Apply migrations and create a superuser:
python manage.py migrate
python manage.py createsuperuser
  1. (Optional) Populate demo data using the provided management commands:
python manage.py populate_categories
python manage.py populate_posts
  1. Run the dev server:
python manage.py runserver

Open http://127.0.0.1:8000/ in your browser.

Project structure

  • blog/ — Django app with models, views, templates, static files, migrations, and management commands
  • myapp/ — Django project configuration (settings, urls, wsgi/asgi)
  • templates/ — project-level templates (404.html)
  • db.sqlite3 — development database (consider removing from repo)

Notes & recommendations

  • Remove compiled Python file artifacts and add a .gitignore to exclude __pycache__/, .venv/, and db.sqlite3.
  • Don't use db.sqlite3 in production. Use PostgreSQL or another server-grade DB for deployments.
  • Add requirements.txt to pin dependencies and make setup reproducible.
  • Secure SECRET_KEY and other sensitive settings before deploying. Consider using environment variables.

Deployment

  • This app can be deployed to Heroku, PythonAnywhere, or any WSGI-capable host. Remember to set DEBUG=False and configure allowed hosts, static file handling, and the production database.

Contributing

Contributions are welcome — fork the repo, create a branch, and open a PR. Please run tests and linters (if added) before submitting.

License

Add a license to the repository root (for example, LICENSE with MIT or Apache-2.0) to make reuse explicit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published