{"id":21288623,"url":"https://github.com/srx-2000/beierimage","last_synced_at":"2026-04-11T21:42:52.016Z","repository":{"id":130194012,"uuid":"399862163","full_name":"srx-2000/beierImage","owner":"srx-2000","description":"一个用flask写的超级轻简的小图床，直接对接接口，快速上传，在线浏览 - Lightweight cloud album","archived":false,"fork":false,"pushed_at":"2021-08-31T04:13:47.000Z","size":724,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T15:44:05.083Z","etag":null,"topics":["cloud","flask","photo-album","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srx-2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-25T15:08:24.000Z","updated_at":"2021-08-31T04:13:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e859c09-149c-48d9-85a4-8e79ef5e6583","html_url":"https://github.com/srx-2000/beierImage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srx-2000/beierImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srx-2000%2FbeierImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srx-2000%2FbeierImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srx-2000%2FbeierImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srx-2000%2FbeierImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srx-2000","download_url":"https://codeload.github.com/srx-2000/beierImage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srx-2000%2FbeierImage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266127268,"owners_count":23880425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","flask","photo-album","python3"],"created_at":"2024-11-21T12:23:26.406Z","updated_at":"2026-04-11T21:42:46.974Z","avatar_url":"https://github.com/srx-2000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Beier图床\n\n​\t本图床是基于python下的flask框架进行搭建的，目标就是给需要构建自己图床的小伙伴们提供一个简单易懂，开箱即用的轻简图床。由于本人ui水平有限，所以暂时仅提供一些接口供大家clone调用。本项目规模极小，目前仅有不到500行代码，适合新手了解图床的大概情况。\n\n#### 功能（以下功能皆仅提供API）\n\n- [x] **单图片上传**\n- [ ] **批量图片上传**\n- [x] **在线浏览上传图片**\n- [x] **下载单个云端图片**\n- [ ] **批量下载云端图片**\n- [x] **获取全部图片信息**\n- [x] **根据上传时间检索图片**\n\n#### 安装部署\n\n**代码下载**\n\n* git clone\n\n ```https://github.com/srx-2000/beierImage.git```\n\n**安装依赖**\n\n`pip install -r requirements.txt`\n\n##### 更新配置\n\n```yaml\n# 存储根路径\nroot_path: D:\\image_bed\n# mysql数据库地址，默认为时本地地址127.0.0.1，如果是要连接远程数据库才需要更改\ndb_host: 127.0.0.1\n# mysql数据库连接端口，默认3306，一般不用改\ndb_port: 3306\n# 数据库名称，默认为image_database\ndb_name: image_database\n# 数据库用户名\ndb_username: root\n# 数据库密码\ndb_password: 123456\n# 服务器host，如果是发布到服务器上就填0.0.0.0，如果是在自己本机上跑都直接默认的127.0.0.1就可以了\nserver_host: 127.0.0.1\n# 服务器port，选择一个自己服务器【本机】上没有被占用的端口即可，默认5555\nserver_port: 5555\n```\n\n **启动项目**\n\n```python app.py```\n\n**服务器上运行注意事项**\n\n\u003e 1. 记得开启对应端口的防火墙\n\u003e 2. 记得将配置文件中的server_host属性改为0.0.0.0\n\u003e 3. 使用命令`nohup python app.py \u003e /dev/null \u0026`在后台运行项目\n\u003e 4. 如果是跑在linux服务器上，记得改root_path属性\n\u003e 5. 数据库密码记得改成自己的\n\n#### 使用\n\n- Api\n\n启动web服务后, 默认配置下会开启 [http://127.0.0.1:5555](http://127.0.0.1:5555/) 的api接口服务\n\n| api       | method | Description              | params                       |\n| --------- | ------ | ------------------------ | ---------------------------- |\n| /         | GET    | api介绍                  | None                         |\n| /upload   | POST   | 上传一张图片             | image:file【form表单提交】   |\n| /show     | GET    | 在线浏览一个图片         | /image_uuid【url_param】     |\n| /all      | GET    | 返回所有图片的信息       | None                         |\n| /query    | GET    | 根据传入的年月日搜索图片 | /year/month/day【url_param】 |\n| /download | GET    | 下载指定图片             | /image_uuid【url_param】     |\n\n- python调用\n\n```python\nimport requests\nimport os\n\nbase_url=\"http://127.0.0.1:5555/\"\n\n# 上传一个图片\ndef upload():\n    f=open(os.getcwd()+os.sep+\"64304942_p0_master1200.jpg\",mode=\"rb\")\n    file={\"image\":f}\n    response=requests.post(base_url+\"upload\",files=file)\n    print(response.json())\n\n# 获取目录索引\ndef index():\n    response=requests.get(base_url).json()\n    print(response)\n\n# 获取所有图片信息\ndef get_all():\n    response=requests.get(base_url+\"all\").json()\n    print(response)\n```\n\n#### 问题反馈\n\n​\t任何问题欢迎在[Issues](https://github.com/srx-2000/beierImage/issues) 中反馈。\n\n　你的反馈会让此项目变得更加完美。\n\n#### 贡献代码\n\n​\t本项目主要用于想要自己搭建私人图床使用，功能还并未完善，如果发现bug或有新的功能添加，请在[Issues](https://github.com/srx-2000/beierImage/issues) 中提交bug(或新功能)描述，我会尽力改进，使她更加完美。同时也希望大家可以通过star与fork来支持本项目。\n\n#### 特别感谢\n\n​\t在此特别鸣谢[proxy_pool](https://github.com/jhao104/proxy_pool)项目，本项目关于flask部分的应用以及README等文档的编写，很多地方都参考了该项目。其本身是一个非常优秀的代理池技术。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrx-2000%2Fbeierimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrx-2000%2Fbeierimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrx-2000%2Fbeierimage/lists"}