flask-unity


Nameflask-unity JSON
Version 0.0.15 PyPI version JSON
download
home_pagehttps://flask-unity.readthedocs.io
SummaryAn extension of flask web framework that erase the complexity of structuring flask project blueprint, packages, connecting other flask extensions, database migrations, and other annoying stuffs.
upload_time2023-10-11 09:27:48
maintainer
docs_urlNone
authorUsman Musa
requires_python>=3.6
licenseMIT
keywords flask_unity
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flask-Unity

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

[![Downloads Month Badge](https://static.pepy.tech/badge/flask-unity/month)](https://pypi.org/project/flask-unity)
[![Downloads Week Badge](https://static.pepy.tech/badge/flask-unity/week)](https://pypi.org/project/flask-unity)
[![License Badge](https://img.shields.io/pypi/l/flask-unity.svg)](https://pypi.org/project/flask-unity)
[![Supported Wheel Badge](https://img.shields.io/pypi/wheel/flask-unity.svg)](https://pypi.org/project/flask-unity)
[![Supported Versions Badge](https://img.shields.io/pypi/pyversions/flask-unity.svg)](https://pypi.org/project/flask-unity)
[![Contributors](https://img.shields.io/github/contributors/usmanmusa1920/flask-unity.svg)](https://github.com/usmanmusa1920/flask-unity/graphs/contributors)

## Installation

Install and update the latest release from <a href="https://pypi.org/project/flask-unity">pypi</a>, 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!.

```sh
    pip install --upgrade flask_unity
```

## Create flask project using flask_unity

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

```sh
    flask_unity -p schoolsite
    # or
    flask_unity --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:

```sh
    flask_unity 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:

```sh
    flask_unity 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

```sh
    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`

```sh
    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

```py
from exam.views import exam
```

registering blueprint

```py
    reg_blueprints = reg_blueprints_func(
        base,
        exam,
    )
```

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

```sh
    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 <a href="https://github.com/usmanmusa1920/flask-unity/tree/master/example">here!</a>
More documentations <a href="https://flask-unity.readthedocs.io">here!</a>

### Flask-unity default page

[![Flask-unity default page](https://raw.githubusercontent.com/usmanmusa1920/flask-unity/master/docs/_static/flask_unity_default_page.png)](https://flask-unity.readthedocs.io)

## Useful links

-   Documentation: https://flask-unity.readthedocs.io
-   Repository: https://github.com/usmanmusa1920/flask-unity
-   PYPI Release: https://pypi.org/project/flask-unity

Pull requests are welcome


# Change Log

## 0.0.15 (11/october/2023)

- 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://flask-unity.readthedocs.io",
    "name": "flask-unity",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "flask_unity",
    "author": "Usman Musa",
    "author_email": "usmanmusa1920@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/64/aa/e494d714966e26e65d26138a8e2dda7e1738f1cef452069e139799b04dd6/flask_unity-0.0.15.tar.gz",
    "platform": "any",
    "description": "# Flask-Unity\n\nAn extension of flask web framework that erase the complexity of structuring flask project blueprint, packages, connecting other flask extensions, database migrations, and other annoying stuffs.\n\n[![Downloads Month Badge](https://static.pepy.tech/badge/flask-unity/month)](https://pypi.org/project/flask-unity)\n[![Downloads Week Badge](https://static.pepy.tech/badge/flask-unity/week)](https://pypi.org/project/flask-unity)\n[![License Badge](https://img.shields.io/pypi/l/flask-unity.svg)](https://pypi.org/project/flask-unity)\n[![Supported Wheel Badge](https://img.shields.io/pypi/wheel/flask-unity.svg)](https://pypi.org/project/flask-unity)\n[![Supported Versions Badge](https://img.shields.io/pypi/pyversions/flask-unity.svg)](https://pypi.org/project/flask-unity)\n[![Contributors](https://img.shields.io/github/contributors/usmanmusa1920/flask-unity.svg)](https://github.com/usmanmusa1920/flask-unity/graphs/contributors)\n\n## Installation\n\nInstall and update the latest release from <a href=\"https://pypi.org/project/flask-unity\">pypi</a>, 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!.\n\n```sh\n    pip install --upgrade flask_unity\n```\n\n## Create flask project using flask_unity\n\nAfter the installation paste either (one) of the following command on your termianl\n\n```sh\n    flask_unity -p schoolsite\n    # or\n    flask_unity --project schoolsite\n```\n\nThis 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`.\n\nNext make migrations by:\n\n```sh\n    flask_unity db makemigrations\n```\n\nIf 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:\n\n```sh\n    flask_unity db migrate\n```\n\n> **Note**\n> As soon as you create the project make migrations and apply the migrations to avoid errors!\n\nNow ready to boot up the flask server by running the below command\n\n```sh\n    python run.py boot\n```\n\nVisit the local url `http://127.0.0.1:5000` this will show you index page of your project\n\n## Create flask app within your project (schoolsite)\n\nFor 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`\n\n```sh\n    python run.py create_app -a exam\n```\n\nthis will create an app (a new package called `exam`) within your project `(schoolsite)`\n\n## Register an app\n\nOnce 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`\n\nimporting blueprint\n\n```py\nfrom exam.views import exam\n```\n\nregistering blueprint\n\n```py\n    reg_blueprints = reg_blueprints_func(\n        base,\n        exam,\n    )\n```\n\nonce you register the app, boot up the flask webserver again by\n\n```sh\n    python run.py boot\n```\n\nvisit `http://127.0.0.1:5000` which is your project landing page\n\nvisit `http://127.0.0.1:5000/exam` this will take you to your app landing page (exam)\n\nvisit `http://127.0.0.1:5000/admin` this will take you to admin page. From there you are ready to go.\n\nTutorials <a href=\"https://github.com/usmanmusa1920/flask-unity/tree/master/example\">here!</a>\nMore documentations <a href=\"https://flask-unity.readthedocs.io\">here!</a>\n\n### Flask-unity default page\n\n[![Flask-unity default page](https://raw.githubusercontent.com/usmanmusa1920/flask-unity/master/docs/_static/flask_unity_default_page.png)](https://flask-unity.readthedocs.io)\n\n## Useful links\n\n-   Documentation: https://flask-unity.readthedocs.io\n-   Repository: https://github.com/usmanmusa1920/flask-unity\n-   PYPI Release: https://pypi.org/project/flask-unity\n\nPull requests are welcome\n\n\n# Change Log\n\n## 0.0.15 (11/october/2023)\n\n- Fifteen Release\n\n    - Fixed admin pages link (that are unable to show).\n\n- Fourteen Release\n\n    - 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.\n\n- Thirteen Release\n\n    - Modulising static files directory\n    - Introduce CLI for instanciating project\n    - Auto generate migration directory (alembic)\n    - Update library site, by creating `.readthedocs.yaml` and `conf.py`\n    - Change `thunder.py` to `run.py`\n    - Ship index route (page) `/` to flask-unity package\n\n- Twelveth Release\n\nTesting for OS compatibility also again! again!! again!!!\n\n- Eleventh Release\n\nTesting for OS compatibility again! again!! again!!!\n\n- Tenth Release\n\nTesting for OS compatibility again\n\n- Nineth Release\n\nFixing bugs\n\nFixing v0.0.8 bugs for OS compatibility, and also tested on windows OS\n\n- Eight Release\n\nOS compatibility\n\nMaking flask_unity to be compatible with windows OS as well as other OS\n\n- Seventh Release\n\nThis release mostly is for adding more docs and examples.\n\n- Sixth Release\n\nAlembic is included as dependency (in the require module list).\n\n- Fifth Release\n\nIn fifith release, we handle how default user file system tricks is, things like when user change his profile picture.\n\n- Fourth Release\n\nIn 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.\n\nDatabase migration is added using `alembic`\n\nSome 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!\n\nPossibly other well things are added which include auth system for `users` and more.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An extension of flask web framework that erase the complexity of structuring flask project blueprint, packages, connecting other flask extensions, database migrations, and other annoying stuffs.",
    "version": "0.0.15",
    "project_urls": {
        "Documentation": "https://flask-unity.readthedocs.io",
        "Download": "https://pypi.org/project/flask-unity",
        "Homepage": "https://flask-unity.readthedocs.io",
        "Source": "https://github.com/usmanmusa1920/flask-unity"
    },
    "split_keywords": [
        "flask_unity"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8a94ae5d187725377165e205d515229feff33b2016486ef35a8e158b482b2529",
                "md5": "e5ebbe828ac16a5d9d58e4e555dbfbfa",
                "sha256": "32e9c21dc6ac1d1f0ba2d9956315f3ca5b92712dfae3dfe439dcee4f50472c54"
            },
            "downloads": -1,
            "filename": "flask_unity-0.0.15-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e5ebbe828ac16a5d9d58e4e555dbfbfa",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 608839,
            "upload_time": "2023-10-11T09:27:32",
            "upload_time_iso_8601": "2023-10-11T09:27:32.571057Z",
            "url": "https://files.pythonhosted.org/packages/8a/94/ae5d187725377165e205d515229feff33b2016486ef35a8e158b482b2529/flask_unity-0.0.15-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64aae494d714966e26e65d26138a8e2dda7e1738f1cef452069e139799b04dd6",
                "md5": "355ae10280907d9224aabe0fb95dd1e5",
                "sha256": "9dbb9db82d133f3109faa3f5a1c0c085b43e809b2eb192b039c241dee395f5a1"
            },
            "downloads": -1,
            "filename": "flask_unity-0.0.15.tar.gz",
            "has_sig": false,
            "md5_digest": "355ae10280907d9224aabe0fb95dd1e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 600424,
            "upload_time": "2023-10-11T09:27:48",
            "upload_time_iso_8601": "2023-10-11T09:27:48.363655Z",
            "url": "https://files.pythonhosted.org/packages/64/aa/e494d714966e26e65d26138a8e2dda7e1738f1cef452069e139799b04dd6/flask_unity-0.0.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-11 09:27:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "usmanmusa1920",
    "github_project": "flask-unity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flask-unity"
}
        
Elapsed time: 0.27525s