A Django web application for tracking and managing body measurements over time. This application allows users to record, monitor, and visualize their body measurements, making it easier to track fitness progress or body changes.
- User authentication and personal accounts
- Record and track multiple body measurements
- English and Polish language support (i18n)
- Secure data storage
- Responsive UI (Bootstrap 5)
- Python 3.11+
- pip
- Clone the repository:
git clone <your-repository-url>
cd body_measurements- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile (see.env.sample) in the project root with:
DJANGO_SECRET_KEY=your_secret_key_here
DJANGO_DEBUG=True
EMAIL_HOST_USER=your_email@gmail.com
EMAIL_HOST_PASSWORD=your_email_app_password
- Run database migrations:
python manage.py migrate- Create a superuser (admin account):
python manage.py createsuperuser- Start the development server:
python manage.py runserverThe application will be available at http://127.0.0.1:8000/
DJANGO_SECRET_KEY: Django secret keyDJANGO_DEBUG: 'True' for development, 'False' for productionDJANGO_ALLOWED_HOSTS: Comma-separated list of hosts (default allows localhost and.pythonanywhere.com)DJANGO_CSRF_TRUSTED_ORIGINS: Comma-separated origins with scheme (default includeshttps://*.pythonanywhere.com)EMAIL_HOST_USER/EMAIL_HOST_PASSWORD: Optional for password reset emails. If unset in production, a dummy email backend is used to avoid runtime errors.
- Create a virtualenv and install:
pip install -r requirements.txt- Set environment variables in the Web app (Environment section):
DJANGO_SECRET_KEY(required)DJANGO_DEBUG=FalseDJANGO_ALLOWED_HOSTS=yourusername.pythonanywhere.com- Optional:
EMAIL_HOST_USER,EMAIL_HOST_PASSWORD
-
Configure WSGI to point to this project (module:
body_measurements.wsgi). -
Run migrations and create a superuser from a Bash console:
python manage.py migrate
python manage.py createsuperuser- Collect static files and map them:
python manage.py collectstatic --noinput- In the Web tab, add a Static file mapping: URL
/static/→ path shown asSTATIC_ROOT(seebody_measurements/settings.py).
- Reload the web app.
- DisallowedHost or 400: set
DJANGO_ALLOWED_HOSTSto your domain. - CSRF verification failed: add
https://yourusername.pythonanywhere.comtoDJANGO_CSRF_TRUSTED_ORIGINS. - ImportError:
python-dotenv: ensurepip install -r requirements.txtran (dotenv is required by settings). - No such table / migrations: run
python manage.py migratein your virtualenv. - Static files 404: run
collectstaticand configure the static mapping in the Web tab. - Email errors: either set
EMAIL_HOST_USER/EMAIL_HOST_PASSWORDor rely on the default dummy backend in production.
Feel free to submit issues and enhancement requests.
For security issues, please email [your-email@example.com]
This project is licensed under the MIT License - see the LICENSE file for details.