项目作者: vroncevic

项目描述 :
Flask Monolith Project Template - Class-Functional Structure
高级语言: Python
项目地址: git://github.com/vroncevic/flask_func_struct.git
创建时间: 2017-03-18T11:53:20Z
项目社区:https://github.com/vroncevic/flask_func_struct

开源协议:GNU General Public License v3.0

下载


Flask Functional-Structured Framework

☯️ flask_func_struct is framework for managing Flask App.

Developed in 🐍 python code.

The README is used to introduce the modules and provide instructions on
how to install the modules, any machine dependencies it may have and any
other information that should be provided before the modules are installed.

flask_func_struct python checker flask_func_struct package checker GitHub issues open GitHub contributors

Table of Contents

Installation

Used next development environment

debian linux os

Navigate to release page download and extract release archive 📦.

To install flask_func_struct 📦 type the following

  1. tar xvzf flask_func_struct-x.y.z.tar.gz
  2. cd flask_func_struct-x.y.z/
  3. pip install -r requirements.txt
  4. cp manage.py /FlaskApp/
  5. cp -R /manage_commands/ /FlaskApp/
  6. cp -R /app_server/ /Flask/

Or You can use Dockerfile to create image/container 🚢.

flask_func_struct docker checker

Usage

Create databse

  1. $ python manage.py create_db
  2. Create database/tables
  3. Done

Init databse and prepare alembic table

  1. $ python manage.py db init
  2. Creating directory /data/dev/python/flask_func_struct/github/flask_func_struct/migrations ... done
  3. Creating directory /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/versions ... done
  4. Generating /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/env.pyc ... done
  5. Generating /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/env.py ... done
  6. Generating /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/alembic.ini ... done
  7. Generating /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/README ... done
  8. Generating /data/dev/python/flask_func_struct/github/flask_func_struct/migrations/script.py.mako ... done
  9. Please edit configuration/connection/logging settings in
  10. '/data/dev/python/flask_func_struct/github/flask_func_struct/migrations/alembic.ini' before proceeding.

Generate a migration script that makes the database match the models

  1. $ python manage.py db migrate
  2. INFO [alembic.runtime.migration] Context impl SQLiteImpl.
  3. INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  4. INFO [alembic.env] No changes in schema detected.

Create super user

  1. $ python manage.py createsuperuser
  2. Creating superuser account
  3. Insert username of superuser: adroot
  4. Insert email of superuser: adroot@test.com
  5. Insert password of superuser:
  6. Done

Run application

  1. $ python manage.py runserver
  2. * Serving Flask app "app_server" (lazy loading)
  3. * Environment: production
  4. WARNING: This is a development server. Do not use it in a production deployment.
  5. Use a production WSGI server instead.
  6. * Debug mode: on
  7. * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  8. * Restarting with stat
  9. * Debugger is active!
  10. * Debugger PIN: 226-526-932

Dependencies

flask_func_struct requires other modules and libraries (Python 2.x)

  1. alembic 1.6.5
  2. Flask 1.1.4
  3. Flask-Bcrypt 1.0.1
  4. Flask-Bootstrap 3.3.7.1
  5. Flask-Cors 3.0.10
  6. Flask-DebugToolbar 0.13.1
  7. Flask-Login 0.5.0
  8. Flask-Mail 0.9.1
  9. Flask-Migrate 2.6.0
  10. Flask-Script 2.0.6
  11. Flask-SQLAlchemy 2.5.1
  12. Flask-Testing 0.8.1
  13. Flask-WTF 0.14.3
  14. SQLAlchemy 1.4.27
  15. Werkzeug 1.0.1
  16. WTForms 2.3.3

Package structure

🧰 Expected framework structure

  1. app_server/
  2. ├── configuration/
  3. ├── database/
  4. ├── development_config.py
  5. ├── __init__.py
  6. ├── production_config.py
  7. └── test_config.py
  8. ├── development_config.py
  9. ├── __init__.py
  10. ├── mail/
  11. ├── development_config.py
  12. ├── __init__.py
  13. ├── production_config.py
  14. └── test_config.py
  15. ├── production_config.py
  16. └── test_config.py
  17. ├── forms/
  18. ├── base/
  19. ├── contact.py
  20. └── __init__.py
  21. ├── __init__.py
  22. └── user/
  23. ├── edit.py
  24. ├── __init__.py
  25. ├── login.py
  26. └── register.py
  27. ├── __init__.py
  28. ├── models/
  29. ├── __init__.py
  30. └── model_user.py
  31. ├── static/
  32. ├── base.css
  33. └── favicon.ico
  34. ├── templates/
  35. ├── base/
  36. ├── about.html
  37. ├── contact.html
  38. └── home.html
  39. ├── _base.html
  40. ├── errors/
  41. ├── 401.html
  42. ├── 403.html
  43. ├── 404.html
  44. └── 500.html
  45. ├── footer.html
  46. ├── header.html
  47. └── user/
  48. ├── administration.html
  49. ├── edit.html
  50. ├── login.html
  51. ├── members.html
  52. └── register.html
  53. └── views/
  54. ├── base/
  55. ├── about.py
  56. ├── contact.py
  57. ├── home.py
  58. └── __init__.py
  59. ├── __init__.py
  60. └── user/
  61. ├── administration.py
  62. ├── edit.py
  63. ├── __init__.py
  64. ├── login.py
  65. ├── logout.py
  66. ├── members.py
  67. └── register.py

Docs

Documentation Status

📗 More documentation and info at

Contributing

🌎 🌍 🌏 Contributing to config_flask

License: GPL v3 License

Copyright (C) 2017 by vroncevic.github.io/flask_func_struct

flask_func_struct is free software; you can redistribute it and/or modify
it under the same terms as Python itself, either Python version 2.x or,
at your option, any later version of Python 2 you may have available.

Lets help and support PSF.

Python Software Foundation

Donate