Step-by-step guides to some different things you might want to do with Pegasus.
Use the Django Admin UI#
Pegasus ships with a simple script to promote any user to a superuser who can access the Django admin.
After going through the sign up flow, to convert your newly-created user into an admin, run the following command, being sure to replace the email address with the one you used to sign up:
docker compose exec web python ./manage.py promote_user_to_superuser firstname.lastname@example.org
python ./manage.py promote_user_to_superuser email@example.com
Now you should be able to access the django admin at http://localhost:8000/admin
Migrating to auto-formatted code#
As of February, 2023 all Pegasus projects have the option to auto-format your Python code.
To migrate a project from non-formatted to formatted code, you can go through the following steps:
First, do a full Pegasus upgrade to the version you want to update to, as described here. Do not check the “autoformat” checkbox yet.
Next, run the formatting tools on your project’s
Install black and isort:
pip install black isort
black --extend-exclude migrations --line-length 120 .
isort -l 120 --profile black .
Commit the result:
git add .
git commit -m "apply formatting changes"
Finally, check the “autoformat” box on your Pegasus project, and do another upgrade according to the same process.
Delete Pegasus Examples#
On versions 2023.2 and later, you can remove the Pegasus examples by unchecking the “Include Examples” checkbox on your project page and re-downloading (or upgrading) your codebase.
For earlier versions you can use the following instructions:
Clean the back-end code#
PEGASUS_APPSand the reference in
In your root
urls.py, remove the lines containing
Delete the entire top-level
Delete the entire
Clean the front-end code#
webpack.config.js, delete the