{"id":20904933,"url":"https://github.com/davipythonweb/books_api__","last_synced_at":"2026-04-29T23:32:28.286Z","repository":{"id":248200539,"uuid":"828051215","full_name":"davipythonweb/books_api__","owner":"davipythonweb","description":"Api com Django-Rest-Framework para e-books ","archived":false,"fork":false,"pushed_at":"2024-09-29T15:07:02.000Z","size":44,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T07:29:57.383Z","etag":null,"topics":["django","django-rest-framework","postgresql","pytest","pytest-watch","pythnon","python-dotenv"],"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/davipythonweb.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":"2024-07-13T01:46:30.000Z","updated_at":"2024-09-29T15:07:06.000Z","dependencies_parsed_at":"2024-11-18T13:23:58.352Z","dependency_job_id":"27876991-d81c-4c57-b38c-1525591d8cfe","html_url":"https://github.com/davipythonweb/books_api__","commit_stats":null,"previous_names":["davipythonweb/books_api__"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davipythonweb/books_api__","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipythonweb%2Fbooks_api__","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipythonweb%2Fbooks_api__/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipythonweb%2Fbooks_api__/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipythonweb%2Fbooks_api__/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davipythonweb","download_url":"https://codeload.github.com/davipythonweb/books_api__/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davipythonweb%2Fbooks_api__/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"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":["django","django-rest-framework","postgresql","pytest","pytest-watch","pythnon","python-dotenv"],"created_at":"2024-11-18T13:19:49.251Z","updated_at":"2026-04-29T23:32:28.269Z","avatar_url":"https://github.com/davipythonweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# books_api__\r\n\r\n* Api com Django-Rest-Framework para e-books \r\n\r\n\u003csummary\u003ee-books_api\u003c/summary\u003e\r\n\r\n\r\n\u003cdetails\u003e\r\n\r\n`ìnicial`\r\n\r\n- CRUD de e-books\r\n`django_restframework`\r\n`permissoes admin -\u003e all`\r\n`permissoes user -\u003e safe_methods= GET, HEAD, OPTIONS`\r\n\r\n\r\n- Autenticação\r\n`djangorestframework-simplejwt`\r\n\r\n- comandos Django/bash\r\n`django-admin startproject core .`\r\n`python manage.py migrate`\r\n`python manage.py createsuperuser`\r\n`python manage.py runserver`\r\n`python manage.py startapp \u003cnome_do_app\u003e`\r\n`python mange.py makemigrations`\r\n\r\n- adm controller\r\n`admsuper`\r\n`Adm$50001`\r\n\r\n- user_teste\r\n`user-test`\r\n`book@reading23`\r\n\r\n\u003c/details\u003e\r\n\r\n## pytest\r\n\r\n`pip install pytest pytest-django`\r\n`pip install pytest-watch`\r\n\r\n### usage\r\n\r\n- executar scripts powershell\r\n\r\n`set-executionpolicy unrestricted`\r\n\r\n-runing pytest- rodar no terminal =\u003e pytest\r\n\r\n- para ver tudo =\u003e pytest -rP\r\n\r\n- runing unitest- para o test_django =\u003e python manage.py test\r\n- com lib pytest-watch =\u003e ptw\r\n\r\n#### Database\r\n`postgresql`\r\n\r\n##### lib para conexao\r\n`pip install psycopg2`\r\n\r\n- acessar o postgres pelo powershell\r\n`psql -U postgres`\r\n\r\n- ver versao do postgres pelo powershell\r\n`psql --version`\r\n\r\n- listar todas as tabelas do postgres\r\n`\\l`\r\n\r\n- criar database no shell com comando SQL\r\n`CREATE DATABASE bookstore;`\r\n\r\n\r\n- urls para abreviações de paises\r\n`https://www.pucsp.br/~acomin/recursos/codpais.html`\r\n\r\n#### usage in postman\r\n\r\n- via GET\r\n\r\n`1) gerar um access-token para o usuario no endpoint:localhost/api/v1/authentication/token/ passando no body:  {\"username\": \"\", \"password\": \"\"}`\r\n\r\n`2) usar o authorization Bearer token e colocar o access-token gerado com o usuario  cadastrado. exemplo de endpoint: localhost/api/v1/genres .Use o method POST para o request. OBS:authorizations para usuario normal=\u003e GET,HEAD,OPTIONS`\r\n\r\n`3) para gerar um novo access-token =\u003e acesse rota /api/authentication/token/refresh/ passando no body: {\"refresh\": \"\u003cyour refresh token\u003e\"}`\r\n\r\n- via POST\r\n\r\n`4) para requests: POST,PUT,PATCH,DELETE fazer o mesmo processo , mas com um usuario admin.`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavipythonweb%2Fbooks_api__","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavipythonweb%2Fbooks_api__","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavipythonweb%2Fbooks_api__/lists"}