A simple blog application built with Django. This project provides basic functionalities for creating, viewing, and managing blog posts.
- List View: A homepage that displays a list of all blog posts.
- Detail View: A dedicated page for viewing the full content of a single blog post.
- Admin Integration: Manage blog posts directly through the Django admin interface.
The project is organized into two main parts:
blog_project/: The main Django project directory, which contains project-level settings and configurations.blog_app/: The Django app that encapsulates the core blogging functionality, including models, views, and templates for blog posts.templates/: Contains the base HTML templates used across the application.static/: Contains static files, such as CSS and JavaScript.
Follow these steps to get the project up and running on your local machine.
- Python 3.x
- pip (Python package installer)
First, clone this repository to your local machine:
git clone <your-repository-url>
cd blog_app_projectIt is highly recommended to use a virtual environment to manage project dependencies.
-
For macOS/Linux:
python3 -m venv venv source venv/bin/activate -
For Windows:
python -m venv venv .\venv\Scripts\activate
The project's dependencies are listed in a requirements.txt file. You can create this file by running:
pip freeze > requirements.txtThen, install the required packages:
pip install -r requirements.txt(Note: If you don't have a requirements.txt file yet, you can install Django directly: pip install django)
Apply the database migrations to create the necessary tables:
python manage.py migrateTo access the Django admin panel, you need to create a superuser account:
python manage.py createsuperuserFollow the prompts to set a username, email, and password.
Start the local development server:
python manage.py runserverThe application will be available at http://127.0.0.1:8000/.
To ensure everything is working correctly, you can run the project's test suite:
python manage.py test