added temporarily signup
This commit is contained in:
parent
50bee498ae
commit
95bf1c42a6
@ -29,17 +29,9 @@ def signup(request):
|
|||||||
'token': account_activation_token.make_token(user),
|
'token': account_activation_token.make_token(user),
|
||||||
})
|
})
|
||||||
|
|
||||||
res = send_mail(
|
send_mail(from_email="signup.basta@gmail.com", recipient_list=[user.email], subject=subject,
|
||||||
'Subject here',
|
message=message)
|
||||||
'Here is the message.',
|
return redirect('account_activation_sent')
|
||||||
'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')
|
|
||||||
else:
|
else:
|
||||||
form = SignUpForm()
|
form = SignUpForm()
|
||||||
return render(request, 'registration/signup.jinja', {'form': form})
|
return render(request, 'registration/signup.jinja', {'form': form})
|
||||||
@ -63,4 +55,4 @@ def activate(request, uidb64, token):
|
|||||||
|
|
||||||
|
|
||||||
def account_activation_sent(request):
|
def account_activation_sent(request):
|
||||||
return render(request, 'home.jinja', {})
|
return render(request, 'registration/account_activation_sent.jinja', {})
|
||||||
|
|||||||
@ -169,7 +169,7 @@ LOGIN_REDIRECT_URL = 'home'
|
|||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
EMAIL_HOST = 'smtp.gmail.com'
|
EMAIL_HOST = 'smtp.gmail.com'
|
||||||
EMAIL_HOST_USER = 'signup.basta@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_PORT = '587'
|
||||||
EMAIL_USE_TLS = True
|
EMAIL_USE_TLS = True
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
Hi {{ user.username }},
|
Hi {{ user.username }},
|
||||||
|
|
||||||
Please click on the link below to confirm your registration:
|
Please click on the link below to confirm your registration:
|
||||||
|
|
||||||
http://{{ domain }}{{ url('activate', args=[uid, token]) }}
|
http://{{ domain }}{{ url('activate', args=[uid, token]) }}
|
||||||
|
|
||||||
|
|
||||||
|
And a great welcome
|
||||||
|
The BaStA Team
|
||||||
{% endautoescape %}
|
{% endautoescape %}
|
||||||
12
ofu_app/templates/registration/account_activation_sent.jinja
Normal file
12
ofu_app/templates/registration/account_activation_sent.jinja
Normal 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 %}
|
||||||
@ -25,5 +25,10 @@
|
|||||||
<input type="submit" class="button is-pulled-right" value="Login"/>
|
<input type="submit" class="button is-pulled-right" value="Login"/>
|
||||||
<input type="hidden" name="next" value="{{ next }}"/>
|
<input type="hidden" name="next" value="{{ next }}"/>
|
||||||
</form>
|
</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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -5,19 +5,46 @@
|
|||||||
<h2>Sign up</h2>
|
<h2>Sign up</h2>
|
||||||
<form method="post" action="{{ url('signup') }}">
|
<form method="post" action="{{ url('signup') }}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% for field in form %}
|
<label for="username" class="label">Username:</label>
|
||||||
<p>
|
<p>
|
||||||
{{ field.label_tag }}<br>
|
<input id="username" type="text" name="username" required autofocus maxlength="150" id="id_username"/>
|
||||||
{{ field }}
|
<small style="color: grey">Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und
|
||||||
{% if field.help_text %}
|
@/./+/-/_.
|
||||||
<small style="color: grey">{{ field.help_text }}</small>
|
</small>
|
||||||
{% endif %}
|
|
||||||
{% for error in field.errors %}
|
|
||||||
<p style="color: red">{{ error }}</p>
|
|
||||||
{% endfor %}
|
|
||||||
</p>
|
</p>
|
||||||
{% endfor %}
|
|
||||||
<button type="submit">Sign up</button>
|
<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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user