Flask port of create-react-app that is used for initializing project structure of your next application.
pip install createflaskapp create-flask-app my-app cd my-app # activate venv python run.py
(use correct version of pip and python according to your OS and python install)
Then open http://localhost:5000 to see your app.
When you are ready to deploy to production, set environment variable
True on your server of choice, clone the project onto your server and spin it up.
You'll need to have Python 3.6 or higher on your local development machine (but it's not required on the server). To create a new app, you can run :
python -m create-flask-app my-app
It will create a directory called my-app inside the current folder. Inside that directory, it will generate the initial project structure :
my-app/ ├──venv ├── app │ ├── __init__.py │ ├── config.py │ ├── errors │ │ ├── __init__.py │ │ └── handlers.py │ ├── home │ │ ├── __init__.py │ │ └── routes.py │ ├── static │ │ └── css │ │ └── main.css │ └── templates │ ├── about.html │ ├── base.html │ ├── error.html │ └── home.html ├── requirements.txt └── run.py
No complicated configuration or folder structures, only the files you need to build and deploy your app. Once the installation is done, you can open your project folder:
Inside the newly created project, you can run some commands:
Activates the virutal environment required for the project dependency isolation.
pip install -r requirements.txt
Installs libraries and dependencies listed in
requirements.txt in active environment.
Starts the app in development mode. Open http://localhost:5000 to view it in browser.
The page will automatically reload if you make changes to the code. You will see errors in app reload or startup in the console.
Create-Flask-App can be simply upgraded using pip:
pip install createflaskapp --upgrade # or pip install createflaskapp -U
Your environment after installing everything from
requirements.txt will have everything you need to build simple but modern Flask app:
Check out this guide for an overview of how these tools fit toghether.