Skip to main content

Flask-Unity

An extension of flask web framework that ease the complexity of structuring flask project blueprint, packages, connecting other flask extensions, database migrations, and other annoying stuffs.

Downloads Month Badge License Badge Supported Wheel Badge Supported Versions Badge

Installation

Install and update the latest release from pypi, we recomend you to create a virtual environment to avoid conflict (upgrade/downgrade of some of your system libraries) when installing flask-unity, this is just a recomendation, it still work even if you install it without using virtual environment. Basically the library was uploaded using sdist (Source Distribution) and bdist_wheel (Built Distribution), this software (library) is compatible and also tested with windows OS, linux, macOS and possibly can be compabible with others too!.

    pip install --upgrade flask_unity

Create flask project

After the installation paste either (one) of the following command on your termianl

    flaskunity -p schoolsite
    # or
    flaskunity --project schoolsite

This will create a project called schoolsite now cd into the schoolsite directory, if you do ls within the directory you just enter you will see a module called run.py, alembic.ini and some directories (some in the form of package) media, static, templates, migrations and a directory with the same name of your base directory name, in our case it is schoolsite.

Next make migrations by:

    flaskunity db makemigrations

If you do ls after making the migrations you will see it initiate a default.db file (an sqlite file) which is our default database. Apply the migrations:

    flaskunity db migrate

Note As soon as you create the project make migrations and apply the migrations to avoid errors!

Now ready to boot up the flask server by running the below command

    python run.py boot

Visit the local url http://127.0.0.1:5000 this will show you index page of your project

Create flask app within your project (schoolsite)

For you to start an app within your project schoolsite shutdown the flask development server by pressing CTRL+C and then run the following command, by giving the name you want your app to be, in our case we will call our app exam

    python run.py create_app -a exam

this will create an app (a new package called exam) within your project (schoolsite)

Register an app

Once the app is created open a file schoolsite/routes.py and import your exam blueprint which is in (exam/views.py), default name given to an app blueprint, is the app name so our exam app blueprint name is exam, after importing it, append (register) the app blueprint in a function called reg_blueprints_func, which was assigned to reg_blueprints in that same file of schoolsite/routes.py

importing blueprint

from exam.views import exam

registering blueprint

    reg_blueprints = reg_blueprints_func(
        base,
        exam,
    )

once you register the app, boot up the flask webserver again by

    python run.py boot

visit http://127.0.0.1:5000 which is your project landing page

visit http://127.0.0.1:5000/exam this will take you to your app landing page (exam)

visit http://127.0.0.1:5000/admin this will take you to admin page. From there you are ready to go.

Tutorials here! More documentations here!

Flask-unity default page

Flask-unity default page

Useful links

Pull requests are welcome

Change Log

0.0.18 (10/february/2026)

  • Update some typo!

0.0.17 (22/september/2024)

  • Seventeen Release

    • Make single page for error pages
    • Change run command from flask_unity to flaskunity
  • Sixteen Release

    • Make single page for error pages
    • Change run command from flask_unity to flaskunity
  • Fifteen Release

    • Fixed admin pages link (that are unable to show).
  • Fourteen Release

    • Tricks on how to add other extensions, by making example with flask-mail that provides a simple interface to set up SMTP with your Flask application and to send messages from your views and scripts.
  • Thirteen Release

    • Modulising static files directory
    • Introduce CLI for instanciating project
    • Auto generate migration directory (alembic)
    • Update library site, by creating .readthedocs.yaml and conf.py
    • Change thunder.py to run.py
    • Ship index route (page) / to flask-unity package
  • Twelveth Release

Testing for OS compatibility also again! again!! again!!!

  • Eleventh Release

Testing for OS compatibility again! again!! again!!!

  • Tenth Release

Testing for OS compatibility again

  • Nineth Release

Fixing bugs

Fixing v0.0.8 bugs for OS compatibility, and also tested on windows OS

  • Eight Release

OS compatibility

Making flask_unity to be compatible with windows OS as well as other OS

  • Seventh Release

This release mostly is for adding more docs and examples.

  • Sixth Release

Alembic is included as dependency (in the require module list).

  • Fifth Release

In fifith release, we handle how default user file system tricks is, things like when user change his profile picture.

  • Fourth Release

In this release we handle how we can customise the admin html page by inheriting (extends) it in our project templates/admin directory, and the admin page on how to bind models in the admin. Also I refactor other libraries that this package needs with their corresponding versions in the setup.py and requirements.txt files. In this release good documentations is well packed.

Database migration is added using alembic

Some error pages, default page were added but still you can customise it in your project sub folder (the package with the same name of your project in your project directory) in a file called route.py. Also an admin directory within your project templates folder is added too!

Possibly other well things are added which include auth system for users and more.

Metadata

Release files for flask-unity 0.0.18

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

Source distribution (sdist)

Source distribution for flask-unity 0.0.18
File Size Uploaded Provenance Actions
flask_unity-0.0.18.tar.gz 600.3 kB Without provenance Details for flask_unity-0.0.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-unity 0.0.18
File Interpreter ABI Platform Actions
flask_unity-0.0.18-py2.py3-none-any.whl Python 3, Python 2 none any Details for flask_unity-0.0.18-py2.py3-none-any.whl

Total release size: 1.2 MB

Release files / flask_unity-0.0.18.tar.gz

Download URL flask_unity-0.0.18.tar.gz
Size 600.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d3e9caef8dde366eeee0609a2f16c594171f5ff2ab6ede5bb15d96c147252e67
BLAKE2b-256 checksum
How to use checksums
5a862195865095dffd4a6a2bdba49c02cf0717b89d2c02759aa6fe652da129f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / flask_unity-0.0.18-py2.py3-none-any.whl

Download URL flask_unity-0.0.18-py2.py3-none-any.whl
Size 605.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
919be60b28837d062179065d74a376bdd64ff3da13df0f81a8f9332782c5d2bd
BLAKE2b-256 checksum
How to use checksums
be1c101d46235c096033d693d241712e486762688e282e16e1e2c4a7396c66d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for flask-unity 0.0.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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