added temporarily signup

This commit is contained in:
Götz 2017-10-29 22:29:45 +01:00
parent 50bee498ae
commit 95bf1c42a6
6 changed files with 66 additions and 27 deletions

View File

@ -29,17 +29,9 @@ def signup(request):
'token': account_activation_token.make_token(user),
})
res = send_mail(
'Subject here',
'Here is the message.',
'signup.basta@gmail.com',
['mgoetz1995@gmail.com'],
fail_silently=False,
)
# res = send_mail(from_email="signup.basta@gmail.com", recipient_list=[user.username], subject=subject, message=message)
return HttpResponse('%s' % res)
# user.email_user(subject, message)
# return redirect('account_activation_sent')
send_mail(from_email="signup.basta@gmail.com", recipient_list=[user.email], subject=subject,
message=message)
return redirect('account_activation_sent')
else:
form = SignUpForm()
return render(request, 'registration/signup.jinja', {'form': form})
@ -63,4 +55,4 @@ def activate(request, uidb64, token):
def account_activation_sent(request):
return render(request, 'home.jinja', {})
return render(request, 'registration/account_activation_sent.jinja', {})

View File

@ -169,7 +169,7 @@ LOGIN_REDIRECT_URL = 'home'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'signup.basta@gmail.com'
EMAIL_HOST_PASSWORD = '1/SL^QzlSuP<`8gkP4Fd'
EMAIL_HOST_PASSWORD = '1\SL^QzlSuP<`8gkP4Fd'
EMAIL_PORT = '587'
EMAIL_USE_TLS = True

View File

@ -2,6 +2,9 @@
Hi {{ user.username }},
Please click on the link below to confirm your registration:
http://{{ domain }}{{ url('activate', args=[uid, token]) }}
And a great welcome
The BaStA Team
{% endautoescape %}

View File

@ -0,0 +1,12 @@
{% extends 'base.jinja' %}
{% block headline %}<h3 class="text-center">BaStA Login</h3>{% endblock %}
{% block content %}
<div class="col-12 text-center p-3 bg-light text-dark">
<h3>Sent</h3>
<p>Your user account was created and the confirmation mail was sent</p>
<p>Please confirm your email address.</p>
<a href="{{ url('home') }}">Back to Home</a>
</div>
{% endblock %}

View File

@ -25,5 +25,10 @@
<input type="submit" class="button is-pulled-right" value="Login"/>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
</div>
<div class="col-12 text-center p-3 bg-light text-dark">
<p>Du hast noch keinen Account? <a href="{{ url('signup') }}">Hier</a> geht's zur Registrierung</p>
</div>
{% endblock %}

View File

@ -5,19 +5,46 @@
<h2>Sign up</h2>
<form method="post" action="{{ url('signup') }}">
{% csrf_token %}
{% for field in form %}
<p>
{{ field.label_tag }}<br>
{{ field }}
{% if field.help_text %}
<small style="color: grey">{{ field.help_text }}</small>
{% endif %}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
<button type="submit">Sign up</button>
<label for="username" class="label">Username:</label>
<p>
<input id="username" type="text" name="username" required autofocus maxlength="150" id="id_username"/>
<small style="color: grey">Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und
@/./+/-/_.
</small>
</p>
<label for="email" class="label">E-Mail:</label>
<p>
<input id="email" type="email" name="email" required maxlength="254" id="id_email"/>
<small style="color: grey">Required. Inform a valid email address.</small>
</p>
<label for="password1" class="label">Password:</label>
<p>
<input id="password1" type="password" name="password1" required id="id_password1"/>
<small style="color: grey">
<ul>
<li>Das Passwort darf nicht zu ähnlich zu Ihren anderen
persönlichen Informationen sein.
</li>
<li>Das Passwort muss mindestens 8 Zeichen
enthalten.
</li>
<li>Das Passwort darf nicht allgemein üblich sein.</li>
<li>Das
Passwort darf nicht komplett aus Ziffern bestehen.
</li>
</ul>
</small>
</p>
<label for="password2" class="label">Retype Password:</label>
<p>
<input id="password2" type="password" name="password2" required id="id_password2"/>
<small style="color: grey">Bitte das selbe Passwort zur Bestätigung erneut eingeben.</small>
</p>
<input type="submit" class="button is-pulled-right" value="Sign up"/>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
</div>
{% endblock %}