From dfdf065a87020d7ee5eedc0fc55129a61d201ded Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 16:09:43 +0200 Subject: [PATCH 1/4] Add django-extensions --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 869811e..ee71975 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ Django==2.0.6 django-allauth==0.36.0 +django-extensions==2.0.7 From c8ad58f086d335f87266109ae24aa40bd110553b Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 16:17:41 +0200 Subject: [PATCH 2/4] Add django extensions to installed apps --- membersystem/settings/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/membersystem/settings/base.py b/membersystem/settings/base.py index f2a31f3..390e34f 100644 --- a/membersystem/settings/base.py +++ b/membersystem/settings/base.py @@ -36,10 +36,11 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sites', - 'profiles', - 'allauth', 'allauth.account', + 'django_extensions', + + 'profiles', ] MIDDLEWARE = [ From 7f41634987a91b69b7b3fcdd4d30e06f33e9d24f Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 20:18:54 +0200 Subject: [PATCH 3/4] Add a context processor that includes current site --- membersystem/context_processors.py | 10 ++++++++++ membersystem/settings/base.py | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 membersystem/context_processors.py diff --git a/membersystem/context_processors.py b/membersystem/context_processors.py new file mode 100644 index 0000000..31564b4 --- /dev/null +++ b/membersystem/context_processors.py @@ -0,0 +1,10 @@ +"""Context processors for the membersystem app.""" + +from django.contrib.sites.shortcuts import get_current_site + + +def current_site(request): + """Include the current site in the context.""" + return { + 'site': get_current_site(request) + } diff --git a/membersystem/settings/base.py b/membersystem/settings/base.py index 390e34f..13171ab 100644 --- a/membersystem/settings/base.py +++ b/membersystem/settings/base.py @@ -36,11 +36,13 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django.contrib.sites', + 'membersystem', + 'profiles', + 'allauth', 'allauth.account', + 'allauth.socialaccount', 'django_extensions', - - 'profiles', ] MIDDLEWARE = [ @@ -66,6 +68,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'membersystem.context_processors.current_site', ], }, }, From 567babc35984a658fef417dabb7d66a6b5a1efdb Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 20:19:37 +0200 Subject: [PATCH 4/4] Add a base template and some exquisite styling Wow! --- membersystem/static/css/membersystem.css | 79 ++++++++++++++++++++++++ membersystem/templates/base.html | 50 +++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 membersystem/static/css/membersystem.css create mode 100644 membersystem/templates/base.html diff --git a/membersystem/static/css/membersystem.css b/membersystem/static/css/membersystem.css new file mode 100644 index 0000000..cbf11d5 --- /dev/null +++ b/membersystem/static/css/membersystem.css @@ -0,0 +1,79 @@ +/* General styles */ +html +{ + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 2.5vmin; + background: #f8f8f8; +} + +body +{ + background: #fff; + color: #000; + margin: 1em auto; + max-width: 50em; + padding: 0 1em; + box-shadow: 0 0 2.5em rgba(0, 0, 0, 20%); +} + +header, +footer +{ + background: #eee; + padding: .5em; + margin: 0 -1em; +} + +footer +{ + margin-top: 2em; +} + + +header h1 +{ + font-size: 1em; + float: left; + padding: .5em .5em; + margin: 0; +} + +header ul, +footer ul +{ + list-style-type: none; + padding: 0; + margin: 0; + text-align: right; +} + +header ul li, +footer ul li +{ + display: inline; +} + +header ul li a, +footer ul li a +{ + display: inline-block; + margin: 0; + padding: .5em .5em; +} + + +/* Forms */ +label +{ + display: block; + padding: .5em 0; +} + +button, +input, +textarea +{ + font-size: inherit; +} diff --git a/membersystem/templates/base.html b/membersystem/templates/base.html new file mode 100644 index 0000000..0c21c7b --- /dev/null +++ b/membersystem/templates/base.html @@ -0,0 +1,50 @@ + +{% load static %} + +
+