Giter Club home page Giter Club logo

flask-files-server's Introduction

Flask 文件共享

简介

基于原生 JavaScript 前端和 Python Flask 后端的文件服务器。

功能

  • 目录浏览
  • 文件下载
  • HTML5 移动端适配

使用方法

获取项目

# HTTPS 仓库地址
git clone --progress https://github.com/Dragon1573/Flask-Files-Server.git
# SSH 仓库地址
git clone --progress [email protected]:Dragon1573/Flask-Files-Server.git

# 初始化虚拟环境
cd Flask-Files-Server/
python -m venv .venv

# 激活虚拟环境(Powershell)
& ./.venv/Scripts/Activate.ps1

# 安装必要的依赖项
python -m pip install -U flask

配置项目

在测试环境下,创建 .env 配置文件并添加如下内容,你应当使用「密码学安全的随机数生成器」(Cryptography-safety RNG)产生足够强度的服务器根密钥。

SECRET_KEY = "50me_raNdOM1y_9eneraTed_t0keN"

Caution

在生产环境下,你应当将其配置到环境变量中,而非使用 .env 文件提供临时环境变量!

帮助文档

usage: app.py [-h] [-d DIRECTORY] -p PORT

options:
  -h, --help            show this help message and exit
  -d DIRECTORY, --directory DIRECTORY
                        指定项目根目录
  -p PORT, --port PORT  指定服务器端口

部署

本项目可借助 CGI (比如 wfastcgiwaitress )与常见的 Web 服务器进行集成,但更推荐使用 HttpPlatformHandlerWindows IIS 集成。

Tip

你可以参考 为 Python Web 应用配置 IIS

flask-files-server's People

Contributors

aicorein avatar dragon1573 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.