Skip to content

Commit

Permalink
replace fixtures with climu's dev db
Browse files Browse the repository at this point in the history
  • Loading branch information
raylu committed Jun 29, 2023
1 parent 4b81afd commit 0d8cd2c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Have a look at our contributing guidelines [here](/CONTRIBUTING.md).
With the current Dockerfile and Docker compose, you can build everything with:

```bash
docker-compose docker-compose -f docker-compose.dev.yml build
docker-compose -f docker-compose.dev.yml build
```

Then, you can
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
app:
container_name: openstudyroom-dev
image: openstudyroom-dev
init: true
restart: always
build:
context: .
Expand All @@ -15,15 +16,17 @@ services:
cli:
container_name: openstudyroom-cli
image: openstudyroom-cli
stdin_open: true
init: true
build:
context: .
target: cli
volumes:
- ./:/app/
stdin_open: true
ruff:
container_name: openstudyroom-ruff
image: openstudyroom-ruff
init: true
build:
context: .
target: ruff
Expand Down
12 changes: 1 addition & 11 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ Change branch to dev: `git checkout dev`

Install development dependencies: `pip install -r requirements_dev.txt`

Run migrations and migrate:

`./manage.py makemigrations`

`./manage.py migrate`

Load initial datas:
`./manage.py loaddata fixtures/initial_data.json `

Run the server:
`./manage.py runserver`
Load initial data, run migrations, and run the server: `./run.sh`

The server should now be running on your computer at [http://127.0.0.1:8000](http://127.0.0.1:8000). You can connect with user `admin` and pass `admin`
11 changes: 2 additions & 9 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/bin/bash

set -eu
set -eux

# This is ugly but it works.
if [ ! -f db.sqlite3 ]; then
INIT_DATA=true
else
INIT_DATA=false
wget --quiet https://cdn.discordapp.com/attachments/287520917255356416/1066436504597053570/db.sqlite3
fi

./manage.py makemigrations
./manage.py migrate

if $INIT_DATA ; then
./manage.py loaddata fixtures/initial_data.json
fi

./manage.py runserver 0.0.0.0:8000

0 comments on commit 0d8cd2c

Please sign in to comment.