Start Flask
Start a new Flask project on the application factory model.
How to use
- Update the pip in your virtual environment:
$ pip install --upgrade pip
- Install start_flask package:
$ pip install -i https://test.pypi.org/simple/ start-flask
- Create your new projects:
$ start_flask project_name [options] or $ start_flask [options] project_name
IMPORTANT
- Do not use spaces in your project name. Prefer underscores instead spaces.
- The
--afpoption indicates that you want to create a new Flask project on Application Factory Pattern.- The
--venvoption indicates that you want to create a virtual environment. It will be created inside the project's root folder as.venv.- The
--sqlaloption indicates that you want to install Flask SQLAlchemy in your project.- The
--dynaoption indicates that you want to install Dynaconf in your project.- The
--alloption indicates that you want to install all options (afp + venv + sqlal).- If you chose the Application Factory Pattern (
--afp), don't forget to update the FLASK_APP environment variable:$ export FLASK_APP=project_name/app.py
- If you want to run flask in development mode, update the FLASK_ENV environment variable:
$ export FLASK_ENV=development
- if you are using the Application Factory Pattern and want to use the
flask-toolbar, run the command:$ pip install flask-toolbarand uncomment the line:
# toolbar.init_app(app)atapp.pyfile or
# "project_name.ext.toolbar:init_app"insettings.toml(when you are using Dynaconf)
In the Makefile file, we have some useful commands, which we use with the make command, such as:
| command | what he does |
|---|---|
make clean |
clears the project folder |
make install |
install our project as a package python |
make install-dev |
similar to install, but with requirements-dev.txt |
make test |
run tests |
make init-db |
starts and updates the db (if you choose --sqlal) |
make format |
formats the files (needs: isort and black) |
This python script was created by Cesar and Jady Godoi during Curso de Desenvolvimento Web taught by Bruno Rocha.
Release files for start-flask 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| start_flask-0.1.11.tar.gz | 23.6 kB | Details |
Release files / start_flask-0.1.11.tar.gz
| Download URL | start_flask-0.1.11.tar.gz |
|---|---|
| Size | 23.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35c86524b5474302007e831e1c1492c0f6d3801b33b8729ed05a392f59f651cd
|
|
BLAKE2b-256 checksum How to use checksums |
33d5120931ea7dab6e294022fc0dd7a5eb1902d1054d7211b0ccce67f5143769
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2
|