Repository navigation
Shell scripts
A suite of shell scripts for performing various functions can be found in the /bin folder.
These scripts can be run with, for example docker-compose exec twlight bin/migrate.sh.
The script migrate.sh will, for each TWLight app, run:
python manage.py createinitialrevisionspython manage.py makemigrationspython manage.py migratepython manage.py sync_translation_fields
See the official documentation for more on what each of these commands does.
To test the tool, simply run the test.sh script. This script more or less only runs python manage.py test.
You can run a specific test using the testcase.sh script, providing a single argument for the test case to run, e.g. testcase.sh TWLight.resources.tests.
When working on TWLight locally you may want example data reflecting the live tool. The script example_data.sh will generate 200 users, 50 resources, and 1000 applications, with pre-filled data and relations that broadly reflect the real data.
This script can only be generated with an empty database, after you have logged in to an account you want to be made a superuser (the script looks for a single account in the database and makes it a Django superuser).
Wikimedia Foundation staff and contractors can acquire a copy of the live database for local development. For data privacy reasons this should only be used if absolutely necessary, and if deploying changes to the Staging tool wouldn't suffice.
Note that the example data script has not been updated to generate proxy or bundle type partners (T246331)
Repository
Local development
Servers
Code documentation