Railway Reservation System Project in Django with Source Code

The Railway Reservation System Project In Django is a web-based project which mainly focus on the reservation as well as the management of the entire flow of the railway system.

Further, the Django framework, HTML, Python, CSS, and Bootstrap were used to construct this Django Railway Reservation System project. On the backend, the Python Django Framework was used, and on the frontend, HTML, CSS, and JavaScript were used.

It is a simple railway reservation system that allows users to search for trains, book tickets, cancel tickets, check train schedules, and check PNRs, as well as add routes, stations, and trains to the system.

Project Details and Technology

This section covers the details of the project as well as the technology of the system. Railway Reservation System is the name of the project, which is written in Python Django.

The creator is SOURCECODEHERO, and the Python version used is 3.9. The database is SQLITE3, the application is a web app, and the Python version is 3.9.

Project Name:Railway Reservation System in Django
Language/s Used:Python Django
Python version (Recommended):3.9
Database:SQLlite3
Type:Web Application
Developer:SOURCECODEHERO
Updates:0

Description of Railway Reservation System

Passengers can order and cancel tickets from any of the terminals using the Railway Reservation System.

For trips that start in one part of Manila and travel for up to 72 hours and thousands of kilometers, these tickets can be purchased or canceled.

Objective of Railway Reservation System

Our project introduces a train reservation system with the goal of making it more efficient, simple, and quick.

The goal of this project is to see how computer technology can be used to help users solve their problems. We can inquire about the trains that are available.

We can change the information about a) Trains, 1) Timetable, 2) Train Name, 3) Train Number, and b) Ticket Fare, as well as reserve and cancel their seats.

This project aims to develop a Railway Reservation System that allows railway customers to manage their reservations and the railway administrator to modify the backend database in a user-friendly manner by modeling existing railway reservation systems.

Limitation of Railway Reservation System

There is no way to reserve tickets for more than 10 persons on each train using the software.

The fee for each reservation is not based on the number of kilometers traveled, but rather on the number of miles traveled. for each train’s mode (AC, Non-AC, or General).

The software is designed to allow for a maximum of 15 trains to be reserved at once. The program does not allow for multi-day reservations, which means that reservations cannot be made for more than one day.

It is not done in advance, but rather for a single day. The program does not allow for fares to be reduced for children, the elderly, or military personnel. etc., i.e., the fare is the same for everyone.

The software ignores the stations that are in between the source and destination stations.

Definition of Terms for Railway Reservation System Project in Django

  • Booking Ticket – If you want to book a ticket, enter the destination, source, and date of travel.
    If the journey date is after today, check if the journey date is after today, if it is true, then based on the Train No./Name with class, check if a passenger/passengers reservation for that day is possible, if yes, then generate a PNR No for the passenger and allow the user to enter the passenger’s name, age, gender, and whether they are a senior citizen or If a passenger is a senior citizen, give them a 5% discount and provide them a Ticket and a Payment Slip.

  • Checking PNR status – Take the user’s PNR and check if it’s valid or not to see if it’s valid. If the PNR isn’t valid, send a message to the user, or show the details of the PNR to the user, such as the name of the seat and the quota.

  • Cancelling Reservation OR Booking – Passengers must cancel their tickets at least two days prior to their scheduled departure date.

    Take the user’s PNR number and double-check that it is valid before canceling the ticket. If the PNR number isn’t legitimate, send a message to the user; if it is, show the PNR number’s data and ask if the user wishes to cancel the ticket; if so, cancel the PNR number’s reservation.

  • Checking Train Details – Take the user’s Train No. or Train Name and double-check that it’s correct for checking train details.

    If not, show the user the relevant message; if not, show the user the Train No, Train Name, Source, Destination, Time of Arrival, Time of Departure, and Day of Travel.

Major Functionalities Used in Railway Reservation System in Django

Features of Railway Reservation System in Django on the admin side:

  • Login – To gain access to the system, the administrator must first log in.
  • User – The admin can add, update, and delete user information for the user.
  • Payment Management – The admin has access to the information about the customer’s payments.
  • Manage Reservations – The admin has the ability to manage and view customer reservations.
  • Train – The admin has the ability to add, amend, and delete information about the train.
  • Station – The admin has the ability to add, amend, and delete information about the station.
  • Routes – The admin has the ability to add, update, and delete information about routes.

