Skip to content

javitocor/DRF_Auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Contributors Forks Stargazers Issues Hireable

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 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

Author

👤 Javier Oriol Correas Sanchez Cuesta

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments 🚀

📝 License

This project is MIT licensed.

About

A very simple api with authorization token implementation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages