This API was created to make two POST type requests
- '/login/' : returns a token if the user exists
- '/answer/' : records user responses
https://github.com/Danielmc09/studentTest.gitcreate:
virtualenv name_env
activate:
On Unix or MacOS, using the bash shell: source venv/bin/activate
On Windows using the Command Prompt: path\venv\Scripts\activate.batpip install -r requirements.txtpython manage.py runserver- python manage.py makemigration
- python manage.py migrate- python .\manage.py createsuperuserInside the project at the manage.py file run the following commands
- coverage run --source='studentTest' manage.py test
- coverage html
the first command runs the Tests declared in the tests file, the second command displays the coverage-
The database used in this project is sqlite3
-
Ports to use that should not be busy or with local services turned off:
- Django: 8000
| Path | Verb |
|---|---|
| Local | |
| http://localhost:8000/admin/ | |
| http://localhost:8000/login/ | POST |
| http://localhost:8000/answer/ | POST |
| Collection POSTMAN locally | |
| COLLECTION POSTMAN |
| Path | Verb |
|---|---|
| Deploy railway | |
| https://studenttest-production-6a84.up.railway.app/admin/ | POST |
| https://studenttest-production-6a84.up.railway.app/login/ | POST |
| https://studenttest-production-6a84.up.railway.app/answer/ | POST |
| Collection POSTMAN online | |
| COLLECTION POSTMAN |
- user: admin
- pass: admin123
the postman collection has an example with a user already created in the database and some questions
Autor: Angel Daniel Menideta Castillo © 2023