Features of Railway Reservation System in Django on the frontend side:

  • Register – The customer must first register in order to create an account before registering.
  • Login – After creating an account, the consumer must log in to gain access to the entire system.
  • Search Trains – The user has the option of searching all of the available trains.
  • Reservations – The consumer can make reservations for available trains.
  • Cancellation of Reservations – The customer has the option to cancel his or her reservation.

Before you begin working on a Railway Reservation System Project in Django with Source Code, make sure you are familiar with CSS, JavaScript, PHP, and Python.

Railway Reservation System in Django Steps on How to Create a Project

Time needed: 3 minutes

These are the steps to run a Railway Reservation System Project in Django

  1. pip install virtualenv

    First, You need to install the virtualenv, Open a command prompt by going to the project folder directory and typing CMD. After opening the CMD type ” pip install virtualenv “.
    install virtual env for Railway Reservation System Project in Django with Source Code

  2. virtualenv env

    Then, after installing virtualenv just type “virtualenv env” and enter. A virtual environment is a tool that creates separate Python virtual environments for distinct projects to keep their dependencies separate. Most Python programmers utilize this as one of their most significant tools.

  3. cd env/Scripts

    Next, type ” cd env/Scripts ” and press enter. It can be any script that includes data loading, processing, and cleaning, or any ML phase while developing an application when putting business logic directly in views or models isn’t always the best option.
    env for Railway Reservation System Project in Django with Source Code

  4. activate

    Next, you need to type “activate” then press enter. The virtual environment will be turned on, and you’ll see “(project-name)” next to the command prompt to identify it. You’ll have to activate the environment every time you open a new command prompt.
    activate for Railway Reservation System Project in Django with Source Code

  5. cd ../..

    Next, type ” cd ../..  ” and press enter.

    cd for Railway Reservation System Project in Django with Source Code

  6. Install Django

    Next, type the command “pip install django”. This will download and install the most recent version of Django.
    After the installation is complete, use the command prompt to check your Django installation by typing django-admin —version.
    install django for Railway Reservation System Project in Django with Source Code

  7. python manage.py makemigrations

    Next, after installing the Django type this command ” python manage.py makemigrations ” to create a table in the database.

    Makemigrations provides SQL instructions for preinstalled applications (which can be seen in installed apps in settings.py) and your newly generated apps’ model, which you may add to installed apps.

    Those commands in your database file are not executed. As a result, no tables are created after makemigrations.

  8. python manage.py migrate –run-syncdb

    Next, after making migrations type this command ” python manage.py migrate –run-syncdb ” to migrate the tables in the database.

    Initial database tables (including auth, auth group permission, Django admin log, and others) will not be generated if you don’t use syncdb before completing the migration.
    migrate for Railway Reservation System Project in Django with Source Code

  9. python manage.py createsuperuser

    After the migration of the database, you need to create a super user to login into the admin account, just you need to type the command ” python manage.py createsuperuser “.

    Using manage.py, you may establish a “superuser” account with complete access to the site and all necessary permissions.

    To create the superuser, run the following script in the same directory as manage.py. You’ll be asked to create a username, email address, and a secure password.

  10. python manage.py runserver

    Lastly, after creating a super user just type the command ” python manage.py runserver “.

    It should only be used for testing and launching your project; it should not be utilized for live website deployment.

    The runserver management command is designed for purposes other than running a web server. The development server automatically reloads Python code for each request as needed, which is ideal for local development but would add extra overhead in a production setting (source):

  11. http://127.0.0.1:8000/

    Finally, to access your project dashboard, type or copy this “http://127.0.0.1:8000/” into your browser.

    It is possible to imitate a web-server environment with localhost, and it is most commonly used to simulate web applications operating on a web server.

    The port number on which the browser communicates to the server is 8000.
    copy url for Railway Reservation System Project in Django with Source Code

Download Source Code Here!

Conclusion

Almost all manual systems have been replaced by automated and computerized systems in the new age of computers.

As a result, we’re working on “Railway Reservation System” software to simulate the current system and eliminate its flaws.

Inquiries

If you have any questions or suggestions about the Railway Reservation System in Django with Source Code, please feel free to leave a comment below.

Leave a Comment