https://github.com/javitocor/drf_auth
A very simple api with authorization token implementation.
https://github.com/javitocor/drf_auth
django django-rest-framework httpie token-based-authentication
Last synced: about 2 months ago
JSON representation
A very simple api with authorization token implementation.
- Host: GitHub
- URL: https://github.com/javitocor/drf_auth
- Owner: javitocor
- License: mit
- Created: 2021-09-14T13:00:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-14T13:08:04.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T09:23:52.511Z (over 1 year ago)
- Topics: django, django-rest-framework, httpie, token-based-authentication
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]

# Django Rest Framework Auth Token
> A very simple api with authorization token implementation.
Additional description about the project and its features.
## Built With
- DJANGO
- DJANGO REST FRAMEWORK
- HTTPie
- GITHUB ACTIONS
- VSCODE
## Getting Started
### Usage
To have this app on your pc, you need to:
* [download](https://github.com/javitocor/DRF_Auth/archive/main.zip) 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:
``` bash
py -m venv project-name
project-name\Scripts\activate.bat
```
Run migrations:
``` bash
py manage.py migrate
```
Run server:
``` bash
py manage.py runserver
```
Create a superuser in the command line by typing:
``` bash
python manage.py createsuperuser --username example --email example@example.com
```
Request you token with by sending a post request (with HTTPie):
``` bash
command line: python manage.py drf_create_token
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:
``` bash
http http://127.0.0.1:8000/hello/ 'Authorization: Token '
```
You can access the page by typing in your web browser and login with your superuser credentials
``` bash
http://127.0.0.1:8000/hello
```
## Author
👤 Javier Oriol Correas Sanchez Cuesta
- Github: [@javitocor](https://github.com/javitocor)
- Twitter: [@JavierCorreas4](https://twitter.com/JavierCorreas4)
- Linkedin: [Javier Oriol Correas Sanchez Cuesta](https://www.linkedin.com/in/javier-correas-sanchez-cuesta-15289482/)
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check the [issues page](https://github.com/javitocor/DRF_Auth/issues).
## Show your support
Give a ⭐️ if you like this project!
## Acknowledgments 🚀
- [Django Docs](https://docs.djangoproject.com/en/3.2/)
- [Django Rest Framework Docs](https://www.django-rest-framework.org/)
## 📝 License
This project is [MIT](lic.url) licensed.
[contributors-shield]: https://img.shields.io/github/contributors/javitocor/DRF_Auth.svg?style=flat-square
[contributors-url]: https://github.com/javitocor/DRF_Auth/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/javitocor/DRF_Auth.svg?style=flat-square
[forks-url]: https://github.com/javitocor/DRF_Auth/network/members
[stars-shield]: https://img.shields.io/github/stars/javitocor/DRF_Auth.svg?style=flat-square
[stars-url]: https://github.com/javitocor/DRF_Auth/stargazers
[issues-shield]: https://img.shields.io/github/issues/javitocor/DRF_Auth.svg?style=flat-square
[issues-url]: https://github.com/javitocor/DRF_Auth/issuesover: