railway backend
1.0.0
git clone https://github.com/mugdha273/railway-backend.git
cd railway-backend
virtualenv venv
venv/Scripts/activate
source venv/bin/activate
deactivate
Después de crear el entorno virtual
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
Solicitud de Curl: (Escriba su nombre de usuario registrado y contraseña en el cuerpo)
curl --location --request POST 'http://127.0.0.1:8000/api/token/'
--header 'Content-Type: application/json'
--header 'Cookie: csrftoken=62KjlMixjCOIaieXB4eUNjQidMxmzhsxHmcrjhXZpaPlzMvZb4EhCqdOQNg5t8wx'
--data-raw '{
"username": "<username>",
"password": "<password>"
}'
curl --location --request POST 'http://127.0.0.1:8000/api/users/register/'
--header 'Content-Type: application/json'
--header 'Cookie: csrftoken=62KjlMixjCOIaieXB4eUNjQidMxmzhsxHmcrjhXZpaPlzMvZb4EhCqdOQNg5t8wx'
--data-raw '{
"first_name": "Mugdha",
"last_name": "Sharma" ,
"email": "[email protected]",
"phone_number": "9174400406",
"date_of_birth": "2002-03-27",
"password": "demopass",
"password2": "demopass",
"occupation": "student",
"gender": "female",
"city": "Indore" ,
"state": "MP" ,
"pincode": "452018"
}'
curl --location --request POST 'https://railway-backend.herokuapp.com/api/users/login/'
--header 'Content-Type: application/json'
--data-raw '{
"email": "[email protected]",
"password": "demopass"
}'
Trenes: https://railway-backend.herokuapp.com/api/train/trains/
Ruta: https://railway-backend.herokuapp.com/api/train/route/
Estado del tren: https://railway-backend.herokuapp.com/api/train/train_status/
Estaciones: https://railway-backend.herokuapp.com/api/train/station/
Estación de ruta: https://railway-backend.herokuapp.com/api/train/route-station/
Reserva de billetes: https://railway-backend.herokuapp.com/api/booking/book/
curl --location --request POST 'http://127.0.0.1:8000/api/booking/book/'
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY4NDg2MDk4LCJpYXQiOjE2NTEyMDYwOTgsImp0aSI6IjQ4M2RiZWM5ZTdiYjRkODY4NzY5YTliNTNhZTg0M2IxIiwidXNlcl9pZCI6M30.9Um4LKWwSV4Iki4sz_mO9f_tuZ7t7l7e4X7ref6HuVU'
--header 'Content-Type: application/json'
--header 'Cookie: csrftoken=62KjlMixjCOIaieXB4eUNjQidMxmzhsxHmcrjhXZpaPlzMvZb4EhCqdOQNg5t8wx'
--data-raw '{
"train_class": "2 AC",
"date_of_journey": "2022-05-20",
"account": 1,
"train": 4,
"route": 6
}'
curl --location --request GET 'https://railway-backend.herokuapp.com/api/booking/passenger'
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY4MDc3Njg2LCJpYXQiOjE2NTA3OTc2ODYsImp0aSI6IjVhOTZiZjMwZDA4NDRiODk4MjFhYmMyMDM3M2YwNDdkIiwidXNlcl9pZCI6Mn0.jFPzjS7yOECSJhlU3jQagWN7i7FT7Ti7LKBUhb06i8A'
--data-raw ''