A Python and Django tennis racket stringing app
I string tennis rackets, both for myself and for friends and teammates. This webapp manages the rackets I string by:
- tracking customers and their orders
- maintaining a database with rackets and strings (shamelessly scraped from Klipper USA and Tennis Warehouse University)
- cataloging all pertinent order information in one place (strings + tension to use, string pattern of racket, due date, etc)
git clone https://github.com/rbennett91/racket_stringer.git
You'll need to install system-wide packages to setup a development environment. On an Ubuntu 20.04 machine:
sudo apt install gcc postgresql-12 libpq-dev python3-venv python3-dev
Inside Postgres:
CREATE ROLE <role_name_here> WITH LOGIN PASSWORD '<password_here>';
CREATE DATABASE <database_name_here> WITH OWNER <role_name_here>;
Note the role name, password, and database name.
In the top-level of the code repository:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements/development.txt
Note that you might see miscellaneous errors like ERROR: Failed building wheel for <package>
. These may be ignored.
This project uses environment variables to manage sensitive information like the database connection and Django's SECRET_KEY
. Create an environment variable file by copying the included template:
cp racket_stringer/settings/app.env.example racket_stringer/settings/app.env
Do not add sensitive information to the template.
Instead, open the new racket_stringer/settings/app.env
with your favorite text editor, uncomment the block of environment variables that pertain to your shell, and fill out the missing values. Then, source the app.env
file:
source racket_stringer/settings/app.env
Note that you'll need to re-source this file if you make changes to it. This file should be kept out of source control, and it is included in this project's .gitignore
. Moving or renaming this file will require an update to .gitignore
to keep it out of source control.
python manage.py migrate
Use the custom Django Management Commands to add new rackets and strings to the database:
python manage.py import_rackets
python manage.py import_strings
python manage.py createsuperuser
python manage.py runserver_plus 0.0.0.0:8080
Visit http://<server_domain>:8080/racket_stringer in your web browser and login with the newly created user.
- Python 3.9.5
- PostgreSQL 13.5
Deploy as a managed app on Digital Ocean
- Setting up Django and your web server with uWSGI and nginx
- Deploying Django applications in production with uwsgi and nginx
- How To Secure Nginx with Let's Encrypt on Ubuntu 20.04
MIT