Skip to content

lukaizhi5559/blog_post

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog Post App

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.

Table of Contents

Features

  • 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

Prerequisites

  • 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.

Installation

  1. Clone the Repository

    git clone https://github.com/your-username/blog_post.git
    cd blog_post
  2. Set Up Virtual Environment

    python3 -m venv venv
    source venv/bin/activate  # On macOS/Linux
    # On Windows
    # .\venv\Scripts\activate
  3. Install Dependencies

    pip install django
  4. Run Migrations Apply database migrations to set up the necessary tables.

    python manage.py migrate
  5. Create a Superuser (Admin User) Create an admin user to access the Django Admin panel.

    python manage.py createsuperuser
  6. Run the Development Server Start the Django development server to view the app.

    python manage.py runserver
  7. Access the App

Usage

Main Pages

  • 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.

Admin Management

  • Log in to the Django Admin panel at /admin using your superuser credentials to manage posts.

Project Structure

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

Contributing

Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.

License

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!

About

Simple Python Blog Post

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors