Skip to main content

FlaskStarter

FlaskStarter is a project automation script designed to kickstart your Flask web application development. It helps you set up a Flask project structure, including a virtual environment creation, a bare-bones app.py file for the backend, templates & static folders along with the index.html, index.css & index.js files for the frontend.

Features

  • Virtual Environment Creation: FlaskStarter automates the creation of a virtual environment, isolating your project dependencies.

  • Flask App Boilerplate: Generates a basic Flask application template with a Hello World home page.

  • Directory Structure: Sets up a project structure with templates, static folders, and a .gitignore file to manage Flask assets and project files.

  • Dependency Management: Includes a batch script for installing Flask and other project dependencies from a requirements.txt file.

  • Cleanup: A separate script (deleter.py) is provided for testing and learning purposes. It deletes all project files and directories, leaving only FlaskStarter.py intact.

Use Cases

  • Quickly start a new Flask project with a clean structure.
  • Prototype Flask web applications.
  • Experiment with Flask and frontend development.
  • Automate the setup and teardown of Flask projects for testing or learning purposes.

Getting Started

  1. Install the FlaskStarter package using the following command:

    pip install FlaskStarterApp
    

    OR

    Clone this repository using the following command:

    git clone https://github.com/Hardvan/FlaskStarter
    cd FlaskStarter
    pip install .
    
  2. Call the create_flask_project function from the FlaskStarter package to create a new Flask project:

    from FlaskStarter import create_flask_project
    
    create_flask_project()
    

    After clicking on the link http://127.0.0.1:5000, you should see a Hello, World message h1 title on the webpage.

    The function accepts the following parameters:

    • root_dir (str, optional): Root directory for the project. Defaults to os.getcwd().
    • create_venv (bool, optional): Create virtual environment. Defaults to True.
    • create_app (bool, optional): Create app.py. Defaults to True.
    • create_html (bool, optional): Create index.html. Defaults to True.
    • create_css (bool, optional): Create index.css. Defaults to True.
    • create_js (bool, optional): Create index.js. Defaults to True.
    • create_gitignore (bool, optional): Create .gitignore. Defaults to True.
    • execute_batch (bool, optional): Execute the batch file. Defaults to True.
  3. View the run.py file for a complete example.

Project Files

  • FlaskStarter.py: The main automation script that sets up your Flask project.

  • deleter.py: A script for deleting project files and directories, leaving only FlaskStarter.py intact. Useful for cleaning up after your project is complete. Mainly for testing purposes, not recommended for production use.

  • after.bat: A batch script for activating the virtual environment, installing Flask and other dependencies, and running your Flask app.

Note

  • FlaskStartApp is the name of the package on PyPI, while FlaskStarter is the name of the package in the repository.

  • FlaskStarter.py is the primary automation script, while deleter.py is intended for cleaning up the project files after use.

  • Make sure to customize your Flask app code in app.py and add any additional dependencies to requirements.txt.

  • Happy coding! 😊

Metadata

Release files for FlaskStarterApp 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FlaskStarterApp 1.0.3
File Size Uploaded
FlaskStarterApp-1.0.3.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FlaskStarterApp 1.0.3
File Interpreter ABI Platform
FlaskStarterApp-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / FlaskStarterApp-1.0.3.tar.gz

Download URL FlaskStarterApp-1.0.3.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
98196d6e603317ab4e9981350248c58771e5aa3b17cc7ea41c137fb6154c47c5
BLAKE2b-256 checksum
How to use checksums
44f8974926139683674b546b5b921a9a5bba3865f85aefc45c5cb827117c7197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.4

Release files / FlaskStarterApp-1.0.3-py3-none-any.whl

Download URL FlaskStarterApp-1.0.3-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfbfd42098fbc5928238982b11dccb77524b406f2369285dc5afe942803c4d32
BLAKE2b-256 checksum
How to use checksums
5a12345e619b9bc3aebcc3ffce779918fec94c9de4d9b5f12744959d9235aed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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