{"id":22354913,"url":"https://github.com/kadhirash/build-a-python-rest-api-with-django","last_synced_at":"2026-05-02T13:34:52.090Z","repository":{"id":88169626,"uuid":"303760095","full_name":"kadhirash/Build-A-Python-REST-API-With-Django","owner":"kadhirash","description":"My first step into building a REST API using Django and the Django Rest Framework, and implementing CRUD operations.","archived":false,"fork":false,"pushed_at":"2020-10-19T22:31:58.000Z","size":1032,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T12:47:23.955Z","etag":null,"topics":["crud","django","django-rest-framework","python3","rest-api","restful-api"],"latest_commit_sha":null,"homepage":"","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/kadhirash.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":"2020-10-13T16:14:35.000Z","updated_at":"2020-10-19T15:00:29.000Z","dependencies_parsed_at":"2023-07-19T03:00:42.878Z","dependency_job_id":null,"html_url":"https://github.com/kadhirash/Build-A-Python-REST-API-With-Django","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kadhirash/Build-A-Python-REST-API-With-Django","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadhirash%2FBuild-A-Python-REST-API-With-Django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadhirash%2FBuild-A-Python-REST-API-With-Django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadhirash%2FBuild-A-Python-REST-API-With-Django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadhirash%2FBuild-A-Python-REST-API-With-Django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kadhirash","download_url":"https://codeload.github.com/kadhirash/Build-A-Python-REST-API-With-Django/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadhirash%2FBuild-A-Python-REST-API-With-Django/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: 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":["crud","django","django-rest-framework","python3","rest-api","restful-api"],"created_at":"2024-12-04T13:15:48.257Z","updated_at":"2026-05-02T13:34:52.070Z","avatar_url":"https://github.com/kadhirash.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API with Django Rest Framework\n\n\u003e A web application allowing me to learn more about Representational state transfer(REST)ful API's using pure Django as well as the Django Rest Framework (DRF) and implementing Create, Retrieve, Update, Delete (CRUD) funcionalities with my REST API. Althought tedious work in Django, helped me appreciate the usefulness of DRF and the reason for REST.\n\n# Table of Contents\n\n* [General Information](#general-information)\n* [Technologies/Tools](#technologiestools)\n* [Setup](#setup)\n* [Screenshots and Code Examples](#screenshots-and-code-examples)\n* [Status](#status)\n* [Credits](#credits)\n* [Roadblocks](#roadblocks)\n## General Information\n\nWith this project I was able to further understand RESTful API's, Django/DRF, as well as CRUD operations. I have always been curious about REST API's as I see it being used everywhere, but being able to implement one using Django was really fun! \n\n## Technologies/Tools\n\n* Python 3.8.5\n* Django 3.1.2/DRF\n* RESTful APIs\n\n## Setup\nI will show you how I went about this with just the Django portion. The DRF portion was really similar and without excess steps.\n\nAssuming that pip3 is already installed in your local machine since Python3 should be as well, and you're in a folder,\ncreate a [virtual environment](https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-Python-s-virtualenv-using-Python-3) and begin building simply by doing \n\n1) `virtualenv -p python3 .` \n\nFollowed by \n\n2) `source bin/activate` (don't forget to type `deactivate` when you want to leave the virtual environment!)\n\nto activate the virtual environment. It was there I installed certain libraries required such as Django, Requests, Pillow, etc. Again, it would depend on your machine. I will skip some of those steps but add them as required if compilation errors.\n\n3) `mkdir src` \n\nTo create a folder for where to write all your source code.\n\n4) `pip3 install django` \n\n5) `cd src'\n\n6) `django-admin startproject RESTfulAPI .` \n\nNote, the name of the project can be anything, as I called it \"testapi\" in my source code.\n\nYou should see a \"manage.py\" file in the current directory you're in.\n\n7) `python3 manage.py migrate`\n\n[Migrate](https://www.geeksforgeeks.org/django-manage-py-migrate-command-python/) allows the machine to execute SQL commands in the database file. To confirm, if you do `ls`, a new \"db.sqlite3\" file should have appeared.\n\n8) `python3 manage.py createsuperuser` \n\nAnd simply fill in the requirements. This step is just to see how admin privleges via Django works. \n\nNext,\n\n9) `python3 manage.py runserver`\n\nI recommend opening another terminal window and activating the virtual enironemnt (but not running the server) to be able to write and execute code and see the live updates on the running server of the first terminal. \n\nLastly,\n\n10) `Python3 manage.py startapp [insert name here]`\n\nAwesome! This should allow you now to start on your RESTful API creation journey as well as implementing CRUD functionalities of course!\n\n\n## Screenshots and Code Examples\n### Pure Django\n#### Admin Features\n![Admin Login](img/django_admin_login.png)\n\n![Admin Front Page](img/django_admin_front_page.png)\n\n#### Create \n\u003e Adding an object with id 28\n\n![Create](img/create_update_t.png)\n\n\u003e Showcasing it on the hosted website\n\n![Create](img/create_update_w.png)\n\n\n#### Retrieve\n\u003e Now, retrieve all updated contents, notice id 28 is there!\n\n![Retrieve](img/retrieve.png)\n\n#### Update \n\u003e Updating id 28's content\n\n![Update](img/update_t.png)\n\n![Update](img/update_w.png)\n\n#### Delete \n\u003e Deleting id 28's content\n\n![Delete](img/delete_t.png)\n\n![Delete](img/delete_w.png)\n\n## Status\n\nProject is: *in progress*\n\n## Credits\nThis implementation was based on the [Udemy course](https://www.udemy.com/course/build-a-python-rest-api-with-the-django-rest-framework/) by Justin Mitchel!! Although old and from 2018, it was fun to try and implement a newer version in 2020 with a newer version of Django and Python3.\n\n## Roadblocks\nAs mentioned above, the Udemy course was based on an older version of Python3 and Django (1.11.8). Thus, I had to either downgrade my current Python3 version to 3.6 to use the Django in the video or upgrade my Django but implement in a different way. I went along with the latter option. I faced quite a few bugs in the beginning since I had a newer version of Django so implementing certain functions had to be done differently. For example, when writing this line of code, `user = models.ForeignKey(settings,AUTH_USER_MODEL)` is perfectly fine in the older version of Django. However, in the newer one I kept getting \"TypeError: __init__() missing 1 required positional argument: 'on_delete'\" I was confused and from a quick troubleshoot using the Django [document](https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey) I realized I needed to actually write `user = models.ForeignKey(settings,AUTH_USER_MODEL, on_delete = models.cascade)` and the error went away! \n\nOther than these small errors from time to time, the overall project was fun to implement and watch the project in action! \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadhirash%2Fbuild-a-python-rest-api-with-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadhirash%2Fbuild-a-python-rest-api-with-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadhirash%2Fbuild-a-python-rest-api-with-django/lists"}