diff --git a/gulashromstore/settings.py b/gulashromstore/settings.py index b851fcd..f8dbca8 100644 --- a/gulashromstore/settings.py +++ b/gulashromstore/settings.py @@ -130,8 +130,6 @@ STATICFILES_DIRS = [ MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') - +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' AUTH_USER_MODEL = 'users.User' - -SLOT_COUNT = 7 diff --git a/templates/base.html b/templates/base.html index 3cc6152..37a2920 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,7 +4,7 @@ - Gulashromstore Mockup + Gulashromstore :: {% block title %}{% endblock %} diff --git a/users/forms.py b/users/forms.py index cc0eb1a..b75a82e 100644 --- a/users/forms.py +++ b/users/forms.py @@ -25,7 +25,7 @@ class UserCreateForm(ModelForm): def clean_email(self): #Make sure Email is unique email = self.cleaned_data.get("email") - if User.objects.filter(email = email): + if get_user_model().objects.filter(email = email): raise forms.ValidationError("Email already in use.") return email @@ -77,7 +77,7 @@ class UserUpdateForm(ModelForm): def clean_email(self): #Make sure Email is still unique email = self.cleaned_data.get("email") - if User.objects.filter(email = email).exclude(id=self.instance.id): + if get_user_model().objects.filter(email = email).exclude(id=self.instance.id): raise forms.ValidationError("Email already in use.") return email diff --git a/users/templates/users/check_confirmation.html b/users/templates/users/check_confirmation.html new file mode 100644 index 0000000..00f4ea9 --- /dev/null +++ b/users/templates/users/check_confirmation.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block title %}Registerierung abgeschlossen{% endblock %} + +{% block content %} +
+
+
+
+

Registerierung abgeschlossen

+ Okay {{confirm_user.username}},
+ Danke fürs mitspielen. + Deine Registrierung ist jetzt abgeschlossen.
+
+ Jetzt kannst du dich einloggen. +
+
+
+
+{% endblock %} diff --git a/users/templates/users/confirmation_email.txt b/users/templates/users/confirmation_email.txt new file mode 100644 index 0000000..0f90f4c --- /dev/null +++ b/users/templates/users/confirmation_email.txt @@ -0,0 +1,7 @@ +Hallo, {{user.username}}, +Danke für die registrierung im Romstore. + +Um deinen Account zu aktiveren klicke bitte auf den folgenden Link: +{{validation_link}} + +Viel Spaß! diff --git a/users/templates/users/login.html b/users/templates/users/login.html new file mode 100644 index 0000000..d1840fa --- /dev/null +++ b/users/templates/users/login.html @@ -0,0 +1,83 @@ +{% extends "base.html" %} + +{% block title %}Einloggen{% endblock %} + +{% block content %} +
+
+
+
+

Einloggen

+ {% if user.is_authenticated %} + Du bist doch schon eingeloggt!?
+ Meinten sie: ausloggen ? + {% else %} +
+ {% csrf_token %} + +
+
+ +
+
+
+
+ + + + + + {% if form.username.errors %} + + {% endif %} + +
+

+ {{form.username.errors.as_text}} +

+
+
+
+ +
+
+ +
+
+
+
+ + + + + + {% if form.password.errors %} + + {% endif %} + +
+

+ {{form.password.errors.as_text}} +

+
+
+
+ +
+

+ +

+
+

+ Och Mist, ich hab mein + Passwort vergessen ... + {% endif %} +
+
+
+
+{% endblock %} diff --git a/users/templates/users/password_reset.html b/users/templates/users/password_reset.html new file mode 100644 index 0000000..2f80499 --- /dev/null +++ b/users/templates/users/password_reset.html @@ -0,0 +1,56 @@ +{% extends "base.html" %} + +{% block title %}Passwort zurücksetzen{% endblock %} + +{% block content %} +
+
+
+
+

Passwort zurücksetzen

+ {% if user.is_authenticated %} + Du bist doch schon eingeloggt!?
+ Und hast trotzdem dein Passwort vergessen?
+ Von mir aus, dann log dich erstm aus. + {% else %} +
+ {% csrf_token %} + +
+
+ +
+
+
+
+ + + + + + {% if form.email.errors %} + + {% endif %} + +
+

+ {{form.email.errors.as_text}} +

+
+
+
+ +
+

+ +

+
+
+ {% endif %} +
+
+
+
+{% endblock %} diff --git a/users/templates/users/password_reset_sent.html b/users/templates/users/password_reset_sent.html new file mode 100644 index 0000000..1c1d989 --- /dev/null +++ b/users/templates/users/password_reset_sent.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}Email zum Passwort zurücksetzen gesendet{% endblock %} + +{% block content %} +
+
+
+
+

Email verschickt

+ Du solltest jetzt eine Mail mit einem Link zum Passwort zurücksetzen bekommen haben. +
+
+
+
+{% endblock %} diff --git a/users/templates/users/send_confirmation.html b/users/templates/users/send_confirmation.html new file mode 100644 index 0000000..9110799 --- /dev/null +++ b/users/templates/users/send_confirmation.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} + +{% block title %}Registerierung bestätigen{% endblock %} + +{% block content %} +
+
+
+
+

Registerierung bestätigen

+ Hallo {{confirm_user.username}},
+ um deine Registerung abzuschließen klicke bitte auf den Link in der Email + die du gerade bekommen hast.
+
+ Keine Mail bekommen?
+ Dann klicke hier + um eine neue Email zu verschicken. +
+
+
+
+{% endblock %} diff --git a/users/templates/users/signup.html b/users/templates/users/signup.html index a37a6c2..c218e60 100644 --- a/users/templates/users/signup.html +++ b/users/templates/users/signup.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block title %} Sign up{% endblock %} +{% block title %}Registrieren{% endblock %} {% block content %}
@@ -15,6 +15,7 @@ {% else %}
{% csrf_token %} +
diff --git a/users/urls.py b/users/urls.py index 02eac92..63a426f 100644 --- a/users/urls.py +++ b/users/urls.py @@ -17,7 +17,7 @@ urlpatterns = [ 'post_reset_redirect' : reverse_lazy('password_reset_sent')}, name='password_reset'), - url(r'^password/reset/(?P[0-9A-Za-z]+)/(?P.+)/$', password_reset_confirm, + url(r'^password/reset/(?P[0-9A-Za-z]+)/(?P.+)/$', password_reset_confirm, {'template_name' : 'users/password_reset_confirm.html', 'post_reset_redirect' : reverse_lazy('login')}, name='password_reset_confirm'),