git clone https://github.com/juniozguedes/django_twitter.git
pip install -r requirements.txt
python manage.py makemigrations users
python manage.py makemigrations tweets
python manage.py migrate
Na pasta frontend:
npm install
npm start
Na pasta raíz:
python manage.py runserver
rota base: http://localhost:8000/
- Autenticação de usuário e retorno do Token:
Method | URI | body |
---|---|---|
GET | twitter/signin |
username, password |
- Body ex.:
{
"username": "jehnsen",
"password": "123456"
}
Method | URI | body |
---|---|---|
POST | twitter/signup |
username, password |
- Body ex.:
{
"username": "jehnsen",
"password": "123456"
}
Method | URI | body |
---|---|---|
GET | twitter/follow |
following |
- Body ex.:
{
"following": "1"
}
Method | URI | Headers |
---|---|---|
GET | api/v1 |
Authorization |
- Header ex.:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
Method | URI | Params | Ex.: |
---|---|---|---|
GET | api/v1/{{id}} |
id | api/v1/3 |
Method | URI | Body | Headers |
---|---|---|---|
POST | api/v1/ |
content | token |
- Header ex.:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
- Body ex.:
{
"content" : "I'm tweeting! Asbaba"
}
Method | URI | Params | Headers | Ex.: |
---|---|---|---|---|
DELETE | api/v1/{{id}} |
id | token | api/v1/2 |
- Header ex.:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
Method | URI | Params | Ex.: |
---|---|---|---|
GET | api/v1/{{username}}/tweets |
username | api/v1/jehnsen/tweets |
Method | URI | Body | Headers |
---|---|---|---|
POST | user/follow |
following | token |
- Header ex.:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
- Body ex.:
"following": "2"
Method | URI | Headers |
---|---|---|
GET | api/v1/timeline |
token |
- Header ex:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
Method | URI | Params | Ex.: |
---|---|---|---|
GET | api/v1/{{id}}/favorites |
id | api/v1/2/favorites |
*Header ex:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'
Method | URI | Params | Headers | Ex |
---|---|---|---|---|
POST | api/v1/{{id}}/favorites |
id | token | http://localhost:8000/api/v1/1/favorites |
*Header ex:
Authorization: Token {token}
ex.: 'Token 0a46fa5cf570f194a692007d3e642bceb31b7985'