{"id":18011348,"url":"https://github.com/mhmzdev/django-restframework-learning","last_synced_at":"2025-04-04T13:42:45.612Z","repository":{"id":109325457,"uuid":"524441532","full_name":"mhmzdev/django-restframework-learning","owner":"mhmzdev","description":"Repo that contains beginner's friendly examples and basics of django-restframework to get started","archived":false,"fork":false,"pushed_at":"2022-08-18T07:55:45.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T23:27:40.025Z","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/mhmzdev.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":"2022-08-13T15:48:12.000Z","updated_at":"2022-08-22T01:34:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0dacbea-d6ef-42bf-8f93-699367e9eecd","html_url":"https://github.com/mhmzdev/django-restframework-learning","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/mhmzdev%2Fdjango-restframework-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fdjango-restframework-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fdjango-restframework-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fdjango-restframework-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmzdev","download_url":"https://codeload.github.com/mhmzdev/django-restframework-learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247188921,"owners_count":20898606,"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-10-30T03:09:43.293Z","updated_at":"2025-04-04T13:42:45.588Z","avatar_url":"https://github.com/mhmzdev.png","language":"Python","readme":"## Django-restframework learning\n\nI've put all the files in sequence in the branches while I'm learning to use django as backend framework.\n\n### 1st - Creating Django project\n- Created django project using command `django-admin startproject learning`\n\n### 2nd - First API view/response\n- Created first api view, or we also call it api response\n- Create app name `api` via command `python manage.py startapp api`\n- return json response from url `http://localhost:8000/home/`\n\n### 3rd - Returning back Data\n- Sending Json data from client side to server and handling it.\n- More like we send `body` in a `POST` request or `QueryParams`\n- Adding data like `headers` and `content_type`\n\n### 4th - Django Model as API response\n- Create a separate app `products`\n- Make a model/object class in `models.py`\n- Migrate the models for DB\n\nThis will actually let's the django knows there's a new model to look for now:\n- `python manage.py makemigration`\n- `python manage.py migrate`\n\n### 5th - Converting Model instance to python dict\n- import `model_to_dict`\n\n### 6th - Converting api view to djangon rest framework view\n- Used `@api_view()` for DRF\n- Stuff like restricting methods `GET`, `POST` etc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fdjango-restframework-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmzdev%2Fdjango-restframework-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fdjango-restframework-learning/lists"}