diff --git a/.gitignore b/.gitignore index 1ab2623..7db42fd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ db.sqlite3 node_modules venv +settings.py diff --git a/README.md b/README.md index 70e741f..3b54f0d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ * https * cookies: secure, httpOnly -Client: +## Client: + * Rewrite client side code in Backbone.js * Start here: https://github.com/backbone-boilerplate/backbone-boilerplate * Backbone Extensions: diff --git a/duskenweb/__init__.py b/duskenweb/__init__.py index e69de29..edaec93 100644 --- a/duskenweb/__init__.py +++ b/duskenweb/__init__.py @@ -0,0 +1,9 @@ +import pydusken +from django.conf import settings + +# Init DuskenAPI +system_api_conn = pydusken.DuskenApi(settings.DUSKEN_CLIENT_ID, settings.DUSKEN_CLIENT_SECRET) +if not system_api_conn.is_authenticated(): + system_api_conn.authenticate(settings.DUSKEN_USERNAME, settings.DUSKEN_PASSWORD) + +user_api_conn = pydusken.DuskenApi(settings.DUSKEN_CLIENT_ID, settings.DUSKEN_CLIENT_SECRET) diff --git a/duskenweb/settings.py b/duskenweb/settings-sample.py similarity index 93% rename from duskenweb/settings.py rename to duskenweb/settings-sample.py index ccdc07a..410db7d 100644 --- a/duskenweb/settings.py +++ b/duskenweb/settings-sample.py @@ -104,12 +104,16 @@ USE_TZ = True STATIC_URL = '/static/' LOGIN_REDIRECT_URL = "/profile/" +LOGIN_URL = "/login/" -DUSKEN_CLIENT_ID = 'd802768a8afd9dec2660' -DUSKEN_CLIENT_SECRET = '3962467fe60a94727812053c8a4f44533f4ef610' +DUSKEN_CLIENT_ID = '' +DUSKEN_CLIENT_SECRET = '' +# Dusken API system user +DUSKEN_USERNAME = 'duskenweb' +DUSKEN_PASSWORD = '' CORS_ORIGIN_ALLOW_ALL = True -# Allow Ajax calls only from tuple of domain:port +# Allow Ajax calls only from domain:port #CORS_ORIGIN_WHITELIST = ( # '127.0.0.1:3000', # 'dusken.neuf.no:3000', diff --git a/duskenweb/static/css/app.css b/duskenweb/static/css/app.css index 29e9fa1..21555b3 100644 --- a/duskenweb/static/css/app.css +++ b/duskenweb/static/css/app.css @@ -1,6 +1,6 @@ /* line 1, ../sass/app.scss */ .title-header { - margin-bottom: 3em; + margin-bottom: 2em; } /* line 4, ../sass/app.scss */ @@ -30,7 +30,7 @@ top: 2px; padding-right: 6px; } -/* line 29, ../sass/app.scss */ +/* line 30, ../sass/app.scss */ .social-login .btn-facebook-login:hover, .social-login .btn-facebook-login:focus { background-color: #2f477a; color: white; diff --git a/duskenweb/static/sass/app.scss b/duskenweb/static/sass/app.scss index d6903fe..d76fe6e 100644 --- a/duskenweb/static/sass/app.scss +++ b/duskenweb/static/sass/app.scss @@ -1,5 +1,5 @@ .title-header { - margin-bottom: 3em; + margin-bottom: 2em; } .social-login { text-align: center; diff --git a/duskenweb/templates/base.html b/duskenweb/templates/base.html index 8f94e24..85d6a02 100644 --- a/duskenweb/templates/base.html +++ b/duskenweb/templates/base.html @@ -15,8 +15,7 @@