Fill out the form and get your code!
-
Project Name
Do not use spaces in your project name. Prefer underscores instead spaces. -
Application Factory Pattern
Indicates that you want to create a new Flask project on Application Factory Pattern. The application factory is an architectural model for applications -
SQLAlchemy
Indicates that you want to install Flask SQLAlchemy in your project. -
Dynaconf
Indicates that you want to install Dynaconf in your project. -
.tar.gz / .zip
Choose the file format to download
- Unzip the file you downloaded:
$ tar -vzxf project_name.tar.gz # if you chose .tar.gz $ unzip project_name.zip # if you chose .zip
- Enter the project_name directory:
$ cd project_name
- Create and update your virtual environment:
$ python3 -m venv .venv $ source .venv/bin/activate $ pip install --upgrade pip
- Run make install (or make install-dev):
ps.
$ make install
make install-dev
will install some development tools for you
If you chose the Application Factory Pattern, 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 following line in app.py
# toolbar.init_app(app)
if you are using Dynaconf, uncomment the following line:
# "project_name.ext.toolbar:init_app"
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 SQLAlchemy) |
make format |
formats the files (needs: isort and black) |
This python project was created by Cesar Godoi and Jady Godoi during Curso de Desenvolvimento Web taught by Bruno Rocha.
August 2020