Flask Noodle | Instant Project Folder Generator

Ayokunle Odutayo
3 min readApr 12, 2021

Step-by-Step tutorial using flasknoodle package to quickly generate your Flask Application project folders and files.

Flask Logo
Photo from Flask official Page

Flask is one of the very popular Python frameworks available in the market. It is a lightweight framework which gives developers freedom to customise to their taste.

It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions. However, Flask supports extensions that can add application features as if they were implemented in Flask itself. — Wiki

Why do we need Flasknoodle?

To start up a Flask Application, we need a number of folders and files. We also need good amount of boilerplate code. Building the folder structure and writing the starter code could take the developer a bit of time and effort.

The flasknoodle application helps developers by saving them time that would have been spent writing boiler plate code. Developers can therefore spend more time writing the code that matters. For example, AI/ML engineers can use flasknoodle to quickly generate a working Flask application. They only need to add few endpoints to the original application to serve their models.

Flasknoodle provides one endpoint ‘/’ which serves an index.html file. See example below:

Flask application with single endpoint
Flask Application with only one endpoint

Additional endpoint can easily be added. See example below where the ‘/about’ endpoint was added.

Flask application with two endpoints, i.e. includes user generated endpoint
Flask Application with two endpoints. The ‘/about’ endpoint was added by user

Installing Flasknoodle

  • First, we need to install and start up a virtual environment in current directory. This is an optional step, however it is highly recommended to install packages in virtual environment. This will create an isolated environment for Python projects. This means that each project can have its own dependencies, regardless of what dependencies every other project has.
Installing virtual environment
Create and activate a virtual environment
Installing flasknoodle package
Install flasknoodle package from PyPI
  • Generate complete Flask project template in current directory (default project name is “server”)
Using “flasknoodle” keyword to generate flask application folder
Generate project folder using keyword flasknoodle
  • cd into application directory (i.e. server folder)
Folder Structure
Generated Flask Application folder
  • Install dependencies from ‘requirements.txt
Installing dependencies
Install dependencies
  • Run Application
Running Flask application
Start Flask application

Conclusion

Flasknoodle flask project generator should be able to save developers who are familiar with Flask, 5–10 minutes when starting a new project.

Pull requests with improvements and fixes are actively welcomed. The whole working repository is available on GitHub.

--

--