Skip to content

Commit 22647a8

Browse files
author
Emile Frey
committed
updated the readme and db default name
1 parent a2984b6 commit 22647a8

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
**To-do:**
1+
# django-react-postgres-boilerplate
2+
3+
## Prerequisites
4+
Install Docker Desktop
5+
6+
## Installation
7+
8+
There are 3 .env files provided. Note in particular the .env files in backend/ and postgres/; there, you can adjust the database credentials, debug mode, secret key, allowed hosts, etc. But things should run just fine without any changes, but just know these files are there.
9+
10+
For development mode without NGINX server, run the following command:
11+
12+
```sh
13+
docker-compose -f "docker-compose.dev.yml" up -d --build
14+
```
15+
The react frontend should be available at `http://localhost:3000/` and django backend at `http://localhost:8000/` (django admin at `http://localhost:8000/admin/`). This mode supports both react hot reloading and django auto-refresh with changes.
16+
17+
For development with the NGINX server run:
18+
```sh
19+
docker-compose -f "docker-compose.yml" up -d --build
20+
```
21+
The server should be available at `http://127.0.0.1/`. This mode will not hot reload since it's running a production build.
22+
23+
The included sample prediction django app can be easily removed by removing 'prediction' from INSTALLED_APPS in django mainapp/settings.py, removing the associated path in mainapp/urls.py and deleting the entire prediction folder.
24+
25+
**_NOTE: This repo is still largely a work in progress, but it should be a good starting point. Suggestions/feedback are greatly appreciated._**
26+
27+
**TODO:**
228
- [ ] Basic Backend Testing
329
- [ ] Frontend Testing (React Testing Library)
430
- [ ] Readme (setup and how to remove remnants of dummy stuff)

backend/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DJANGO_ADMIN_PASSWORD=admin_password
1010
DATABASE=postgres
1111

1212
DB_ENGINE=django.db.backends.postgresql
13-
DB_DATABASE=predictiondb
13+
DB_DATABASE=boilerplatedb
1414
DB_USER=postgres_user
1515
DB_PASSWORD=postgres_password
1616
DB_HOST=db

backend/mainapp/local_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
DATABASES = {
4747
'default': {
4848
'ENGINE': 'django.db.backends.postgresql_psycopg2',
49-
'NAME': 'predictiondb',
49+
'NAME': 'boilerplatedb',
5050
'USER': 'postgres_user',
5151
'PASSWORD': 'postgres_password',
5252
'HOST': '127.0.0.1',

postgres/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
POSTGRES_USER=postgres_user
22
POSTGRES_PASSWORD=postgres_password
3-
POSTGRES_DB=predictiondb
3+
POSTGRES_DB=boilerplatedb

0 commit comments

Comments
 (0)