From e6d67c51a02c41cc83fe017a81466d5884c71ff0 Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 14:22:53 +0200 Subject: [PATCH 1/4] Add local database to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f23e651..d8b1a3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ __pycache__/ *.pyc *.sw* +db.sqlite3 From bd04b00c6dc008e56645fc6613baada681e098ca Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 14:59:12 +0200 Subject: [PATCH 2/4] Add a site ID and use the console e-mail backend --- membersystem/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/membersystem/settings.py b/membersystem/settings.py index 1faf641..794dc11 100644 --- a/membersystem/settings.py +++ b/membersystem/settings.py @@ -129,3 +129,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' + +SITE_ID = 1 + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' From 9ea4b827f49591825aac00d3b6f7889515e7bdcd Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 15:00:50 +0200 Subject: [PATCH 3/4] Add missing `on_delete` argument --- profiles/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/models.py b/profiles/models.py index cc701a4..275e626 100644 --- a/profiles/models.py +++ b/profiles/models.py @@ -2,4 +2,4 @@ from django.db import models class Profile(models.Model): - user = models.OneToOneField('auth.User') + user = models.OneToOneField('auth.User', on_delete=models.CASCADE) From 57f9d342da5eb7d7aeccb19615aa22ae591119af Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Sat, 23 Jun 2018 15:01:13 +0200 Subject: [PATCH 4/4] Include the allauth URLs --- membersystem/urls.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/membersystem/urls.py b/membersystem/urls.py index 68e20f9..ef67fa2 100644 --- a/membersystem/urls.py +++ b/membersystem/urls.py @@ -1,21 +1,10 @@ -"""membersystem URL Configuration +"""URLs for the membersystem""" -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/2.0/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" from django.contrib import admin -from django.urls import path +from django.conf.urls import url +from django.urls import include, path urlpatterns = [ + url(r'^accounts/', include('allauth.urls')), path('admin/', admin.site.urls), ]