# channel-website **Repository Path**: techchu/channel-website ## Basic Information - **Project Name**: channel-website - **Description**: 本仓库为频道资料库页面的重构仓库 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-13 - **Last Updated**: 2025-10-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **本项目为频道资料库页面的重构项目,使用方式如下** ## 1. 环境配置 1.1 克隆项目 ```shell git clone https://gitee.com/techchu/channel-website.git ``` 1.2 下载依赖 ```shell pip install -r requirements.txt ``` ## 2.数据库迁移 2.1 初始化数据库(仅需进行一次) ```shell flask db init ``` 2.2 创建迁移脚本(每次创建新的数据库) ``` shell flask db migrate -m "提交描述" ``` 2.3 应用迁移脚本(每次创建新的数据库) ```shell flask db upgrade ``` 2.4 迁移旧版本数据(仅一次,可选) ```shell python3 migrate_resource.py python3 migrate_user.py ``` ## 3.配置环境变量 3.1 **创建环境变量** 创建.env文件,并添加以下内容 ``` SECRET_KEY=your-secret-key-here DATABASE_URL=mysql连接字符串 # 例如:mysql+pymysql://username:password@localhost/dbname FLASK_ENV=development(或production,testing) ``` ## 4.运行项目 4.1 开发模式 ```shell python3 run.py ``` 4.2 生产模式 ```shell python3 wsgi.py ```