目录
目录README.md

Flask Web Application README

Overview

This is a Flask-based web application that provides user registration, login, file upload/download, profile management, and a simple forum system. The application uses JSON files to store user data and forum posts, and it allows users to upload and manage files in their personal directories.

Features

  • User Management:

    • User registration and login with password hashing.
    • User profile management, including editing profile information and uploading avatars.
    • Admin panel for managing users.
  • File Management:

    • Users can upload files to their personal directories.
    • Users can download and delete their uploaded files.
  • Forum System:

    • Users can create, view, and comment on forum posts.
    • Posts can include images.

Installation

  1. Clone the Repository:

    git clone https://github.com/yourusername/yourrepository.git
    cd yourrepository
  2. Set Up a Virtual Environment (Optional but Recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Run the Application:

    python app.py

    The application will be available at http://127.0.0.1:5000/.

Usage

User Registration and Login

  • Register: Navigate to /register to create a new account.
  • Login: Navigate to /login to log in with your credentials.

File Management

  • Upload Files: Logged-in users can upload files from the /upload page.
  • Download Files: Files can be downloaded from the /download/<filename> route.
  • Delete Files: Files can be deleted using the /delete/<filename> route.

Profile Management

  • View Profile: Logged-in users can view their profile at /profile.
  • Edit Profile: Users can edit their profile information and upload an avatar at /edit_profile.

Forum System

  • Create Post: Logged-in users can create new forum posts at /create_post.
  • View Posts: All posts can be viewed at /posts.
  • View Post Details: Individual posts can be viewed at /post/<post_id>.
  • Add Comments: Logged-in users can add comments to posts at /post/<post_id>/comment.

Admin Panel

  • Admin Access: The admin panel is accessible at /admin and can only be accessed by the user admin.
  • Delete Users: The admin can delete users from the admin panel.

Directory Structure

eddie_netdisk/
│
├── app.py
├── templates/
│   ├── index.html
│   ├── register.html
│   ├── login.html
│   ├── upload.html
│   ├── admin.html
│   ├── profile.html
│   ├── edit_profile.html
│   ├── create_post.html
│   ├── post.html
│   └── posts.html
├── uploads/
│   ├── user1/
│   ├── user2/
│   └── post_images/
├── users.txt
└── posts.json

Note: This README is a general guide. You may need to modify it according to your specific project structure and requirements.

关于
862.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号