# 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.&#x20;

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

<figure><img src="https://1908511726-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT1c9BPzeUyd2bkOioywo%2Fuploads%2Fq0Uwpy8q9Fa6S1BV9OzS%2Fimage.png?alt=media&#x26;token=885b006d-ddd1-44c2-b96a-b67381ecb7d6" alt=""><figcaption></figcaption></figure>

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](https://docs.python.org/3/library/venv.html) 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](https://www.postgresql.org/) 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](#id-3.-database-setup) to populate the `DATABASE_URL`. Also include your Postgres credentials: `db_user` and `db_password`

<figure><img src="https://1908511726-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT1c9BPzeUyd2bkOioywo%2Fuploads%2Fb6lUxTUcVegkHtATcJnA%2Fimage.png?alt=media&#x26;token=517d759d-c2a8-495d-894c-313b105c0b30" alt=""><figcaption></figcaption></figure>

### 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.

<figure><img src="https://1908511726-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT1c9BPzeUyd2bkOioywo%2Fuploads%2FDNOvkCwzkBQFEfcOoJx5%2Fimage.png?alt=media&#x26;token=755de12e-accb-4da7-af84-e799132e8bdb" alt=""><figcaption></figcaption></figure>

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.](https://ready-saas-demo-157bf36bed0c.herokuapp.com/)

<figure><img src="https://1908511726-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT1c9BPzeUyd2bkOioywo%2Fuploads%2FOn0IQzajXI9Sit7z3vA3%2Fimage.png?alt=media&#x26;token=5bf2e733-aa38-4651-a6bc-37a2482016c8" alt=""><figcaption></figcaption></figure>

**Yay!** :raised\_hands: **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`

