Getting Started

Here’s everything you need to start your first Pegasus project.

Watch the video

Visual learner? The above video should get you going. Else read on below for the play-by-play.

Install Prerequisites

If you haven’t already, you’ll need to install the following.

Note: It is possible to use the template without virtualenv, but it is highly recommended, and these instructions assume you are using it.

If you’re using Postgres, you’ll also want to make sure you have it installed.

Create and download your project codebase

If you haven’t already, you’ll need to purchase a Pegasus License on saaspegasus.com.

Then, create a new project on saaspegasus.com, following the prompts and filling in whatever configuration options you want to use for your new project. Make sure that the “license” field at the bottom is set.

Once you’re done, download your project’s source code as a zip file. Unzip it to a folder where you want to do your development and you’re ready to go!

If you’ve chosen to use Docker in development (the quickest way to get up and running), continue to the Docker instructions. Otherwise keep reading.

Setup a Python 3.7+ virtualenv

See Using Virtual Environments for details on this process.

Enter the project directory

cd {{ project_name }}

You should see a lot of newly created files for your project including a manage.py file.

Install package requirements

pip install -r requirements.txt

Note: if you have issues installing psycopg2, try installing the dependencies outlined in this thread (specifically python3-dev and libpq-dev.

Set up database (Postgres only)

If you installed with Postgres, edit the DATABASES value in {{ project_name }}/settings.py with the appropriate details.

You will also need to create a database for your project if you haven’t already:

sudo -u postgres createdb {{ project_name }}

Create database migrations

python ./manage.py makemigrations

Run database migrations

python ./manage.py migrate

Run server

python ./manage.py runserver

Go to http://localhost:8000 and you should see the default Pegasus landing page!

Landing Page

Create a User

To create your first user account, just go through the sign up flow in your web browser.

From there you should be able to access all built-in functionality and examples.

(Optional) Enable admin access

Follow these instructions to enable access to the Django Admin site.

(Optional) Set up your Stripe Subscriptions

If you’ve installed with subscriptions, you’ll want to set things up next.

Head to the subscriptions documentation and follow the steps there!

(Optional) Set up Background Tasks

For the progress bar example to work you’ll need a Celery environment running.

Head to celery and follow the steps there!

Building Your Application

At this point, Pegasus has installed scaffolding for all of the user management, authentication, and (optionally) team views and Stripe subscriptions, and given you a beautiful base UI template and clear code structure to work from.

Now that you’re up and running it’s time for the fun part: building your new application!

The can obviously be done however you like. Some examples of things you might want to do next include:

  • Customize your landing page and setup a pricing page
  • Start modifying the list of navigation tabs and logged-in user experience
  • Create a new django app and begin building out your data models in models.py

For some initial pointers on where to to make Pegasus your own, head on over to the Customizations Page.

For the nitty-gritty details on setting up things like email, error logging, sign up flow, analytics, and more go to Settings and Configuration.