Skip to content

Commit

Permalink
docs: update local development setup guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Jul 14, 2023
1 parent 05a426c commit bea68d1
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion docs/developer/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@ Please see [the shipper-docker repository](https://github.com/shipperstack/shipp

### Set up manually

In this method you need to bring your own database (PostgreSQL). A web server (nginx) may also be installed alongside, but it is not necessary if you wish to just use Django's built-in web server.
In this method you need to bring your own database, or use the built-in SQLite database. A web server (nginx) may also be installed alongside, but it is not necessary if you wish to just use Django's built-in web server.

A manual setup provides easy code reload, since changes will propagate immediately.

#### Prepare the `.env` file

Create an `.env` file by [following the configuration instructions](../sysadmin/Configuration.md).

Be sure to clear out the database portion if you are using the built-in SQLite database.

#### Import the `.env` file

On macOS and Linux, run the following command:

```bash
set -a && source .env && set +a
```

On Windows, this command will not work. If you know of a command that will ingest environment variables from an `.env` file on Windows, please create a patch and make a pull request.

#### Start the development server

Run:

```bash
python3 manage.py migrate
python3 manage.py createsuperuser
python3 manage.py runserver
```

#### Caveats

Any tasks that rely on Celery to run will not work. You can try and run Celery separately using the following step, but at that point this method is not recommended, and it's best if you go with a Docker development setup directly.

#### Get Celery tasks to work

Install RabbitMQ.

After installing, run the following commands, with each command going in a different TTY as they will not fork:

```bash
celery -A core worker -l info -Q default
celery -A core worker -l info -Q mirror_upload --concurrency=1
celery -A core beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
```

0 comments on commit bea68d1

Please sign in to comment.