aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--app/.gitignore1
-rw-r--r--app/app/settings.py14
-rw-r--r--app/config-example.yml (renamed from app/config.yml)30
-rw-r--r--app/dispatch/templates/dispatch/nav.html1
5 files changed, 35 insertions, 12 deletions
diff --git a/README.md b/README.md
index cd4a3d9..c2f56e2 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ Requirements going forward:
* Make loads without paperwork blue
* Make loads with paperwork green
* A way for users to be invited via email
+ * Add "invite user" to the Driver's page
* Figure out if auditlog timestamps are fucked or not with timezones
diff --git a/app/.gitignore b/app/.gitignore
index f543301..70e8d3e 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -2,3 +2,4 @@ db.sqlite3*
media
tmux.sh
.ropeproject
+config.yml
diff --git a/app/app/settings.py b/app/app/settings.py
index f24a6b3..7e41f74 100644
--- a/app/app/settings.py
+++ b/app/app/settings.py
@@ -18,7 +18,11 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_default_config():
- return yaml.load(open(BASE_DIR + '/config.yml').read())
+ if os.path.exists(BASE_DIR + '/config.yml'):
+ return yaml.load(open(BASE_DIR + '/config.yml').read())
+ else:
+ print("Warning: loading example config! Create config.yml Soon!")
+ return yaml.load(open(BASE_DIR + '/config-example.yml').read())
CONFIG = {}
@@ -47,6 +51,14 @@ ALLOWED_HOSTS = CONFIG['allowed_hosts']
ADMINS = CONFIG['admins']
+if CONFIG.get('SET_EMAIL'):
+ EMAIL_HOST = CONFIG['EMAIL_HOST']
+ EMAIL_HOST_PASSWORD = CONFIG['EMAIL_HOST_PASSWORD']
+ EMAIL_HOST_USER = CONFIG['EMAIL_HOST_USER']
+ EMAIL_PORT = CONFIG['EMAIL_PORT']
+ EMAIL_USE_TLS = CONFIG['EMAIL_USE_TLS']
+
+
AUTH_USER_MODEL = 'dispatchAuth.User'
diff --git a/app/config.yml b/app/config-example.yml
index 8c39278..7954e08 100644
--- a/app/config.yml
+++ b/app/config-example.yml
@@ -1,12 +1,12 @@
---
# Postgres Example
-db_default:
- ENGINE: django.db.backends.postgresql
- NAME: dispatch
- USER: postgres
- PASSWORD:
- HOST: 127.0.0.1
- PORT: 5432
+# db_default:
+# ENGINE: django.db.backends.postgresql
+# NAME: dispatch
+# USER: postgres
+# PASSWORD:
+# HOST: 127.0.0.1
+# PORT: 5432
# MySQL Example
# db_default:
# ENGINE: django.db.backends.mysql
@@ -16,9 +16,9 @@ db_default:
# HOST: 127.0.0.1
# PORT: 3306
# Sqlite example. Full path is recommended
-# db_default:
-# ENGINE: django.db.backends.sqlite3
-# NAME: /home/mitch/scm/dispatch-tracker/app/db.sqlite3
+db_default:
+ ENGINE: django.db.backends.sqlite3
+ NAME: /home/mitch/scm/dispatch-tracker/app/db.sqlite3
allowed_hosts:
- localhost
@@ -35,3 +35,13 @@ SECRET_KEY: 'h$r_bwlp@#h#y#%&qhw-n=gb2%wva1d_h65+o94u&!a#%iv&lo'
admins:
- 'bob@example.com'
+
+
+# Email settings won't be loaded from this file if this is false
+SET_EMAIL: False
+# Email settings, edit for your needs
+EMAIL_HOST: smtp.example.com
+EMAIL_HOST_PASSWORD: p@$$w0rd9876543210
+EMAIL_HOST_USER: django@example.com
+EMAIL_PORT: 2525
+EMAIL_USE_TLS: True
diff --git a/app/dispatch/templates/dispatch/nav.html b/app/dispatch/templates/dispatch/nav.html
index 39acb38..a5f09e5 100644
--- a/app/dispatch/templates/dispatch/nav.html
+++ b/app/dispatch/templates/dispatch/nav.html
@@ -4,7 +4,6 @@
{% if request.user.is_superuser %}
<li><a href="{% url 'driver_list' %}">Drivers</a></li>
<li><a href="{% url 'customer_list' %}">Customers</a></li>
- <li><a href="/admin">DjangoAdmin</a></li>
{% else %}
<li><a href="{% url 'driver_summary' request.user.id %}">Summary</a>
<li><a href="{% url 'driver_details' request.user.id %}">My Account</a></li>