{"id":20500334,"url":"https://github.com/archtaqi/django-rest-api","last_synced_at":"2025-04-13T18:52:29.476Z","repository":{"id":41941285,"uuid":"190877536","full_name":"ArchTaqi/django-rest-api","owner":"ArchTaqi","description":"Django Project With Web + APIs using JWT","archived":false,"fork":false,"pushed_at":"2022-12-08T06:36:38.000Z","size":668,"stargazers_count":67,"open_issues_count":7,"forks_count":21,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T09:41:11.253Z","etag":null,"topics":["django","django-rest-framework","docker","docker-compose"],"latest_commit_sha":null,"homepage":"","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/ArchTaqi.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}},"created_at":"2019-06-08T11:01:29.000Z","updated_at":"2025-02-23T10:00:11.000Z","dependencies_parsed_at":"2023-01-24T18:45:54.149Z","dependency_job_id":null,"html_url":"https://github.com/ArchTaqi/django-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchTaqi%2Fdjango-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchTaqi%2Fdjango-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchTaqi%2Fdjango-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchTaqi%2Fdjango-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArchTaqi","download_url":"https://codeload.github.com/ArchTaqi/django-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248765999,"owners_count":21158296,"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":["django","django-rest-framework","docker","docker-compose"],"created_at":"2024-11-15T18:20:32.453Z","updated_at":"2025-04-13T18:52:29.432Z","avatar_url":"https://github.com/ArchTaqi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django REST APIs with DRF\n\nAn example RESTful API built using Django 2.2\n\n## Best Practices for Designing a Pragmatic RESTful API\n\n    Use RESTful URLs and actions\n    Version via the URL, not via headers\n    HATEOAS\n    Use query parameters for advanced filtering, sorting \u0026 searching\n    Limit which fields are returned from the API\n    Return something useful from POST, PATCH \u0026 PUT requests\n    Pretty print by default \u0026 gzip supported\n    Consider using JSON for POST, PUT and PATCH request bodies\n    Paginate using Link headers\n    Use token based authentication\n    Include response headers that facilitate caching\n    Effectively use HTTP Status codes\n    \n# Pet Store\n\n### Pet\n\n### Store\n\n### User\n\n\n# Testing\n\n**_Token Creation_**\n\nIn case of new user \n```bash\n`$ http POST 127.0.0.1:8000/api-register/ username=muhammadtaqi password=Yourpass! email=taqi.official@gmail.com`\n```\nreturn an confirmation URL\n```json\n{\n    \"confirmation_url\": \"http://127.0.0.1:8000/api-activate/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImtyenlzenRvZkBrei5jb20iLCJ1c2VyX2lkIjoyNSwidXNlcm5hbWUiOiJrcnp5c2llayIsImV4cCI6MTQ3OTA1MDQ5M30.CMcW8ZtU6AS9LfVvO-PoLyqcwi6cOK1VzI2o7pEPX2k/\"\n}\n```\n\n```bash\n$ http GET http://127.0.0.1:8000/api-activate/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6ImtyenlzenRvZkBrei5jb20iLCJ1c2VyX2lkIjoyNSwidXNlcm5hbWUiOiJrcnp5c2llayIsImV4cCI6MTQ3OTA1MDQ5M30.CMcW8ZtU6AS9LfVvO-PoLyqcwi6cOK1VzI2o7pEPX2k/\n```\n```json\n[\n    \"User Activated\"\n]\n```\nLogin with Your Creds now.....\n```bash\n$ http POST 127.0.0.1:8000/api-auth/ username=muhammadtaqi password=Yourpass!\n```\n```json\n{\n    \"token\": \"\u003cJWT-TOKEN\u003e\"\n}\n```\n```bash\n$ http POST 127.0.0.1:8000/api/v1/pets/ 'Authorization: Bearer \u003cjwt-token\u003e'\n```\n\n**_Token Verification_**\n\n`$ http POST 127.0.0.1:8000/token-verify/ token=\u003cjwt-token\u003e`\n\n**_Token Refresh_**\n\n`$ http POST 127.0.0.1:8000/token-refresh/ token=\u003cexisting-jwt-token\u003e`\n\n## Environment variables\n\nThese are common between environments. The `ENVIRONMENT` variable loads the correct settings, possible values are: `DEVELOPMENT`, `STAGING`, `PRODUCTION`.\n\n```\nENVIRONMENT='DEVELOPMENT'\nDJANGO_SECRET_KEY='dont-tell-eve'\nDJANGO_DEBUG='yes'\n```\n\nThese settings(and their default values) are only used on staging and production environments.\n\n```\nDJANGO_SESSION_COOKIE_SECURE='yes'\nDJANGO_SECURE_BROWSER_XSS_FILTER='yes'\nDJANGO_SECURE_CONTENT_TYPE_NOSNIFF='yes'\nDJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS='yes'\nDJANGO_SECURE_HSTS_SECONDS=31536000\nDJANGO_SECURE_REDIRECT_EXEMPT=''\nDJANGO_SECURE_SSL_HOST=''\nDJANGO_SECURE_SSL_REDIRECT='yes'\nDJANGO_SECURE_PROXY_SSL_HEADER='HTTP_X_FORWARDED_PROTO,https'\n```\n\n### Heroku\n\n```bash\n$ heroku create\n$ heroku addons:add heroku-postgresql:hobby-dev\n$ heroku pg:promote DATABASE_URL\n$ heroku config:set ENVIRONMENT=PRODUCTION\n$ heroku config:set DJANGO_SECRET_KEY=`./manage.py generate_secret_key`\n```\n\n## REsources\n\n- [Django Builder](http://mmcardle.github.io/django_builder/#!/models)\n- [Django, Docker and Postgres](https://wsvincent.com/django-docker-postgresql)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtaqi%2Fdjango-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchtaqi%2Fdjango-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtaqi%2Fdjango-rest-api/lists"}