From 8ec6c2008c6237067238a8ffad61b18610ae96ea Mon Sep 17 00:00:00 2001 From: Spencer Romo Date: Sun, 14 Aug 2016 23:47:57 -0500 Subject: [PATCH] Bunch of things. More to do --- banded/backend.py | 5 +++++ banded/settings.py | 12 +++++------- banded/views.py | 8 +++++++- static/css/base.css | 3 +++ static/templates/base.html | 1 + static/templates/login.html | 4 ++-- users/views.py | 4 +--- 7 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 static/css/base.css diff --git a/banded/backend.py b/banded/backend.py index 2bc1972..23522b0 100644 --- a/banded/backend.py +++ b/banded/backend.py @@ -1,5 +1,10 @@ from django.contrib.auth.models import User + + +''' +Custom backend to handle authentication with only email and password. +''' class EmailAuth: def authenticate(self, email = '', password = ''): try: diff --git a/banded/settings.py b/banded/settings.py index 145aa02..5ee8919 100644 --- a/banded/settings.py +++ b/banded/settings.py @@ -132,13 +132,11 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ -STATIC_URL = "https://%s/static/" % AWS_S3_CUSTOM_DOMAIN -PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) -STATIC_ROOT = os.path.join(BASE_DIR, 'static') -STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' - - - +STATIC_URL = '/static/' +STATIC_ROOT = os.path.dirname(BASE_DIR) +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, "static"), +) diff --git a/banded/views.py b/banded/views.py index e745d0d..813ce3a 100644 --- a/banded/views.py +++ b/banded/views.py @@ -1,10 +1,16 @@ from django.shortcuts import render from django.template.context import RequestContext + + +''' +Holders for testing endpoints. This will eventually only be home to the '/' +view. + +''' def home(request): return render(request, 'home.html') - def loginTest(request): return render(request, 'login.html') diff --git a/static/css/base.css b/static/css/base.css new file mode 100644 index 0000000..ce519a5 --- /dev/null +++ b/static/css/base.css @@ -0,0 +1,3 @@ +.test { + font-size: 60px; +} \ No newline at end of file diff --git a/static/templates/base.html b/static/templates/base.html index c63f97c..fb6c247 100644 --- a/static/templates/base.html +++ b/static/templates/base.html @@ -11,6 +11,7 @@ + diff --git a/static/templates/login.html b/static/templates/login.html index 4134feb..f77a813 100644 --- a/static/templates/login.html +++ b/static/templates/login.html @@ -3,13 +3,13 @@ {% if form.errors %}

Error

{% endif %} - +

Boom

{% csrf_token %} - + diff --git a/users/views.py b/users/views.py index 197e6bd..73277e9 100644 --- a/users/views.py +++ b/users/views.py @@ -4,13 +4,11 @@ # Create your views here. - +#TODO:remove print statements, and properly handle the redirect. def authorization(request): try: em = request.POST.get('email', '') - print 'em: ', em pw = request.POST.get('password', '') - print 'pw: ', pw user = authenticate(email = em, password = pw) if user is not None: print 'user successfully logged in'