From 9c28c3c1ad154a5cf5145a873bee7874e4427365 Mon Sep 17 00:00:00 2001
From: Ichlasul Affan <ichlaffterlalu@gmail.com>
Date: Sat, 19 Sep 2020 21:10:21 +0700
Subject: [PATCH] Added missing migrations, added DB_PORT env var, and updated
 README.md.

---
 README.md                                 | 16 +++++++++--
 app/migrations/0013_auto_20200919_2055.py | 33 +++++++++++++++++++++++
 digipus/settings.py                       |  2 +-
 3 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 app/migrations/0013_auto_20200919_2055.py

diff --git a/README.md b/README.md
index fcb1919..e336770 100644
--- a/README.md
+++ b/README.md
@@ -56,12 +56,11 @@ dependencies prior to building and contributing to the project.
   > Python packages from system-level packages. You can install and use
   > [`virtualenv`](https://virtualenv.pypa.io/en/stable/) package to create the
   > virtual environment for this project.
+- PostgreSQL.
 
 To verify your Python is installed. Make sure
 the interpreter can be invoked from the shell. For example,
 in `bash` shell (macOS or GNU/Linux-based OS):
-
-
 ```bash
 $ python3 --version
 Python 3.8.2
@@ -69,6 +68,19 @@ $ pip3 --version
 pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
 ```
 
+This project uses PostgreSQL as the database. So, add these lines to `.env` to
+setup your local database-related environment variables:
+```bash
+IS_LOCAL=True
+DB_NAME=marjinal
+DB_USER=postgres      
+DB_PASSWORD=postgres
+DB_HOST=localhost
+DB_PORT=5432
+```
+You can adjust `DB_NAME`, `DB_USER`, `DB_PASSWORD`, `DB_HOST`, and `DB_PORT`
+based on your local configuration.
+
 After you clone this repository, let's make sure you installed all requirements, migrate, and collect static.
 ```bash
 pip3 install -r requirements.txt
diff --git a/app/migrations/0013_auto_20200919_2055.py b/app/migrations/0013_auto_20200919_2055.py
new file mode 100644
index 0000000..7b7993c
--- /dev/null
+++ b/app/migrations/0013_auto_20200919_2055.py
@@ -0,0 +1,33 @@
+# Generated by Django 3.0.3 on 2020-09-19 13:55
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('app', '0012_category_archived_by'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='materi',
+            name='author',
+            field=models.CharField(default='Penyusun', max_length=30),
+        ),
+        migrations.AlterField(
+            model_name='materi',
+            name='descriptions',
+            field=models.TextField(default='Deskripsi'),
+        ),
+        migrations.AlterField(
+            model_name='materi',
+            name='publisher',
+            field=models.CharField(default='Penerbit', max_length=30),
+        ),
+        migrations.AlterField(
+            model_name='materi',
+            name='title',
+            field=models.CharField(default='Judul', max_length=50),
+        ),
+    ]
diff --git a/digipus/settings.py b/digipus/settings.py
index de6e823..e988dc9 100644
--- a/digipus/settings.py
+++ b/digipus/settings.py
@@ -97,7 +97,7 @@ if is_local:
             "USER": config("DB_USER"),
             "PASSWORD": config("DB_PASSWORD"),
             "HOST": config("DB_HOST"),
-            "PORT": "",
+            "PORT": config("DB_PORT", 5432),
         }
     }
 elif is_heroku:
-- 
GitLab