A Web Framework build from Flask. Its source file structure is inspired by Django (With such reason, named Schurz, another role in movie Django Unchained).
Django is perfect, but too huge to mold it. Flask is lightweight, but it is too flexible to build an tidy project —— everyone has his own preference, it is hard to read other's project.
Schurz build with Flask, but use Flask's toolchain. Maybe classify Schurz as Demo/Example is better.
Feature | Django | Schurz | |
---|---|---|---|
shell project manager | mange.py | Click、Alembic | ✅ |
HTML DebugTool | Django-DebugToolBar | Flask-DebugToolBar | ✅ |
Admin | from django.contrib import admin |
Flask-Admin | ✅ |
HTML Form | from django import forms |
Flask-WTF | |
User | authenticate(); login();logout |
Flask-Login、Flask-Login、Flask-Security | |
Signal | from django.db.models.signals import post_save |
Blinker、Flask-Login | |
AOP | from django.utils.deprecation import MiddlewareMixin |
Flask hook function、Werkzeug Middleware | ✅ |
.
├── apis # restful app
├── apps # app use templates
├── schurz # project core
│ ├── settings.py # settings/configurations
│ ├── urls.py # main of urls
│ └── wsgi.py # define app. run app with this module
├── static # static files
├── templates # html tempaltes
├── tests # unittests
├── utils # tools for project
├── manage.py # just like Django, `python manage.py [CMD]`
├── docs # documents
├── migrations # just like Django, migration files for model change
├── gunicorn.conf # gunicorn configurations
└── requirements.txt
There are 2 patterns in view:
- MVT: use templates.
- Restful api : do not use tempaltes, make restful json response.
Then, I will show two different database choices in below : SQLite as a SQL, MongoDB as a NoSQL. If you want use Postgre, MySQL, Oracle, SQLserver, check SQLAlchemy documents, and you can handle it.