{"id":21448399,"url":"https://github.com/UshurbakiyevDavlat/Blog-App","last_synced_at":"2025-10-04T16:31:07.387Z","repository":{"id":108771427,"uuid":"585119707","full_name":"UshurbakiyevDavlat/DRF-Blog-App","owner":"UshurbakiyevDavlat","description":"Blog api on DRF","archived":false,"fork":false,"pushed_at":"2023-01-09T11:49:55.000Z","size":2048,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-23T03:15:13.052Z","etag":null,"topics":["allauth","corsheaders","django-rest-framework","heroku-deployment","postgresql","python","redoc","sqlite","swagger-ui","viewsets","whitenoise"],"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/UshurbakiyevDavlat.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":"2023-01-04T11:17:45.000Z","updated_at":"2024-05-11T05:53:13.000Z","dependencies_parsed_at":"2023-06-04T20:30:24.834Z","dependency_job_id":null,"html_url":"https://github.com/UshurbakiyevDavlat/DRF-Blog-App","commit_stats":null,"previous_names":["ushurbakiyevdavlat/drf-blog-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UshurbakiyevDavlat%2FDRF-Blog-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UshurbakiyevDavlat%2FDRF-Blog-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UshurbakiyevDavlat%2FDRF-Blog-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UshurbakiyevDavlat%2FDRF-Blog-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UshurbakiyevDavlat","download_url":"https://codeload.github.com/UshurbakiyevDavlat/DRF-Blog-App/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235276763,"owners_count":18964214,"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":["allauth","corsheaders","django-rest-framework","heroku-deployment","postgresql","python","redoc","sqlite","swagger-ui","viewsets","whitenoise"],"created_at":"2024-11-23T03:15:16.662Z","updated_at":"2025-10-04T16:31:06.786Z","avatar_url":"https://github.com/UshurbakiyevDavlat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlogApi\n## Blog api on DRF\n\nWe have deliberately repeated several steps from our earlier examples so the pattern\nof creating a new Django project and then its API should start to feel more familiar. The models\nare are pure traditional Django but otherwise the URLs, views, and serializers all come from DRF.\nWe added a detail endpoint to our API and started to explore the power of serializers.\nThe Blog API is completely functional for local use at this point however there is a big problem:\nanyone can update or delete an existing blog post! In other words, we do not have any\npermissions in place. In the next chapter we will learn how to apply permissions to protect our\nAPI.\n\nSetting proper permissions is a very important part of any API. As a general strategy, it is a good\nidea to set a strict project-level permissions policy such that only authenticated users can view\nthe API. Then make view-level or custom permissions more accessible as needed on specific API\nendpoints.\n\n\nUser authentication is one of the hardest areas to grasp when first working with web APIs.\nWithout the benefit of a monolithic structure, we as developers have to deeply understand and\nconfigure our HTTP request/response cycles appropriately.\nDjango REST Framework comes with a lot of built-in support for this process, including\nbuilt-in TokenAuthentication. However developers must configure additional areas like user\nregistration and dedicated urls/views themselves. As a result, a popular, powerful, and secure\napproach is to rely on the third-party packages dj-rest-auth and django-allauth to minimize\nthe amount of code we have to write from scratch.\n\n\nViewsets and routers are a powerful abstraction that reduce the amount of code we as developers\nmust write. However this conciseness comes at the cost of an initial learning curve. It will feel\nstrange the first few times you use viewsets and routers instead of views and URL patterns.\nChapter 9: Viewsets and Routers 167\nUltimately the decision of when to add viewsets and routers to your project is subjective. A good\nrule of thumb is to start with views and URLs. As your API grows in complexity if you find yourself\nrepeating the same endpoint patterns over and over again, then look to viewsets and routers.\nUntil then, keep things simple.\n\n\nAdding a schema and documentation is a vital part of any API. It is typically the first thing a fellow\ndeveloper looks at, either within a team or on an open-source projects. Thanks to the automated\nChapter 10: Schemas and Documentation 176\ntools covered in this chapter, ensuring your API has accurate, up-to-date documentation only\nrequires a small amount of configuration. The last step is to deploy the Blog API properly which\nwe’ll cover in the next chapter.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUshurbakiyevDavlat%2FBlog-App","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUshurbakiyevDavlat%2FBlog-App","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUshurbakiyevDavlat%2FBlog-App/lists"}