/tastypie-booking-system

Learning tastypie through a booking system.

Primary LanguagePython

๐ŸŽฌ Booking System: Tastypie Leaning Path

Welcome to my Cinema Booking System! ๐ŸŒŸ This project is a web application built using Django and Tastypie, providing a RESTful API for managing users, profiles, rooms, sessions, and seats for a cinema booking system.

This project uses Python 2.7, Django 1.11.29, and Tastypie 0.14.1 because these were requirements for my current back-end job. Docker was used for local development since Python 2 is no longer shipped or supported. ๐Ÿณ

If you are somehow running this on your host machine, you may want to use a virtualenv. ๐Ÿ

โœจ Features

  • ๐Ÿ‘ค User and Profile Management
  • ๐Ÿ›๏ธ Room and Session Management
  • ๐ŸŽŸ๏ธ Seat Reservation System
  • ๐Ÿ”— RESTful API using Tastypie

๐Ÿ“‹ Requirements

  • Python 2.7
  • Docker (optional)

โš™๏ธ Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/userexample.git
    cd userexample
  2. Install the required Python packages:

    pip install -r requirements.txt

๐Ÿš€ Running the Application

Using Python

  1. Make sure you have the required Python packages installed.

  2. Apply the migrations:

    python manage.py migrate
  3. Start the development server:

    python manage.py runserver
  4. Access the application at http://127.0.0.1:8000/ ๐ŸŒ. (Although there is nothing to see there lol ๐Ÿ˜…)

Using Docker

โš ๏ธ This Dockerfile.dev is used for local development, it does not provide a full ready-to-use application. You may install and run the application. Follow the steps below:

  1. Build the Docker image:

    docker build -f Dockerfile.dev -t python2-tastypie:dev .
  2. Run the Docker container:

    docker run -p 8000:8000 -v .:/workspace -dt python2-tastypie:dev

    Here we forward the port 8000 to the container, mount the current working directory to the container and make it run in the background.

  3. Attach your IDE to the running container (you may use VSCode or any other IDE). There is a plugin for Docker that allows you to attach to a running container while using VSCode.

  4. Open your terminal inside your IDE or using docker exec:

    docker exec -it python2 /bin/sh
    
  5. Apply the migrations:

    python manage.py migrate
    
  6. Start the development server:

    python manage.py runserver
    
  7. Access the application at http://127.0.0.1:8000/ ๐ŸŒ.

๐Ÿงช Testing

Run the tests using Django's test framework:

python manage.py test

๐Ÿค Contributing

We welcome contributions! ๐ŸŽ‰ Please fork the repository and submit a pull request with your changes.

๐Ÿ“ License

This project is licensed under the MIT License.

Feel free to explore, modify, and enhance the User Example Project. If you encounter any issues or have any questions, don't hesitate to reach out!

Happy coding! ๐Ÿ’ปโœจ