Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pingf/myblog
https://github.com/pingf/myblog
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/pingf/myblog
- Owner: pingf
- Created: 2014-11-07T11:34:00.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-14T16:45:50.000Z (over 9 years ago)
- Last Synced: 2023-03-25T20:57:35.366Z (over 1 year ago)
- Language: Python
- Size: 9.79 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MyBlog
=======
### if you need to run the test directly, you can export PYTHONPATH to this directory first
### you can use the provided virtualenv for mac to run it### run db migrate
in src folder
```
python manage.py db init
```
在使用上面的语句后会在env.py中生成
```
from flask import current_app
config.set_main_option('sqlalchemy.url', current_app.config.get('SQLALCHEMY_DATABASE_URI'))
target_metadata = current_app.extensions['migrate'].db.metadata
```
这样会对metadata进行绑定,在之后定义model时继承自db.Model即可动态model的变化执行`python manage.py db migrate`只会生成alembic_version表,执行`python manage.py db upgrade`才会按照生成的迁移文件进行表的migrate
### integrated test
对于mac系统,可能要执行`brew install chromedriver`###pep8 格式验证
检查`pep8 --first `
详细显示`pep8 --show-source --show-pep8 `
修正`autopep8 --in-place --aggressive --aggressive `