This app creates schedules to automatically reserve seats in the TUM library. The user specifies which library branch he wants to study in and which dates and time slots are to be booked. The tool will wait until the correct reservation can be made and book it automatically. For this, the tool requires some configuration data from the user (full name, TUM email adress, etc.).
The web app has four pages: the log-in, a profile page, plus the booking and schedule overview pages.
preview.mov
I hosted a live version of this tool over on http://philippwulff.pythonanywhere.com/.
You can also clone this repository and host it yourself. For this, you will need to following commands:
python manage.py migrate # to create a new database
python manage.py createsuperuser # to create the admin user
python manage.py runserver # to start the website
# In another terminal window
python manage.py runscheduler # to start the scheduling backend
⚠️ NOTE: If you do reuse the project, you must change the Django secret key inreservation_site/settings.py
.
Plan: Google Cloud Services
To host it on pythonanywhere.com (PyA) you need to follow this check-list (from this guide):
- Create an account on PyA.
- Open a Bash terminal on PyA and run
git clone https://github.com/philippwulff/lib_reservation_tool.git cd lib_reservation_tool python manage.py migrate
- Create a web app in the 'Web' widget of pythonanywhere (choose manual configuration).
- In the 'Code' section set the path for 'Source code' to
/home/username/lib_reservation_tool/
(Your username!). - Edit the WSGI configuration file according to the guide linked above.
- Serving static files in development to production.
- In
settings.py
setSTATIC_URL
andSTATIC_ROOT
(I already did this and this explains how). - In the terminal run
python manage.py collectstatic
. - In the 'Static files' section of the configuration set 'URL' to
/static/
and 'Directory' to/home/username/LibResTool/static
.
- In
- Hit the reload button and navigate to the webpage!
- Done.
The tool opens the webpage at https://www.ub.tum.de/arbeitsplatz-reservieren, and waits until it is possible to reserve the desired seat. I use Selenium as the backbbone of this process. The frontend is powered by Django. These two parts of the software are separate processes and communicate via a shared SQLite database. The image below shows this architecture:
- The library booking page now has a Captcha that needs to be solved. This tool cannot do that at the moment.
- Currently there is no "Sign up" page. Users need to be created through the admin site (this requires creating a
superuser
first). - If the website of the TUM library is changed, the backend code may break. If the changes are small, this can probably be fixed by editing the CSS locators in
reservation_app/management/commands/common/locators.py
. - If you receive an exception message saying that no webdriver was found,
Selenium
could not locate the driver for your browser. You need to configure this inreservation_app/management/commands/common/app.py
.
All commercial use of this software is prohibited.