⏳Local setup in 3 minutes...

Local Setup

Follow these steps to set up your local environment for Ready SaaS. This will prepare your development environment to run the application locally.

1. Clone the Repo

Once you get Ready SaaS, you'll receive an invite to our private Github Repo.

Once you access the repo, grab the repo address and clone it

clone the repo running the following command in your terminal:

git clone git@github.com:readysaas/readysaas.git

2. Install Dependencies

To install dependencies, we recommend using a virtual environment. A virtual environment isolates your Python/Django setup on a per-project basis, ensuring dependencies are kept separate from other projects.

In this guide we're using venv to manage our virtual environment.

Run each of these commands in order to create a virtual environment, and install all dependencies in it. You can replace .ready_saas with the name of your project if you prefer.

python -m venv .ready_saas
source .ready_saas/bin/activate
pip install -r requirements/local.txt

Notice that the pip install -r requirements/local.txt command installs all requirements listed in requirements/local.txt. Ready SaaS let's you specify which dependencies should be included in each environment.

3. Database setup

To run Ready SaaS locally, you'll first need to create a Postgres DB and reference it within the project.

In order to do that, make sure you have Postgres installed.

To create a new db for your project, run the following command:

createdb --username=<username> <db_name>

The above command expects you to provide your own postgres username and your desired db_name

4. Environment Variables

Create an .env file

Within the project you'll find a .env-sample file. You can rename it to .env or copy it to create a new .env file:

cp ./.env-sample ./.env

Database

Use the db_name from the previous step to populate the DATABASE_URL. Also include your Postgres credentials: db_user and db_password

5. Database Migration

The following command will create the necessary tables in your local database.

python manage.py migrate

6. Seed Database Subscription Plans

This optional step populates your local database with sample subscription plans, useful for development and testing. If you don't run this command, you will likely see an error when accessing pages that require a subscription plan to exist.

python manage.py loaddata orders/fixtures/plans.json

7. Create an Admin User

Creating an admin user allows you to access Django's admin interface to manage application data.

To create an admin user run the following command:

python manage.py createsuperuser

8. Run Locally

Now you're ready to start Django’s development server, making the application accessible on your local machine.

python manage.py runserver

you can optionally specify the port number you'd like it to run on:

python manage.py runserver 5050

If you followed all the steps up to this point, you should have an identical instance of this page running in your local machine.

Yay! πŸ™Œ You're done with the basic local setup!

If you want to change the content of that page right now, open and edit the following file: ready_saas/templates/landing.html

Last updated