项目作者: ThomasKenyeres

项目描述 :
Python web framework
高级语言: Python
项目地址: git://github.com/ThomasKenyeres/Gofri.git
创建时间: 2018-02-24T18:49:29Z
项目社区:https://github.com/ThomasKenyeres/Gofri

开源协议:MIT License

下载


GOFRI

Python3 web framework with builtin SQL-support, ORM, URL-mappings and easily configurable module management and inner builtin packages.
Uses Werkzeug/Jinja and SqlAlchemy.

Documented at: http://gofri.readthedocs.io

LATEST: 1.0.3


NEXT VERSION: 2.0.0

  1. Extension handling ✔
  2. JWT extension
  3. New config possibilities ✔
  4. CORS support ✔
  5. Local config encryption
  6. Template projects for getting started
  7. Virtualenv support
  8. Standalone mode (no need to create project) ✔

*✔ : available in developer version(this repo).

Install

To install latest version run pip3 install Gofri.

Create project

To create a project run python3 -m gofri.generate_project <ProjectName> and the project will be created in the current directory.

Start your application

To start the newly created app run start.py in its generated root package with python3.

Project structure:

  1. My-First-Project
  2. my_first_project
  3. __init__.py
  4. start.py
  5. conf.xml
  6. modules.py
  7. generate.py
  8. back
  9. __init__.py
  10. controller
  11. __init__.py
  12. ...
  13. dao
  14. __init__.py
  15. ...
  16. ...
  17. web
  18. <web content if needed>

Gofri CLI

You can add new modules easily:

  1. <Project>/<root_package>/generate.py generate module <name> <packages>
  1. MyFirstProject/my_first_project/generate.py generate module my_module my_first_project.back.dao

Or add a controller more easily:

  1. <Project>/<root_package>/generate.py generate controller <name>
  1. MyFirstProject/my_first_project/generate.py generate controller my_controller

Standalone application

You can serve a gofri application without creating a full project.
Here is an example, just copy it into a file and run it:

  1. from gofri.lib.decorate.http import GET
  2. from gofri.lib.main import APP
  3. @GET(path="/example")
  4. def handle1():
  5. return "This is a response"
  6. APP.run()