Step-by-step guide to some different you might want to do with Pegasus.

Pegasus customers can request content be added to this page! Just get in touch via support.

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 ./ promote_user_to_superuser


python ./ promote_user_to_superuser

Now you should be able to access the django admin at http://localhost:8000/admin

Delete Pegasus Examples#

The Pegasus examples are great for seeing a fully-working end-to-end feature, but in your app you probably don’t want them around long term. To remove the examples entirely, take the following steps:

Cleaning the back-end code#

  1. In, remove PEGASUS_APPS and the reference in INSTALLED_APPS.

  2. In your root, remove the lines containing include('pegasus.apps.examples.urls') and include('pegasus.apps.employees.urls').

  3. In apps/web/templates/web/components/top_nav.html, remove the section linking to the Examples Gallery.

  4. Delete the entire pegasus/ directory.

  5. Delete the entire templates/pegasus/ directory.

Cleaning the front-end code#

  1. In webpack.config.js, delete the 'react-object-lifecycle', vue-object-lifecycle and 'pegasus' entries from module.exports.

  2. Delete the assets/javascript/pegasus/ folder.

  3. Delete static/js/react-object-lifecycle-bundle.js, static/js/vue-object-lifecycle-bundle.js and static/js/pegasus-bundle.js

Delete Stripe Code#

If you aren’t using Stripe you can remove the code and dependencies by doing the following steps.

Note that this requires starting from a fresh database, or manually manipulating your migrations.

  1. In remove djstripe from THIRD_PARTY_APPS

  2. In remove STRIPE_ and DJSTRIPE_ settings

  3. Delete apps/utils/

  4. Delete templates/stripe directory

  5. Delete the @import "stripe.sass" line from assets/styles/app/_all.sass

  6. Delete assets/styles/app/stripe.sass

If you have not removed the examples using the method above, you also need to delete the payments example. This can be done with the following steps:

  1. Delete the paths starting with /payments/ from pegasus/apps/examples/

  2. Delete references to Payment from pegasus/apps/examples/

  3. In pegasus/apps/examples/views/ delete line from .payments import *

  4. Delete pegasus/apps/examples/views/

  5. In pegasus/apps/examples/models/ delete line from .payments import Payment

  6. Delete pegasus/apps/examples/models/

  7. Delete the relevant sections of templates/pegasus/examples/examples_home.html and templates/pegasus/examples/components/examples_nav.html

  8. Delete the templates/pegasus/examples/payments/ folder.

  9. In assets/javascript/app.js remove export { Payments } from './Payments'; line.

  10. Delete assets/javascript/payments.js.

  11. Run ./ makemigrations and ./ migrate

Finally, remove the library dependencies:

  1. In requirements/ and requirements/requirement.txt remove stripe and dj-stripe lines.

  2. Run pip-sync

Using the Payments example#

To make the Payments example a part of your own application, see this page.