flaskstarter 0.8
A Flask project start-up CLI to create modular ready projects.
Flaskstarter assumes you know about Flask microframework and its mechanics in a begginer level. It can be really helpful if you are still using monolithic aproach, and needs to start using a modular architecture.
It also assumes you are using Python 3.6+.
Flaskstarter recommends the use of a python virtual environment for project to work safely and isolated from your systems binnaries. You should create and activate it before the next steps.
To install flaskstarter use the usual:
pip install flaskstarter
To see its version:
flaskstarter --version
To see its help:
flaskstarter --help
To start a project, create its folder and:
flaskstarter init main_module_name
If you do want to use the same project's root folder as main module name:
flaskstarter init .
It won't create a requirements.txt on its own anymore, so you feel free to choose your tools.
To see init's help:
flaskstarter init --help
Now, after project creation, you can make full use of manage.py, a script with a CLI that may help you to automate some tasks inside project tree.
By now you can create a blueprint structure by typing the bellow on project root:
$ python manage.py plug-blueprint [blueprint_name]
If it will work as an API blueprint, that's enough. But maybe it is not and you want to use private templates related only to this blueprint. This is solved by adding a '-t' or '--templates' to the above command.
After that, flaskstarter goes onto main module > settings.toml file to register the blueprint on it. There is an EXTENSIONS variable where you can list all the plugins to autoimport if you create any by hand. It uses factory design.
For secrets settings, as secret_key and database configurations, refer to instance/.secrets.settings.toml
Most of the times you are adding some extensions and middlewares to your app, so you can add an empty skelleton to instanciate and plug to app by typing:
$ python manage.py plug-extension [name]
As with blueprints, flaskstarter registers extensions on main module > settings.toml.
To run your app you can use the bellow on project root:
$ python manage.py runserver
Ask manage.py for runserver help to see its options.
Now it is possible to plug a database and a migration extensions to the project. For a first experience Flaskstarter is running with flask-sqlalchemy and flask-migrate. The templates that generate the kickoff database use sqlite and the simplest thing possible. You will be able to plug a database by running:
$ python manage.py plug-database
When plug-database is ran, the manage script will create the migrations folder as Alembic requires. Once it is created the following commands will be available.
This will generate a migration script with Example as message:
$ python manage.py db-migrate Example
This upgrades the database:
$ python manage.py db-upgrade
If anything undesirable happens, this will downgrade the database:
$ python manage.py db-downgrade
For other Flask-Migrate commands, you can export FLASK_APP on your shell and use flask db (command) as its documentation guides.
What the project does for you
It creates project tree, the init and routes files with a helloworld example and a manage.py script to run the project and attach blueprints to it. The project settings are now on main module directory, so they can be persisted to a CVS repository.
A word of warning: when commiting and pushing your project to versioning servers, remember to put instance folder into .gitignore, if not yet. And then remember to place it into deploy destination.
What the project does not do for you
It doesn't force you to use poetry or any other tool but flask, toml and dynaconf on the Flask project created.
Future
- Add automated tests for development enviroment of flaskstarter
- Work on a better architecture for the generated project
How can you help on flaskstarter development?
Feel free to clone it and send us pull requests! Remember to comment the decisions you make so they can be better reviewed.
Metadata
Release files for flaskstarter 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flaskstarter-0.8.tar.gz | 15.4 kB | Without provenance | Details for flaskstarter-0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flaskstarter-0.8-py3-none-any.whl | Python 3 | none | any | Details for flaskstarter-0.8-py3-none-any.whl |
Total release size: 35.8 kB
Release files / flaskstarter-0.8.tar.gz
| Download URL | flaskstarter-0.8.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8169c6146d1617924f5114e24fdae86afa46f18c45d04840e13dec9de5d673c5
|
|
BLAKE2b-256 checksum How to use checksums |
2fd87716355b4e5e8d3d44ec5886d81fe9376b9ffda5ef526c9aa01547470073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64
|
Release files / flaskstarter-0.8-py3-none-any.whl
| Download URL | flaskstarter-0.8-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23f77052d6b44af859ed1198202dc55a87725146dc77943611147cad0b3f0539
|
|
BLAKE2b-256 checksum How to use checksums |
05795fa215aaa813c92fae07a551bb48d38b56b2095fba48a37a96f18fbe6ff9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Linux/6.14.9-300.fc42.x86_64
|
Security for flaskstarter 0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.