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
- Extension handling ✔
- JWT extension
- New config possibilities ✔
- CORS support ✔
- Local config encryption
- Template projects for getting started
- Virtualenv support
- Standalone mode (no need to create project) ✔
*✔ : available in developer version(this repo).
To install latest version run pip3 install Gofri
.
To create a project run python3 -m gofri.generate_project <ProjectName>
and the project will be created in the current directory.
To start the newly created app run start.py
in its generated root package with python3
.
Project structure:
My-First-Project
my_first_project
__init__.py
start.py
conf.xml
modules.py
generate.py
back
__init__.py
controller
__init__.py
...
dao
__init__.py
...
...
web
<web content if needed>
You can add new modules easily:
<Project>/<root_package>/generate.py generate module <name> <packages>
MyFirstProject/my_first_project/generate.py generate module my_module my_first_project.back.dao
Or add a controller more easily:
<Project>/<root_package>/generate.py generate controller <name>
MyFirstProject/my_first_project/generate.py generate controller my_controller
You can serve a gofri application without creating a full project. Here is an example, just copy it into a file and run it:
from gofri.lib.decorate.http import GET
from gofri.lib.main import APP
@GET(path="/example")
def handle1():
return "This is a response"
APP.run()