{"id":23691327,"url":"https://github.com/devnamdev2003/artistapi","last_synced_at":"2026-01-28T21:02:17.175Z","repository":{"id":183225760,"uuid":"669797109","full_name":"devnamdev2003/ArtistAPI","owner":"devnamdev2003","description":"This repository contains a customized Artist API built using Django REST Framework. The API allows users to perform CRUD operations on artists and their works. Token-based authentication is implemented using Django REST Framework's built-in authentication classes to ensure that only authenticated users can perform the CRUD operations.","archived":false,"fork":false,"pushed_at":"2024-02-03T04:22:33.000Z","size":1006,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T10:39:17.278Z","etag":null,"topics":["api","django","django-rest-framework","python","rest-api","webapi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/devnamdev2003.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":"2023-07-23T13:10:13.000Z","updated_at":"2025-04-10T09:01:14.000Z","dependencies_parsed_at":"2025-02-20T00:36:44.743Z","dependency_job_id":"cc502f92-58a9-4455-9a83-651e0467bf1e","html_url":"https://github.com/devnamdev2003/ArtistAPI","commit_stats":null,"previous_names":["devnamdev2003/artistapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devnamdev2003/ArtistAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnamdev2003%2FArtistAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnamdev2003%2FArtistAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnamdev2003%2FArtistAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnamdev2003%2FArtistAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devnamdev2003","download_url":"https://codeload.github.com/devnamdev2003/ArtistAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnamdev2003%2FArtistAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28851838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"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":["api","django","django-rest-framework","python","rest-api","webapi"],"created_at":"2024-12-30T02:56:33.966Z","updated_at":"2026-01-28T21:02:17.161Z","avatar_url":"https://github.com/devnamdev2003.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Artist API using Django REST Framework\n\nThis repository contains a customized Artist API built using Django REST Framework. The API allows users to perform CRUD operations on artists and their works. Token-based authentication is implemented using Django REST Framework's built-in authentication classes to ensure that only authenticated users can perform the CRUD operations.\n\n## Setup and Installation\n\n1. Clone the repository to your local machine:\n\n```bash\ngit clone https://github.com/your_username/ArtistAPI.git\ncd ArtistAPI\n```\n\n2. Create a virtual environment and activate it (optional but recommended):\n\n```bash\npython -m venv env\nsource env/bin/activate\n\n# On Windows\nenv\\Scripts\\activate\n```\n\n3. Install the required dependencies:\n\n```bash\nenv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n4. Apply the database migrations:\n\n```bash\npython manage.py migrate\n```\n\n5. Create a superuser to access the Django admin interface (optional but useful for testing):\n\n```bash\npython manage.py createsuperuser\n```\n\n6. Run the development server:\n\n```bash\npython manage.py runserver\n```\n\nThe API will now be accessible at `http://127.0.0.1:8000/`.\n\n## API Endpoints\n\n**httpie** : HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs \u0026 HTTP servers. The http \u0026 https commands allow for creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colorized output.\n[Documentation](https://httpie.io/docs/cli/examples)\n\n```bash\npip install httpie\n```\n\n\n#### User Registration\n\n- `POST /api/register/`: Register a new user by providing a username and password in the request body. Example:\n\n```bash\nhttp POST http://127.0.0.1:8000/api/register/ username=new_user password=new_password\n```\n\n#### Authentication\n\nTo perform CRUD operations, users need to be authenticated. The following endpoints are available for authentication:\n\n- `POST /api/token/`: Obtain an access token by providing valid username and password in the request body. Example:\n\n```bash\nhttp POST http://127.0.0.1:8000/api/token/ username=your_username password=your_password\n```\n\nThis will return an access token that should be included in the headers for subsequent API requests.\n\n\n\n### Artist Endpoints\n\n- `GET /api/artists/`: Retrieve a list of all artists.\n\n```bash\nhttp GET http://127.0.0.1:8000/api/artists/ \"Authorization: Token your_access_token\"\n```\n\n- `POST /api/artists/`: Create a new artist by providing the required data in the request body.\n\n\n```bash\nhttp POST http://127.0.0.1:8000/api/artists/ name=\"pawan\" user=1 works=1 \"Authorization:Token your_access_token\"\n```\n\n- `GET /api/artists/{artist_id}/`: Retrieve details of a specific artist.\n\n```bash\nhttp GET http://127.0.0.1:8000/api/artists/1/ \"Authorization: Token your_access_token\"\n```\n\n- `PUT /api/artists/{artist_id}/`: Update the details of a specific artist.\n\n\n```bash\nhttp POST http://127.0.0.1:8000/api/artists/ name=\"Dev\" user=1 works=1 \"Authorization:Token your_access_token\"\n```\n\n- `DELETE /api/artists/{artist_id}/`: Delete a specific artist.\n\n\n```bash\nhttp GET http://127.0.0.1:8000/api/artists/1/ \"Authorization: Token your_access_token\"\n```\n\n### Work Endpoints\n\n- `GET /api/works/`: Retrieve a list of all works.\n\n```bash\nhttp GET http://127.0.0.1:8000/api/works/ \"Authorization: Token your_access_token\"\n```\n\n- `POST /api/works/`: Create a new work by providing the required data in the request body.\n\n```bash\nhttp POST http://127.0.0.1:8000/api/works/ link=https://example.com/video work_type=YT \"Authorization:Token your_access_token\"\n```\n\n- `GET /api/works/{work_id}/`: Retrieve details of a specific work.\n\n```bash\nhttp GET http://127.0.0.1:8000/api/works/1/ \"Authorization: Token your_access_token\"\n```\n\n- `PUT /api/works/{work_id}/`: Update the details of a specific work.\n  \n```bash\nhttp POST http://127.0.0.1:8000/api/works/ link=https://example.com/video work_type=YT \"Authorization:Token your_access_token\"\n```\n\n- `DELETE /api/works/{work_id}/`: Delete a specific work.\n\n```bash\nhttp GET http://127.0.0.1:8000/api/works/1/ \"Authorization: Token your_access_token\"\n```\n\n### Filtering and Searching\n\n- Filtering by work type: To filter works by work type (e.g., Youtube or Instagram), use the `work_type` query parameter. Example:\n\n```bash\nhttp http://127.0.0.1:8000/api/works/?work_type=YT/ \"Authorization: Token your_access_token\"\n```\n\n- Searching by artist name: To search for works by artist name, use the `artist` query parameter. Example:\n\n```bash\nhttp http://127.0.0.1:8000/api/works/?artist=ArtistName \"Authorization: Token your_access_token\"\n```\n\n### Proper Authentication Headers\n\nFor all API endpoints that require authentication, include the access token in the headers as follows:\n\n```bash\nhttp GET http://127.0.0.1:8000/api/artists/ \"Authorization: Token your_access_token\"\n```\n\nReplace `your_access_token` with the actual access token obtained from the `/api/token/` endpoint.\n\n## Dummy Data\n\nTo test the API with some initial dummy data, log in to the Django admin interface using the superuser credentials created earlier (`/admin/`). You can then add artists and works using the admin interface.\n\n## Note\n\nThis project serves as a basic example of how to build a customized Artist API using Django REST Framework. For production environments, consider implementing additional security measures and performance optimizations.\n\n**API Testing with Postman**\n\nIf you are testing the API endpoints using Postman, please note that the Token prefix should be \"token\" instead of \"bearer.\" This is essential for successful authentication and access to protected resources.\n\n**Authentication Token Prefix:**\n\nWhen making requests that require authentication, ensure that the provided access token is prefixed with the word \"token\" as follows:\n\n```\nHeader: Authorization: Token YOUR_ACCESS_TOKEN\n```\n\n\n\n\u003cdiv style=\"width:100%;height:0;padding-bottom:100%;position:relative;\"\u003e\u003ciframe src=\"https://giphy.com/embed/m0dmKBkncVETJv2h0S\" width=\"100%\" height=\"100%\" style=\"position:absolute\" frameBorder=\"0\" class=\"giphy-embed\" allowFullScreen\u003e\u003c/iframe\u003e\u003c/div\u003e\u003cp\u003evia GIPHY\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnamdev2003%2Fartistapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevnamdev2003%2Fartistapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnamdev2003%2Fartistapi/lists"}