This repository includes the websites and tools for Digital Meal Education and My Digital Meal.
For further information, see here
Digital Meal is developed by the Media Use and Effects division of the University of Zurich, and was financially supported by Citizen Science Zürich.
This repository is intended primarily for internal use and is not yet optimised for external projects or broader integrations.
Digital Meal is built using:
- Python
- Django
It is developed to be used alongside django-ddm, a web application for collecting data donations and enriching them with questionnaire responses.
⚠️ This repository is intended primarily for internal use. It is not yet optimized for external projects or broader integrations.
The structure of the repository is organized as follows:
-
config/: Central project configuration, including settings, URLs, and deployment entry points (WSGI/ASGI).
-
digital_meal/: Contains the main Digital Meal Django application with the following sub-applications and files::
- reports/: Responsible for generating media usage reports.
- tool/: Provides the admin interface for teachers to register and manage classes.
- website/: Handles public-facing website components, including CMS (Wagtail) integration.
- urls.py: Defines the main URL routes for the sub-applications.
-
templates/: Contains overrides of base templates from used dependencies (mainly allauth and Django defaults).
-
.env.example: Example file listing the environmental variables needed for local or production deployment.
Follow these steps to get a local development environment up and running:
- Clone the repository
git clone https://github.com/your-username/digital-meal.git
cd digital-meal- Set up a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt
# For the wordcloud pre-processing, we also need:
python -m spacy download en_core_web_sm
python -m spacy download de_core_news_sm- Configure environment variables
Copy the example environment file and adjust it as needed:
cp .env.example .envEdit .env to set your local environment variables.
- Apply database migrations
python manage.py migrate- Add necessary settings to settings.py.
DAYS_TO_DONATION_DELETION = 180 # Defines the timespan after which donations are deleted if no consent was given.
ALLOWED_REPORT_DOMAINS = ['some-domain.com'] # Is used to verify the report link domain when sending it via automated emails.- Create a superuser (admin account)
python manage.py createsuperuser- Run the development server
python manage.py runserver- Access the application
Open your browser and navigate to: http://127.0.0.1:8000/
The callback URL of TikTok is set to the production environment.
To test integration locally, authenticate/request data takeout in the production environment,
go to /admin and replicate the access token in the dev environment (python manage.py shell).
Next, update the current session with the open_id by (1) getting the session ID from the
browser cookie (use dev tools) and (2) setting the "tiktok_open_id" in the session by using
python manage.py edit_session.
My Digital Meal uses sass for css compilation.
When working css, run cd .sass; npm run sass:watch.
When ready to commit, run npm run sass:build.
Digital Meal is developed by the Media Use and Effects division of the University of Zurich, with financial support from Citizen Science Zürich.
Contact: kontakt@digital-meal.ch.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).