Backend for Bus booking system in Django
- clone the project
git clone https://github.com/aarushverma96/Bus_BTP.git
- cd to the project directory
cd Bus_BTP
and create virtual environmentvirtualenv venv
- activate virtual environment
. venv/bin/activate
cd btp
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
- To use admin create super user
python manage.py createsuperuser
-
Accessing Bus Information
127.0.0.1:8000/jbuses/<source>/<destination>
Exampleshttp://127.0.0.1:8000/JP/DLE
-
Acessing status information
http://127.0.0.1:8000/jstaus/<busID>
Examplehttp://127.0.0.1:8000/123
-
PUT request view name: test
url : http://127.0.0.1:8000/test/<bus_id>
- Search Functionality
127.0.0.1:8000/search/
- Then follow the flow of application.
- Models.py change in line #21 -- values are stored in CSV format
- Views.py changes in function booking -- starting line# 61
- To book enter seats in CSV format in
booking/<busid>
url
- PUT request
- URL format
127.0.0.1:8000/delete/<busid>
- Data format
{ 'bus_id': 123 'seats': '1,2,3,4' }
- Function will return seat updated seat stucture
- Hit url
127.0.0.1:8000/mail
- Views.py Mail function form line #106
- Views.py delete function form line #122
- Urls.py changes in line #14 and 15
- 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
- use email and password of your gmail account (account form which you want to send mail)