Skip to main content

Start Flask

Start a new Flask project on the application factory model.

How to use

  1. Update the pip in your virtual environment:
$ pip install --upgrade pip
  1. Install start_flask package:
$ pip install -i https://test.pypi.org/simple/ start-flask
  1. 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 --afp option indicates that you want to create a new Flask project on Application Factory Pattern.
  • The --venv option indicates that you want to create a virtual environment. It will be created inside the project's root folder as .venv.
  • The --sqlal option indicates that you want to install Flask SQLAlchemy in your project.
  • The --dyna option indicates that you want to install Dynaconf in your project.
  • The --all option 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-toolbar

and uncomment the line:
# toolbar.init_app(app) at app.py file or
# "project_name.ext.toolbar:init_app" in settings.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)

Source distribution for start-flask 0.1.11
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

Release history Release notifications | RSS feed

This release

0.1.11 This release

1 release file

0.1.10

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page