Setup:
- python -m venv
a) UNIX: source /bin/activate
b) Windows: \Scripts\Activate.bat (oder so ähnlich)
- pip install -r requirements.txt
- python manage.py runserver (und ggf. noch die Adresse, z.B. 127.0.0.1:1234)
"Production"-Server (sofern man das so nennen kann): -> http://s40kcwoowcwo8ogk4w0kwk8k.85.215.173.212.sslip.io
Zum Authentication-Verfahren:
-
Nutzer registrieren curl
-X POST
-H "Content-Type: application/json"
-d '{"username": "testuser5", "email": "testmail@abc.com", "first_name": "Max", "last_name": "Mustermann", "password": "user1234"}'
http://localhost:8000/register -
Login: Tokens anfordern:
curl
-X POST
-H "Content-Type: application/json"
-d '{"username": "testuser", "password": "user1234"}'
http://localhost:8000/api/token/
- Tokens nutzen (im Header)
curl
-X GET
-H "Content-Type: application/json"
-H 'Authorization: Bearer [hier access token einfügen]'
http://localhost:8000/amiauth