{"id":16996441,"url":"https://github.com/tyaga001/django-authorization","last_synced_at":"2026-05-15T20:33:06.257Z","repository":{"id":241121693,"uuid":"804384585","full_name":"tyaga001/django-authorization","owner":"tyaga001","description":"How to Implement Authorization in Django","archived":false,"fork":false,"pushed_at":"2024-07-01T18:50:41.000Z","size":2081,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T06:43:48.295Z","etag":null,"topics":["authorization","blog","django","python"],"latest_commit_sha":null,"homepage":"https://www.permit.io/blog/fine-grained-authorization-with-django","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/tyaga001.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-05-22T13:38:27.000Z","updated_at":"2024-07-08T14:50:13.000Z","dependencies_parsed_at":"2024-05-22T14:56:02.542Z","dependency_job_id":"f6db1a4a-6a3f-4092-b6f3-37ecb6a7e659","html_url":"https://github.com/tyaga001/django-authorization","commit_stats":null,"previous_names":["tyaga001/django-authorization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tyaga001/django-authorization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyaga001%2Fdjango-authorization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyaga001%2Fdjango-authorization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyaga001%2Fdjango-authorization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyaga001%2Fdjango-authorization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyaga001","download_url":"https://codeload.github.com/tyaga001/django-authorization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyaga001%2Fdjango-authorization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authorization","blog","django","python"],"created_at":"2024-10-14T03:52:25.013Z","updated_at":"2026-05-15T20:33:06.237Z","avatar_url":"https://github.com/tyaga001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django-Authorization\nHow to Implement Authorization in Django\n\n# Hospital System\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Description\n\nA Django project for managing a hospital system using [Permit.io](https://app.permit.io/) for authorization. The project includes a RESTful API for managing patients, doctors, and appointments. The API is secured using ABAC (Attribute-Based Access Control) and RBAC (Role-Based Access Control) policies. The project also includes a PDP (Policy Decision Point) microservice for evaluating access control policies. \n\n## Features\n\n- ABAC (Attribute-Based Access Control)\n- CRUD operations\n- RESTful API\n- User authentication\n- Role-based access control\n- ReBAC (Relationship-Based Access Control)\n\n## Installation\n\n1. Clone the repository: `https://github.com/tyaga001/django-authorization.git`\n\n2. **Cd into the project directory:**\n\n    ```sh\n    cd hsystem\n    ```\n\n3. **Create a virtual environment:**\n\n    ```sh\n    python3 -m venv venv\n    ```\n\n4. **Activate virtualenv:**\n\n    For general use:\n    \n    ```sh\n    source venv/bin/activate\n    ```\n\n    For zsh users:\n    \n    ```sh\n    source venv/bin/activate.zsh\n    ```\n\n    For bash users:\n    \n    ```sh\n    source venv/bin/activate.bash\n    ```\n\n    For fish users:\n    \n    ```sh\n    source venv/bin/activate.fish\n    ```\n\n5. **Install the dependencies:**\n\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n6. **Apply database migrations:**\n\n    ```sh\n    python manage.py migrate\n    ```\n\n    Or\n\n    ```sh\n    python manage.py migrate --run-syncdb\n    ```\n\n    Or\n\n    ```sh\n    python manage.py makemigrations hsystem\n    python manage.py migrate\n    ```\n\n7. **Start the development server:**\n\n    ```sh\n    python manage.py runserver 5000\n    ```\n\n\n\n## Run your local PDP Microservice container\n\nIf you do not have Docker installed as of yet, click [here](https://docs.docker.com/get-docker/) to install Docker.\n\n### Pull the container \n\nRun the following command to pull the PDP Microservice container:\n\n```bash\ndocker pull permitio/pdp-v2:latest\n```\n\n### Run the container\n\nRemember to replace \u003cYOUR_API_KEY\u003e with the Secret Key you obtained from your dashboard.\n\n```bash\n\ndocker run -it -p 7766:7000 --env PDP_DEBUG=True --env PDP_API_KEY=\u003cYOUR_API_KEY\u003e permitio/pdp-v2:latest\n\n```\n\n## Usage\n\n1. Create a superuser: `python manage.py createsuperuser`\n2. Access the admin panel: `http://localhost:5000/admin/`\n3. Access the API: `http://localhost:5000/api/`\n4. Access the documentation: `http://localhost:5000/docs/` \n\n## Test the App\n\nRun the following command in a separate terminal to test whether the app is working as expected:\n\n```bash\ncurl -X GET http://localhost:5000/patients/1/\n\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Blog\n[How to Implement Authorization with Django](https://www.permit.io/blog/fine-grained-authorization-with-django)\n\n## Additional Resources\n\n- Follow my articles on [freeCodeCamp](https://www.freecodecamp.org/news/author/theankurtyagi/).\n- Visit my [personal blog](https://theankurtyagi.com/blog/) for more tech-related articles.\n\nThank you for reading, and happy coding.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyaga001%2Fdjango-authorization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyaga001%2Fdjango-authorization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyaga001%2Fdjango-authorization/lists"}