Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit 67cf254

Browse files
add some environment variables in settings.py, update readme accordingly
1 parent 1cf5219 commit 67cf254

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@ the bugboard updates and sort [bugherd](https://www.bugherd.com/)'s tasks and co
88

99
### Prerequisites
1010

11-
You will need `python` 3 & `django`.
11+
You will need `python3.7` & `django`.
1212

1313
Some sensitive data are read using `os.environ('KEY')`, you will need to `export` them in order to successfully launch the bugboard:
1414
* `BUGHERD_API` : The access key used to get content from bugherd.com/api_v2/
1515
* `SECRET_KEY` : The django secret key.
1616
* `DB_USER` : PSQL username.
17-
* `DB_PASS` : PSQL password.
17+
* `DB_PASSWORD` : PSQL password.
18+
* `DB_ENGINE` : `django.db.backends.postgresql_psycopg2` if you're using PSQL
19+
* `DB_NAME` : PSQL database name (*bugboard seems to be a good name*)
20+
* `DB_HOST` : Host UNIX entry point
21+
* `ADMIN_URL` : Custom admin url (default is `admin/`)
1822

1923
### Install
2024

21-
Just put the application inside your django project, create one url from your project `urls.py` file, make the migrations, migrate the db, and you're done.
25+
Just put the application inside your django project, create one url from your project `urls.py` file, store all the data in previous section inside your `.env` (if you're using `pipenv`), collect the static files, serve them, make the migrations, migrate the db, and you're done.
2226

2327
----
2428

randomdjangoprojectname/settings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# SECURITY WARNING: don't run with debug turned on in production!
2828
DEBUG = True
2929

30-
ALLOWED_HOSTS = ["192.168.7.32", "127.0.0.1", "192.168.7.110", "192.168.7.131"]
30+
ALLOWED_HOSTS = ["*"]
3131

3232

3333
# Application definition
@@ -78,11 +78,11 @@
7878

7979
DATABASES = {
8080
"default": {
81-
"ENGINE": "django.db.backends.postgresql_psycopg2",
82-
"NAME": "bugboard",
81+
"ENGINE": os.environ["DB_ENGINE"],
82+
"NAME": os.environ["DB_NAME"],
8383
"USER": os.environ["DB_USER"],
84-
"PASSWORD": os.environ["DB_PASS"],
85-
"HOST": "localhost",
84+
"PASSWORD": os.environ["DB_PASSWORD"],
85+
"HOST": os.environ["DB_HOST"],
8686
"PORT": "",
8787
}
8888
}

randomdjangoprojectname/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16+
import os
17+
1618
# Third party
1719
from django.contrib import admin
1820
from django.urls import include, path
1921

2022

2123
urlpatterns = [
2224
path("", include("bugboard.urls")),
23-
path("admin/", admin.site.urls),
25+
path(os.environ["ADMIN_URL"] + "/", admin.site.urls),
2426
path("bugboard/", include("bugboard.urls")),
2527
]

0 commit comments

Comments
 (0)