A custom CLI command to create a new Flask app with a basic structure, creates virtual environment and installs requirements
Project description
flask-make
flask-make
is a Python package that helps you quickly set up a new Flask project with a predefined directory structure. This CLI tool creates the app folder, a virtual environment, installs Flask, and generates an organized directory structure for you, including templates, static files, and configuration files.
Features
- Automated Project Setup: Sets up a new Flask app with a standard directory structure.
- Virtual Environment Creation: Automatically creates and activates a virtual environment in the project directory.
- Dependency Installation: Installs Flask and generates a
requirements.txt
file with installed dependencies. - Structured Template: Comes with organized folders for static files, templates, configuration, and the main app file, ready for development.
Installation
To install flask-make
, simply use pip:
pip install flask-make
Usage
Once installed, you can create a new Flask app by running the flask-make
command in your terminal:
flask-make <app-name>
Replace <app-name>
with the desired name of your new Flask project folder.
Example
flask-make my_flask_app
This will:
-
Create a folder named
my_flask_app
. -
Set up a virtual environment within
my_flask_app/venv
. -
Install Flask in the virtual environment.
-
Generate a
requirements.txt
file listing installed packages. -
Create a structured directory layout:
my_flask_app/ ├── app.py ├── config.py ├── requirements.txt ├── static/ │ ├── css/ │ ├── js/ │ └── img/ ├── templates/ │ └── index.html └── venv/
-
Display instructions to activate the virtual environment.
Activating the Virtual Environment
After creating the project, activate the virtual environment:
On Windows
cd my_flask_app
venv\Scripts\activate
On macOS/Linux
cd my_flask_app
source venv/bin/activate
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flask_make-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5deefe4d379b38d35ce97d3b9a032544da54f65c27869efe2d285c0f271de683 |
|
MD5 | fe8768404d54379d8fb84c4e272bd6eb |
|
BLAKE2b-256 | af5e05817fd3bd47c3b9887065e27ab80ced29f7bc635814a9afdc8d179ecdd9 |