Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

studentTest

This API was created to make two POST type requests

  • '/login/' : returns a token if the user exists
  • '/answer/' : records user responses

Clone the repository

https://github.com/Danielmc09/studentTest.git

Create virtual env and activate

create:
  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.bat

Install libraries

pip install -r requirements.txt

Run proyect

python manage.py runserver

Create migrations

- python manage.py makemigration
- python manage.py migrate

Create super user

- To create test data, you can create a super user and via django admin register some data

- python .\manage.py createsuperuser

Run Test

Inside 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

General notes

  • 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

studentTest test online

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

Data to take into account

- 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages