{"id":28626180,"url":"https://github.com/konoikon/backend-django-hackpack","last_synced_at":"2026-04-30T06:38:34.044Z","repository":{"id":41929497,"uuid":"209924762","full_name":"konoikon/Backend-Django-Hackpack","owner":"konoikon","description":"A Hackpack to create a RESTful API with Django","archived":false,"fork":false,"pushed_at":"2022-04-22T22:21:36.000Z","size":14,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T20:35:26.157Z","etag":null,"topics":["django","hackathon","python","rest-api","vandyhacks"],"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/konoikon.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-09-21T04:30:26.000Z","updated_at":"2019-10-08T00:45:28.000Z","dependencies_parsed_at":"2022-08-11T22:50:37.616Z","dependency_job_id":null,"html_url":"https://github.com/konoikon/Backend-Django-Hackpack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/konoikon/Backend-Django-Hackpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konoikon%2FBackend-Django-Hackpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konoikon%2FBackend-Django-Hackpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konoikon%2FBackend-Django-Hackpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konoikon%2FBackend-Django-Hackpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konoikon","download_url":"https://codeload.github.com/konoikon/Backend-Django-Hackpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konoikon%2FBackend-Django-Hackpack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259432314,"owners_count":22856724,"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","hackathon","python","rest-api","vandyhacks"],"created_at":"2025-06-12T08:41:08.080Z","updated_at":"2026-04-30T06:38:29.014Z","avatar_url":"https://github.com/konoikon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend with Django\nA Hackpack by VandyHacks\n\nDjango is a Python-based free and open-source web framework,\nwhich follows the model-template-view architectural pattern.\nThis hackpack provides you with the building blocks for a **custom\nAPI** in Django using `djangorestframework`.\n\nDjango REST Framework is a free and open-source Python library\nthat facilitates the easier creation of APIs with Django as it\nprovides important classes and functions that are specific to\nRESTApis.\n\n## What is an API? Do I need one?\n\nAn API—or Application Programming Interface—is a set of functions\nthat enables you to access/mutate your application's data.\n\nThe main concept is: you have a database with data, so you create\na *server* to access that data.\n\nThere are 4 main operations you can have in a RESTful API:\n- `GET` enables you to access your database and returns data based on a query (i.e., search terms)\n- `POST` enables you to create a new piece of data in your database,\naccording to the model (schema) you specified.\n- `PUT` enables you to modify data that *that already exist* on the database\n- `DELETE` enables you to delete data from your database\n\n## Basic Django Architecture\n\n### Models\n\nEverything starts by the definition of the **models**, that is the\narchitecture of the data you will store in your database. For example:\n```python\nclass Person(models.Model):\n    \n    name = models.CharField(max_length=100)\n    # probably more fields here\n\n```\n`Person` is a `Model` (inherited by the official Django class) that has a name of type `CharField`\n(think of it as a string). This will create a *table* named \"People\" (Well this is not the exact name, but\n that's what it means.) which will have one column named \"Name\" and we can \n enter People objects with a field `name`.\n \n### Views\n\nViews are the functions that we define to access or mutate our data. This is\nwhere you define your `get`/`post`/... methods and how they work.\n\nIt is important that we choose *how to access our data* and *in what form* we return them. For returning\ndata we are going to use something called **JSON Format**. Think of JSON objects as Python\ndictionaries. For example:\n```python\n{\n    \"name\": \"John\"\n}\n```\nThe above object can be a Person according to the model definition above.\n\n### URLs\n\nAll those amazing functions you wrote will be accessible through a URL. For example when you access\n`http://localhost:8000/artists/` in your browser, you automatically perform a `GET` request\nto that URL. In your project, you'll be able to programmatically specify what type of request\nyou make (or you could use a tool such as [Postman](https://www.getpostman.com/)).\n\n## How to use this Hackpack\n\n1. Click the *Use this template* button on this repo. Then follow the instructions to create your own repository\nusing this code.\n2. `git clone` the repository to your local machine\n3. `cd` into the `hackpack` directory\n4. Create a new python [virtual environment](https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/26/python-virtual-env/).\n5. `source \u003cenv_name\u003e/bin/activate` to activate your environment\n6. `pip install -r requirements.txt` to install dependencies\n7. `python manage.py makemigrations \u0026\u0026 python manage.py migrate` to migrate the database\n8. Run your server with `python manage.py runserver`.\n\nYou're all set!\n\n## Now What?!\n\nThe process of writing an API in a Django App is simple:\n1. Write your models in `models.py` (Note: Every time\n you update your models you should run `python manage.py makemigrations \u0026\u0026 python manage.py migrate`)\n2. Define your serializers in `serializers.py`\n3. Write your views in `views.py`\n4. Connect the views to respective urls in `urls.py`\n5. Repeat.\n\nCheck out the files already provided to see an example of what your code could look like.\n\n## Official Documentation\n\nAlthough we try our best to provide you with the essentials to get started, there is\nso much we can do. This is why it is **essential** to give you links to the original Django Documentation \nand `djangorestframework` documentation.\n\n- [Official Django Documentation](https://docs.djangoproject.com/en/2.2/)\n- [Official Rest Framework Documentation](https://www.django-rest-framework.org/)\n\n## Requirements\n\n- You should have Python installed to use this hackpack. You can download it [here](https://www.python.org).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonoikon%2Fbackend-django-hackpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonoikon%2Fbackend-django-hackpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonoikon%2Fbackend-django-hackpack/lists"}