A very simple api with authorization token implementation.
Additional description about the project and its features.
- DJANGO
- DJANGO REST FRAMEWORK
- HTTPie
- GITHUB ACTIONS
- VSCODE
To have this app on your pc, you need to:
-
download or clone this repo:
- Clone with SSH:
git@github.com:javitocor/DRF_Auth.git
- Clone with HTTPS
https://github.com/javitocor/DRF_Auth.git
-
In the project directory, you can run:
Create virtual enviroment with:
py -m venv project-name
project-name\Scripts\activate.bat
Run migrations:
py manage.py migrate
Run server:
py manage.py runserver
Create a superuser in the command line by typing:
python manage.py createsuperuser --username example --email example@example.com
Request you token with by sending a post request (with HTTPie):
command line: python manage.py drf_create_token <name_superuser>
httpie: http post http://127.0.0.1:8000/api-token-auth/ username=example password=123
Make a get request (with HTTPie) to get the info:
http http://127.0.0.1:8000/hello/ 'Authorization: Token <token_received_in_previous_step>'
You can access the page by typing in your web browser and login with your superuser credentials
http://127.0.0.1:8000/hello
👤 Javier Oriol Correas Sanchez Cuesta
- Github: @javitocor
- Twitter: @JavierCorreas4
- Linkedin: Javier Oriol Correas Sanchez Cuesta
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.