{"id":18020663,"url":"https://github.com/usmanmusa1920/flask-unity","last_synced_at":"2025-03-26T21:32:20.248Z","repository":{"id":186602365,"uuid":"675205202","full_name":"UsmanMusa1920/flask-unity","owner":"UsmanMusa1920","description":"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.","archived":false,"fork":false,"pushed_at":"2024-10-22T14:36:33.000Z","size":2189,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T14:08:02.575Z","etag":null,"topics":["flask","python"],"latest_commit_sha":null,"homepage":"https://flask-unity.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UsmanMusa1920.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-06T06:10:57.000Z","updated_at":"2024-10-22T14:38:33.000Z","dependencies_parsed_at":"2024-10-23T02:44:14.072Z","dependency_job_id":null,"html_url":"https://github.com/UsmanMusa1920/flask-unity","commit_stats":null,"previous_names":["usmanmusa1920/flask-unity"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsmanMusa1920%2Fflask-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsmanMusa1920%2Fflask-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsmanMusa1920%2Fflask-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsmanMusa1920%2Fflask-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UsmanMusa1920","download_url":"https://codeload.github.com/UsmanMusa1920/flask-unity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245738893,"owners_count":20664364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python"],"created_at":"2024-10-30T06:07:02.734Z","updated_at":"2025-03-26T21:32:15.217Z","avatar_url":"https://github.com/UsmanMusa1920.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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[![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\n## Installation\n\nInstall and update the latest release from \u003ca href=\"https://pypi.org/project/flask-unity\"\u003epypi\u003c/a\u003e, 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\n\nAfter the installation paste either (one) of the following command on your termianl\n\n```sh\n    flaskunity -p schoolsite\n    # or\n    flaskunity --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    flaskunity 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    flaskunity db migrate\n```\n\n\u003e **Note**\n\u003e 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 \u003ca href=\"https://github.com/usmanmusa1920/flask-unity/tree/master/example\"\u003ehere!\u003c/a\u003e\nMore documentations \u003ca href=\"https://flask-unity.readthedocs.io\"\u003ehere!\u003c/a\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusmanmusa1920%2Fflask-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusmanmusa1920%2Fflask-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusmanmusa1920%2Fflask-unity/lists"}