Skip to content

Travel Agency website built using Django, designed for browsing and booking of travel packages.

Notifications You must be signed in to change notification settings

ahlem-phantom/django-travel-agency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation



Django Travel Agency

This is the official Django Travel Agency documentation

πŸ“ Project Description

This project involves developing a web application for a travel agency using Django. The app will provide users with the ability to browse, book, and pay for various travel packages. Additionally, the application will send email confirmations, generate PDF invoices, and offer customer support through an integrated chatbot. Key features of the application include:

  1. User Booking & Payment: Users can browse different travel packages, view details, and book their trips through the platform. Payment integration will allow users to pay securely for their bookings.
  2. Email Confirmation: Upon completing a booking, the system will asynchronously send an email confirmation to the user, leveraging Celery with RabbitMQ as the message broker.
  3. PDF Invoice Generation: After booking, the system will generate and send a PDF invoice to the user’s email. This will be done using WeasyPrint library to dynamically generate invoices based on booking details.
  4. Travel News Scraping: The app will scrape travel news websites using BeautifulSoup tool to gather the latest news and tips. These articles will be stored in the app’s database for easy access by users.
  5. Personalized Recommendations: The system will analyze user preferences and feedback, and provide personalized recommendations for packages, activities, or destinations using libraries such as NumPy or SciPy for calculations.

(back to top)

πŸš€ Built With

This project was built using Django. You may find below the list of the frameworks/libraries that I used to build this project :

  1. Django (Web Framework)
  2. Celery (Asynchronous Task Management)
  3. RabbitMQ (Message Broker)
  4. SQLite (Database)
  5. BeautifulSoup (Web Scraping)
  6. WeasyPrint (PDF Generation)
  7. NumPy (Data Processing)

(back to top)

✨ Getting Started

To get a local copy up and running follow these simple example steps.

🚧 Prerequisites

You may find below the list of things you need to use this project :

  • Python installed on your system.
  • RabbitMQ installed and running.
  • GTK3 installed to enable WeasyPrint to work properly (for generating PDF files).

πŸ›  Installation

In order to install the app you need to follow the instructions below :

  1. Clone the repo
    git clone https://github.com/ahlem-phantom/django-travel-agency.git

Project backend :

  1. Create a virtual environement and activate it
    ($) python3 -m venv venv
    ($) .\venv\Scripts\activate.bat
  2. Install flask dependecies using the file "requirements.txt"
    pip install -r requirements.txt
  3. Rename the file .env_template and fill it with your flouci api credentials with your email settings
  FLOUCI_APP_TOKEN=your-app-token-here
  FLOUCI_APP_SECRET=your-app-secret-here
  EMAIL_HOST_USER = 'your-mail-address-here'
  EMAIL_HOST_PASSWORD = 'your-mail-password-her'
  DEFAULT_FROM_EMAIL = 'your-mail-address-here'
  1. Run Django Migrations

    python manage.py makemigrations
    python manage.py migrate
    python manage.py migrate django_celery_results
  2. Create a Superuser Account for Admin Access

    python manage.py createsuperuser

You'll be prompted to enter a username, email, and password for the admin account. After the superuser is created, you'll be able to log in to the Django admin dashboard.

  1. Run the django server

    python manage.py runserver
  2. Open localhost:8000 to enjoy the app.

Celery Setup :

  1. Start RabbitMQ (ensure RabbitMQ is installed and running)
    rabbitmq-server 
  2. Enable RabbitMQ Management Plugin:
rabbitmq-plugins enable rabbitmq_management

This will enable the web interface at http://localhost:15672. You can log in using the default credentials (guest as both the username and password).

  1. Start the Celery worker
celery -A django_travel_agency worker --loglevel=info

Storage of Celery Task Results in the database

RabbitMQ

(back to top)

⚑ Usage

  • Browse Packages: Navigate to the homepage to view all available travel packages.
  • Book a Trip: Select a package, provide your details, and complete the payment process.
  • Receive Confirmation: Check your email for the booking confirmation and attached PDF invoice.
  • Get Recommendations: Get top rated travel recommendations.

Start by exploring the available travel packages and choose the one that suits your preferences.


Browse Packages

Proceed to the booking form where you can:

  1. Select the number of adults and children.
  2. Enjoy dynamic pricing: Children receive a 50% discount, and the total price updates in real-time based on your selection.
  3. Choose your preferred payment method: Pay online or on-site for added flexibility.

Book a Trip

Once the online payment is picked, a payment URL will be generated, redirecting you to the payment page. To simulate a successful transaction, enter "111111" and you will be redirected to the success page. For a failed payment, use "0000000" to be redirected to the failure page.


Flouci Payment

Booking Success

Upon Booking a pdf invoice will be generated asynchronysly and you will recieve a confirmation mail:


PDF INVOICE

Booking Confirmation Email

You can also explore the latest travel news, trends, and expert tips, all conveniently gathered through web scraping.


News Articles Scraping

News Articles Source: https://www.lonelyplanet.com/news

I started this but didn't have time to finish it all. I created an assistant to guide users through the booking process and gather user feedback, but time was short. I also built a recommendation system, but it's not strong enough as it relies on ratings that I personally added to the database for each travel package and user gender. It lacks user data like feedback and preferences.


Chatbot Assistant

Packages Recommandations

πŸ’Œ Contact

Project Author :


Ahlem Laajili
Gmail Badge

(back to top)

Developed with πŸ’• by ahlem-phantom.

About

Travel Agency website built using Django, designed for browsing and booking of travel packages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published