# StupidMart
暑期实训作业,超市订单管理系统,视频演示地址 [百度云](https://pan.baidu.com/play/video#/video?path=%2FDemo%2FStupidMart-Demo.mp4&t=-1)
README 文档是用 [cookiecutter-flask](https://github.com/sloria/cookiecutter-flask) 模板改的,懒得重新写了,所以就没改成中文
## Quickstart
First, set your app's secret key as an environment variable. For example, add the following to `.bashrc` or `.bash_profile`.
``` {.sourceCode .bash}
export STUPIDMART_SECRET='something-really-secret'
```
Run the following commands to bootstrap your environment :
git clone https://github.com/Zhiwei1996/StupidMart
cd StupidMart
pip install -r requirements/dev.txt
In general, before running shell commands, set the `FLASK_APP` and `FLASK_DEBUG` environment variables :
export FLASK_APP=/path/to/autoapp.py
export FLASK_DEBUG=1
Configure your sqlalchemy url in `settings.py` and create you database named `stupidmart`
```bash
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://user:password@host/stupidmart'
```
Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration :
flask db init
flask db migrate
flask db upgrade
flask run deploy
## Deployment
To deploy:
export FLASK_DEBUG=0 # With setting to 1 you can use DebugToolbar
flask run # start the flask server
In your production environment, make sure the `FLASK_DEBUG` environment variable is unset or is set to `0`, so that `ProdConfig` is used.
## Shell
To open the interactive shell, run :
flask shell
By default, you will have access to the flask `app`.
## Running Tests
To run all tests, run :
flask test # Write your own test codes, and then use this command to test
## Migrations
Whenever a database migration needs to be made. Run the following commands :
flask db migrate
This will generate a new migration script. Then run :
flask db upgrade
To apply the migration.
For a full migration command reference, run `flask db --help`.
## Asset Management
Files placed inside the `assets` directory and its subdirectories (excluding `js` and `css`) will be copied by webpack's `file-loader` into the `static/build` directory, with hashes of their contents appended to their names. For instance, if you have the file `assets/img/favicon.ico`, this will get copied into something like `static/build/img/favicon.fec40b1d14528bf9179da3b6b78079ad.ico`. You can then put this line into your header:
<link rel="shortcut icon" href="{{asset_url_for('img/favicon.ico') }}">
to refer to it inside your HTML page. If all of your static files are managed this way, then their filenames will change whenever their contents do, and you can ask Flask to tell web browsers that they should cache all your assets forever by including the following line in your `settings.py`:
SEND_FILE_MAX_AGE_DEFAULT = 31556926 # one year
没有合适的资源?快使用搜索试试~ 我知道了~
超市订单管理系统,flask+python,.zip
共88个文件
py:30个
png:16个
html:12个
需积分: 0 3 下载量 98 浏览量
2023-09-28
15:59:24
上传
评论
收藏 276KB ZIP 举报
温馨提示
超市订单管理系统,flask+python,.zip
资源推荐
资源详情
资源评论
收起资源包目录
超市订单管理系统,flask+python,.zip (88个子文件)
StupidMart-master
.travis.yml 408B
Pipfile 608B
migrations
README 38B
script.py.mako 494B
alembic.ini 770B
env.py 3KB
versions
25e963323057_.py 4KB
LICENSE 1KB
requirements
dev.txt 332B
prod.txt 465B
tests
__init__.py 25B
test_functional.py 4KB
factories.py 767B
test_forms.py 2KB
test_config.py 524B
test_models.py 2KB
conftest.py 930B
.isort.cfg 27B
package.json 2KB
autoapp.py 321B
StupidMart
utils.py 63B
__init__.py 32B
extensions.py 615B
commands.py 5KB
app.py 2KB
admin
__init__.py 75B
models.py 6KB
views.py 8KB
forms.py 46B
webpack
.gitkeep 0B
database.py 2KB
templates
users
providerList.html 13KB
billList.html 14KB
change_password.html 3KB
403.html 13B
admin
userAdd.html 6KB
userList.html 15KB
public
public.html 2KB
login.html 1KB
index.html 2KB
about.html 16B
404.html 14B
401.html 15B
user
__init__.py 75B
models.py 2KB
views.py 13KB
forms.py 24B
public
__init__.py 115B
views.py 2KB
forms.py 44B
decorators.py 564B
compat.py 401B
settings.py 2KB
static
assets
js
js.js 1KB
main.js 282B
time.js 1KB
jquery.js 267KB
plugins.js 86B
script.js 37B
img
yh.png 5KB
buy.png 2KB
clock.jpg 22KB
time.png 1KB
tc.png 2KB
login_bg.jpg 45KB
xiugai.png 4KB
home.png 4KB
tianjia.png 4KB
search.png 4KB
.gitkeep 0B
mm.png 3KB
login_img.png 9KB
read.png 1KB
schu.png 4KB
loginBg.jpg 18KB
formBg.png 41KB
gys.png 5KB
leftBg.png 3KB
zd.png 2KB
css
style.css 8KB
public.css 6KB
Procfile 66B
requirements.txt 152B
Pipfile.lock 22KB
.gitignore 511B
setup.cfg 43B
README.md 3KB
db.sql 5KB
共 88 条
- 1
资源评论
天天501
- 粉丝: 596
- 资源: 4666
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- hasp驱动 win10可用,不死机不蓝屏
- 00000000044242851月光摇篮曲.m4a
- 基于JavaScript讲解的数据结构和算法
- python计算机视觉python-computer-vision.rar
- VB+ACCESS计算机等级考试管理系统(源代码+系统+答辩PPT).zip
- python密码python-ciphers.rar
- 2c60fbb3dt9ad50ed8864298eea1484b.MP4
- 基于yolov8+dlib实现视觉识别的安全驾驶监测系统部署到jetson NX平台源码+模型.zip
- Qt框架+OpenCV+动态爱心+编程教学+520
- 基于opencv+yolov8实现目标追踪及驻留时长统计源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功