Yiqing Huang 001525629 [email protected] ddm
- Linux, macOS, Windows
- Python 3.6-3.8
pip install django djangorestframework bcrypt mysqlclient
python manage.py runserver
python manage.py test
Please refer to the API documentation.
For the authenticated APIs, the application only supports Token-Based authentication. Since at the current stage, the authentication for a user can only be obtained manually. The following instructions tell how to get a token.
-
Open Django Shell
python manage.py shell
-
Enter the code line by line
>>>from django.contrib.auth import get_user_model >>>from rest_framework.authtoken.models import Token >>>User = get_user_model() <QuerySet [<User: admin>, <User: jane.doe@example.com>]> >>>token = Token.objects.create(user=User.objects.all()[1]) # Choose the one you want to create auth >>>token.key xxxxxxxx (your token)