A simple blog application built with Django where users can create, view, and manage blog posts. This app is designed to help you understand Django basics, including models, views, templates, and routing.
- Create, view, and list blog posts
- Django Admin interface to manage posts
- Uses Django's built-in ORM for data management
- Simple UI with Django templates
- Python 3.x: Ensure Python 3.6 or later is installed.
- Django: This project is built with Django. The setup steps will guide you through installing Django.
- Virtual Environment (recommended): Helps keep dependencies isolated.
-
Clone the Repository
git clone https://github.com/your-username/blog_post.git cd blog_post -
Set Up Virtual Environment
python3 -m venv venv source venv/bin/activate # On macOS/Linux # On Windows # .\venv\Scripts\activate
-
Install Dependencies
pip install django
-
Run Migrations Apply database migrations to set up the necessary tables.
python manage.py migrate
-
Create a Superuser (Admin User) Create an admin user to access the Django Admin panel.
python manage.py createsuperuser
-
Run the Development Server Start the Django development server to view the app.
python manage.py runserver
-
Access the App
- Open your web browser and go to: http://127.0.0.1:8000/
- Access the Django Admin panel at: http://127.0.0.1:8000/admin
- Home Page: Displays a list of all blog posts.
- Post Details: Click on a post title to view its content and details.
- Create a New Post: Navigate to
/post/new/to add a new blog post.
- Log in to the Django Admin panel at
/adminusing your superuser credentials to manage posts.
blog_project/
├── blog/ # Main blog app directory
│ ├── migrations/ # Database migrations
│ ├── templates/ # HTML templates
│ │ └── blog/ # Blog-specific templates
│ │ ├── post_list.html
│ │ └── post_detail.html
│ ├── admin.py # Admin interface configuration
│ ├── models.py # Database models
│ ├── views.py # Views (controllers)
│ ├── urls.py # URL routing for blog app
│ └── forms.py # Django forms
├── blog_project/ # Project directory
│ ├── settings.py # Project settings
│ ├── urls.py # Main URL configuration
│ └── wsgi.py # WSGI configuration
└── manage.py # Django management script
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to update the GitHub link in the **Clone the Repository** section with your repository’s URL and modify any sections to fit additional project details or specific customizations!