{"id":21094422,"url":"https://github.com/domicoder/django-pastebin-api","last_synced_at":"2025-07-20T20:05:18.622Z","repository":{"id":233832228,"uuid":"787877016","full_name":"domicoder/django-pastebin-api","owner":"domicoder","description":"⚡️Simple Pastebin code highlighting Web API Django 5 + PostgreSQL + Heroku","archived":false,"fork":false,"pushed_at":"2024-04-17T16:26:22.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T20:04:49.206Z","etag":null,"topics":[],"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/domicoder.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":"2024-04-17T10:58:09.000Z","updated_at":"2024-04-30T04:25:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"5832f17b-9d0d-4641-b5a4-81c449ceab47","html_url":"https://github.com/domicoder/django-pastebin-api","commit_stats":null,"previous_names":["domicoder/django-pastebin-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/domicoder/django-pastebin-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domicoder%2Fdjango-pastebin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domicoder%2Fdjango-pastebin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domicoder%2Fdjango-pastebin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domicoder%2Fdjango-pastebin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domicoder","download_url":"https://codeload.github.com/domicoder/django-pastebin-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domicoder%2Fdjango-pastebin-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266189676,"owners_count":23890065,"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-11-19T22:17:28.448Z","updated_at":"2025-07-20T20:05:18.602Z","avatar_url":"https://github.com/domicoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Init API for this project\n\n`$ make clean`\n\n`$ make migrations`\n\n`$ make migrations-snippets`\n\n`$ make migrate`\n\n`$ make superuser`\n\n`$ make run`\n\n# Migrate command\n\n```\nmake migrate\n```\n\n# migrations command\n\n```\nmake migrations\n```\n\nor (`snippets` is an app for this project)\n\n```\nmake migrations-snippets\n```\n\n## Create superuser\n\n```\nmake superuser\n```\n\n# If you already setup project, run\n\n```\nmake run\n```\n\n## Testing our API (with CURL command-line)\n\n```\n~$ curl -u admin -H 'Accept: application/json; indent=4' http://127.0.0.1:8000/users/\n```\n\n# if you have migrations in snippets module\n\n## migrations snippets\n\n```\nmake migrations-snippets\n```\n\n`for future update Makefile`\n\n```\nmake migrations MIGRATION_NAME=snippets\n```\n\n## migrate snippets\n\n```\nmake migrate-snippets\n```\n\n```\nmake migrate MIGRATION_NAME=snippets\n```\n\n# Using HTTPIE\n\nGet a list of snippets\n\n```\nhttp http://127.0.0.1:8000/snippets/\n```\n\nGet a snippet with `id` = 2\n\n```\nhttp http://127.0.0.1:8000/snippets/2/\n```\n\nIf we try to create a snippet without authenticating, we'll get an error:\n\n```\nhttp POST http://127.0.0.1:8000/snippets/ code=\"print(123)\"\n\n{\n    \"detail\": \"Authentication credentials were not provided.\"\n}\n```\n\nWe can make a successful request by including the correct username and password:\n\n```\nhttp -a admin:root POST http://127.0.0.1:8000/snippets/ code=\"print(789)\"\n\n{\n    \"id\": 1,\n    \"owner\": \"admin\",\n    \"title\": \"foo\",\n    \"code\": \"print(789)\",\n    \"linenos\": false,\n    \"language\": \"python\",\n    \"style\": \"friendly\"\n}\n```\n\n# Postgres DB\n\nCreate DB\n\n```\npsql -U postgres\n```\n\n```\nCREATE DATABASE pastebinapi_db;\n```\n\n```\nCREATE USER admin WITH PASSWORD 'SXCiKvMy8#4\u0026*W\u0026nNT5kGX\u0026Q2EmUKmx#nu6rDT$djdD4dHfPmnW6JFXx8dqTKhPoVfa7ZZnLmNViC4kp34UpCYg2*@YXEnqB84##fDFxmVG';\n```\n\n```\nGRANT ALL PRIVILEGES ON DATABASE pastebinapi_db TO admin;\n```\n\n# API Documentation\n\nHere the [Swagger Documentation](http://127.0.0.1:8000/api/doc/swagger/)\n\nHere the [Redoc Documentation](http://127.0.0.1:8000/api/doc/redoc/)\n\n# Deployment Essentials to Heroku\n\nRequirements.txt: Create a file listing all your dependencies:\n\n```\npip freeze \u003e requirements.txt\n```\n\nCreate a Procfile in your project root and add:\n\n```\nweb: gunicorn PastebinAPI.wsgi --log-file -\n```\n\nRuntime.txt (Optional): Specify your Python version:\n\n```\npython-3.10.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomicoder%2Fdjango-pastebin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomicoder%2Fdjango-pastebin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomicoder%2Fdjango-pastebin-api/lists"}