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! 😊

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

FlaskStarterApp-1.0.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FlaskStarterApp-1.0.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file FlaskStarterApp-1.0.3.tar.gz.

File metadata

  • Download URL: FlaskStarterApp-1.0.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.4

File hashes

Hashes for FlaskStarterApp-1.0.3.tar.gz
Algorithm Hash digest
SHA256 98196d6e603317ab4e9981350248c58771e5aa3b17cc7ea41c137fb6154c47c5
MD5 be9edfd6dd52616d459c5d58eec086ab
BLAKE2b-256 44f8974926139683674b546b5b921a9a5bba3865f85aefc45c5cb827117c7197

See more details on using hashes here.

File details

Details for the file FlaskStarterApp-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for FlaskStarterApp-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bfbfd42098fbc5928238982b11dccb77524b406f2369285dc5afe942803c4d32
MD5 9fa330593529a999f5c5549a4c4c52f3
BLAKE2b-256 5a12345e619b9bc3aebcc3ffce779918fec94c9de4d9b5f12744959d9235aed8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page