{"id":19746862,"url":"https://github.com/b-ryan/cookiecutter-flask-with-organizations","last_synced_at":"2025-06-15T10:07:21.103Z","repository":{"id":142113098,"uuid":"120366649","full_name":"b-ryan/cookiecutter-flask-with-organizations","owner":"b-ryan","description":"A cookiecutter template for Flask applications with support for users and organizations","archived":false,"fork":false,"pushed_at":"2018-02-10T17:29:11.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T07:57:21.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b-ryan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-02-05T21:53:47.000Z","updated_at":"2023-07-08T14:44:44.000Z","dependencies_parsed_at":"2023-04-22T14:08:08.199Z","dependency_job_id":null,"html_url":"https://github.com/b-ryan/cookiecutter-flask-with-organizations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/b-ryan/cookiecutter-flask-with-organizations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fcookiecutter-flask-with-organizations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fcookiecutter-flask-with-organizations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fcookiecutter-flask-with-organizations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fcookiecutter-flask-with-organizations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-ryan","download_url":"https://codeload.github.com/b-ryan/cookiecutter-flask-with-organizations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fcookiecutter-flask-with-organizations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259957180,"owners_count":22937541,"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":[],"created_at":"2024-11-12T02:16:04.718Z","updated_at":"2025-06-15T10:07:21.077Z","avatar_url":"https://github.com/b-ryan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cookiecutter Flask With Organizations\n\nA(nother) Flask template for\n[cookiecutter](https://github.com/audreyr/cookiecutter)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Usage](#usage)\n- [Features](#features)\n- [OAuth Support](#oauth-support)\n- [Admin Panel](#admin-panel)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\nThe \"With Organizations\" portion of the title refers to the fact that this\nproject is meant for apps that do not just have users, but those users belong\nto one or more organizations. An example is [DbRhino](https://www.dbrhino.com/)\nwhich is the app where I originally wrote the code to manage organizations.\n\nThis project was originally derived from\n[cookiecutter-flask](https://github.com/sloria/cookiecutter-flask)\nbut has since diverged significantly. Particularly in that if you don't need\nsupport for organizations, the original project is great and will probably suit\nyour needs.\n\n## Usage\n\n```\n$ pip install cookiecutter\n$ cookiecutter https://github.com/b-ryan/cookiecutter-flask-with-organizations\n```\n\n## Features\n\nThis supports most of the features\n[here](https://github.com/sloria/cookiecutter-flask#features) with some notable\nexceptions:\n\n- Bootstrap 4\n- No npm project dependency. This also means:\n  - No JS/CSS minification\n\nThere are some additional features as well:\n\n- A built-in OAuth 2 server\n- Organization \u0026 Organization Membership models\n- Registration form that requires the name of an organization\n- An invite sending \u0026 redemption system for adding users to organizations\n- Gravatar support\n- Admin panel\n\n## OAuth Support\n\nThe rendered project implements an OAuth 2 server. When it grants permissions\nto an application, it does so for an organization, not a user. Meaning user A\nmay belong to organizations B and C. When they authorize an application, they\nmust choose whether to give authorization to B or C. Once they do, if the user\nis deactivated (no longer belongs to the organization granted access), the\napplication will still have access to the organization. This could be\nconsidered a bug. I am not yet sure whether this should be changed or what the\nappropriate authorization model is.\n\nThere will be a file called `oauth_client.py` which you can use to test the\nauthorization flow. To go through the entire flow:\n\n- Create an OAuth application [here](http://localhost:5000/orgs/1/applications)\n- Start the client using the generated client ID and secret with\n\n  ```\n  ./oauth_client.py [your-client-id] [your-client-secret]\n  ```\n\n- Go to http://localhost:8000\n\n## Admin Panel\n\nTo access the admin panel:\n\n- Update your user in the database to set the `is_admin` flag:\n\n  ```\n  update users set is_admin = true where email = 'you@example.com';\n  ```\n\n- Log in to the application\n- Visit http://localhost:5000/admin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-ryan%2Fcookiecutter-flask-with-organizations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-ryan%2Fcookiecutter-flask-with-organizations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-ryan%2Fcookiecutter-flask-with-organizations/lists"}