Skip to content

bahiamartins/DjangorestAPI

Repository files navigation

DEV-IMPACT-01-DRF

Exemplo de API feita em Django Rest Framework.

Como rodar o projeto?

  • Clone esse repositório.
  • Crie um virtualenv com Python 3.
  • Ative o virtualenv.
  • Instale as dependências.
  • Rode as migrações.
git clone https://github.com/jobconvo/DEV-IMPACT-01-DRF.git dev-impact-01-drf
cd dev-impact-01-drf
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python contrib/env_gen.py
python manage.py migrate
python manage.py createsuperuser --username="admin" --email=""

No Admin crie seu Token. Ou pelo terminal:

python manage.py drf_create_token admin

Swagger

http://localhost:8000/swagger/

Postman

GET: http://localhost:8000/api/users/1/

Headers > key: Authorization , value: 'Token <seu_token>'

POST: http://localhost:8000/api/users/

Body > raw > JSON

{
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "password": "string"
}

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published