Ready SaaS Docs
  • Guides
    • โณLocal setup in 3 minutes...
    • ๐ŸคนBackground Tasks (Local)
    • ๐Ÿš€Deploy
    • ๐Ÿ’ฒPayments & Subscriptions
      • Stripe
      • Paypal
  • Features
    • ๐ŸŽจStyle and Themes
    • โœ๏ธBlog
    • ๐Ÿ“งEmail
Powered by GitBook
On this page
  • Local Setup
  • 1. Clone the Repo
  • 2. Install Dependencies
  • 3. Database setup
  • 4. Environment Variables
  • 5. Database Migration
  • 6. Seed Database Subscription Plans
  • 7. Create an Admin User
  • 8. Run Locally
  1. Guides

Local setup in 3 minutes...

NextBackground Tasks (Local)

Last updated 1 year ago

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.

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.

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

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 want to change the content of that page right now, open and edit the following file: ready_saas/templates/landing.html

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

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

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

If you followed all the steps up to this point, you should have an identical instance of

Yay! You're done with the basic local setup!

โณ
๐Ÿ™Œ
venv
Postgres
the previous step
this page running in your local machine.