- Clone o repositório.
- Crie um virtualenv com Python 3.6
- Ative o virtualenv.
- Instale as dependências.
- Configure a instância com o .env
- Execute os testes.
git clone git@github.com:adrianomargarin/django-rest-framework-authentication.git
cd django-rest-framework-authentication
virtualenv env --python=python3
source env/bin/activate
pip install -r requirements_dev.txt
cp contrib/env-sample .env
python manage.py test
- Crie uma instância no heroku.
- Envie as configurações para o heroku.
- Define um SECRET_KEY segura para instância.
- Defina DEBUG=True
- Configure o serviço de email.
- Envie o código para o heroku.
heroku create minhainstancia
heroku config:push
heroku config:set SECRET_KEY=`python contrib/secret_gen.py`
heroku config:set DEBUG=False
git push heroku master --force
POST https://drf-authentication.herokuapp.com/login/
headers:
"Content-Type": "application/json"
body:
{
"username": "teste",
"password": "asdf1234"
}
response:
{
"token": "token-gerado"
}
Com o token gerado, faça o próximo passo:
GET https://drf-authentication.herokuapp.com/user/
headers:
"Content-Type": "application/json"
"Authorization": "Basic token-gerado-em-base64:"
response:
{
"username": "adrianomargarin",
"first_name": "",
"last_name": ""
}