{"id":19253229,"url":"https://github.com/hansalozu/drf-blog-api","last_synced_at":"2026-04-29T21:06:00.741Z","repository":{"id":191897610,"uuid":"364256774","full_name":"HanSaloZu/drf-blog-api","owner":"HanSaloZu","description":"Blog service API developed using Django REST framework(DRF)","archived":false,"fork":false,"pushed_at":"2021-12-08T10:16:47.000Z","size":451,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T17:12:34.298Z","etag":null,"topics":["backend","django","django-rest-framework","djangorestframework","docker","docker-compose","python","python3"],"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/HanSaloZu.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}},"created_at":"2021-05-04T12:58:38.000Z","updated_at":"2021-12-08T10:16:56.000Z","dependencies_parsed_at":"2023-09-01T12:21:09.842Z","dependency_job_id":null,"html_url":"https://github.com/HanSaloZu/drf-blog-api","commit_stats":null,"previous_names":["hansalozu/drf-blog-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HanSaloZu/drf-blog-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSaloZu%2Fdrf-blog-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSaloZu%2Fdrf-blog-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSaloZu%2Fdrf-blog-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSaloZu%2Fdrf-blog-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HanSaloZu","download_url":"https://codeload.github.com/HanSaloZu/drf-blog-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSaloZu%2Fdrf-blog-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","django","django-rest-framework","djangorestframework","docker","docker-compose","python","python3"],"created_at":"2024-11-09T18:29:51.836Z","updated_at":"2026-04-29T21:06:00.714Z","avatar_url":"https://github.com/HanSaloZu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DRF Blog API\n\nThis is a blogging service API developed using Python/Django/Django Rest Framework(DRF)\n\n## Overview\n\nThis service provides basic blogging functionality such as posts, likes, and followers.\nBut all of these functions are only available after authentication, so this API implements registration with email confirmation as well as login/logout.\nAlso, each user has his own profile, which he can edit, for example, add contacts(links to social networks), change avatar, change status, etc.\n\n## Other\n\nIn this project, I am using the Google Drive API to save user avatar images. I did this in order to be able to run a\nproject on a hosting with an ephemeral file system. Thus, you can also run this code on a hosting with an ephemeral filesystem without\nworrying about files integrity.\n\n## How to use\n\n1. Clone this repository\n2. Create a folder named \"media\" in the root folder of the project\n3. Create a .env file with the following content\n\n```env\n# Common Django settings\nSECRET_KEY=\"\" # You can enter any random string here(this is used to provide cryptographic signing)\nDEBUG=1 # 1-True, 0-False\nALLOWED_HOSTS=\"localhost 127.0.0.1 [::1]\"\n\n# CORS configuration\n# front-end server address(address from which requests will be sent to the api server)\nCORS_ALLOWED_ORIGINS=\"localhost:3000 [::1]\"\nCORS_ORIGIN_WHITELIST=\"localhost:3000 [::1]\"\n\n# JWT\nSIGNING_KEY=\"\" # This key is used to provide cryptographic signatures for JWT tokens(any random string)\n\n# Send mail server configuration\nEMAIL_HOST=\"\" # mail server address(e.g smtp.gmail.com)\nEMAIL_HOST_USER=\"\" # mail server account(e.g example@gmail.com)\nEMAIL_HOST_PASSWORD=\"\" # mail server password\nEMAIL_USE_TLS=1 # whether to use TLS encryption connection(1-True, 0-False)\nEMAIL_PORT= # mail server port\n\n# Database configuration\n# If you will be using docker to start the server use this configuration\nDB_ENGINE=\"django.db.backends.postgresql\" # engine\nDB_DATABASE=\"django_drf_dev_db\" # database name used in the database\nDB_USER=\"django_drf_dev\" # database user name\nDB_PASSWORD=\"django_drf_dev\" # database password\nDB_HOST=\"db\" # database address\nDB_PORT=5432 # database access port\n```\n\n4. Then you need to set up Google Drive\n5. Install python, pip and pipenv if you haven't already\n6. Create a virtual environment using the following command\n\n```bash\n\u003e pipenv shell\n```\n\n7. Install all dependencies\n\n```bash\n\u003e pipenv install\n```\n\n8. Enter the following command to run the migrations\n\n```bash\n\u003e pipenv run python manage.py migrate\n```\n\n9. Create a superuser if you need one\n\n```bash\n\u003e pipenv run python manage.py createsuperuser\n```\n\nThen start the server\n\n```bash\n\u003e pipenv run python manage.py runserver\n```\n\nAfter starting the development server, the provided interface is located at http://localhost:8000/api/v1, the admin panel address is http://localhost:8000/admin\n\n### Setting up Google Drive\n\n1. Create new project on [Google Cloud Platform](https://cloud.google.com/)\n2. Enable [Google Drive API](https://console.cloud.google.com/apis/library/drive.googleapis.com) for this project\n3. Create credentials of type \"service account\"\n4. Create a new private key with JSON key type and download it\n5. Rename the key file to \"google_drive_api.json\" and move it to the config/ folder\n\n## Docker\n\nIf you want to start the server in docker follow these steps\n\n1. Complete steps 1-4 from \"How to Use\"\n2. Install docker and docker-compose if you haven't already\n3. Build a new image and spin up two containers(django server and postgres)\n\n```bash\n\u003e docker-compose up -d --build\n```\n\n4. Run the migrations using the following command\n\n```bash\n\u003e docker-compose exec web python manage.py migrate\n```\n\n5. Create a superuser if you need one\n\n```bash\n\u003e docker-compose exec web python manage.py createsuperuser\n```\n\nThe provided interface is located at http://localhost:8000/api/v1, the admin panel address is http://localhost:8000/admin\n\n## Tests\n\nTo run tests, enter the following command\n\n```bash\n\u003e pipenv run python manage.py test\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalozu%2Fdrf-blog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansalozu%2Fdrf-blog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalozu%2Fdrf-blog-api/lists"}