Skip to content

aarushverma96/Bus_BTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Bus_BTP

Backend for Bus booking system in Django

Installation

  1. clone the project git clone https://github.com/aarushverma96/Bus_BTP.git
  2. cd to the project directory cd Bus_BTP and create virtual environment virtualenv venv
  3. activate virtual environment . venv/bin/activate cd btp
  4. pip install -r requirements.txt
  5. python manage.py makemigrations
  6. python manage.py migrate
  7. python manage.py runserver
  8. To use admin create super user python manage.py createsuperuser

REST API

  1. Accessing Bus Information 127.0.0.1:8000/jbuses/<source>/<destination>
    Examples http://127.0.0.1:8000/JP/DLE

  2. Acessing status information http://127.0.0.1:8000/jstaus/<busID>
    Example http://127.0.0.1:8000/123

  3. PUT request view name: test url : http://127.0.0.1:8000/test/<bus_id>

Application

  1. Search Functionality 127.0.0.1:8000/search/
  2. Then follow the flow of application.

Seat Structure changes

  1. Models.py change in line #21 -- values are stored in CSV format
  2. Views.py changes in function booking -- starting line# 61
  3. To book enter seats in CSV format in booking/<busid> url

Delete Reserved seats

  1. PUT request
  2. URL format 127.0.0.1:8000/delete/<busid>
  3. Data format
    { 'bus_id': 123 'seats': '1,2,3,4' }
  4. Function will return seat updated seat stucture

Send Mail

  1. Hit url 127.0.0.1:8000/mail

Changes

  1. Views.py Mail function form line #106
  2. Views.py delete function form line #122
  3. Urls.py changes in line #14 and 15
  4. changes in settings.py EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'aarushverma96@gmail.com' EMAIL_HOST_PASSWORD = 'password' EMAIL_PORT = 587
  5. use email and password of your gmail account (account form which you want to send mail)

About

Backend for Bus booking system in Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published