Skip to content

Commit cb0d37f

Browse files
committed
Registration is working
1 parent 6b3f87a commit cb0d37f

File tree

10 files changed

+91
-24
lines changed

10 files changed

+91
-24
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% extends "base.html" %}
2+
3+
{% block scripts %}
4+
{% endblock %}
5+
6+
{% block main_content %}
7+
8+
<h1>Account activated.</h1>
9+
{% load humanize %}
10+
{% if account %}
11+
<p>Thanks for signing up! Now you can <a href="/accounts/login/">log in</a>.</p>
12+
{% else %}
13+
<p>Sorry, it didn't work. Either your activation link was incorrect, or
14+
the activation key for your account has expired; activation keys are
15+
only valid for {{ expiration_days|apnumber }} days after
16+
registration.</p>
17+
{% endif %}
18+
19+
{% endblock %}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "base.html" %}
2+
3+
{% block scripts %}
4+
{% endblock %}
5+
6+
{% block main_content %}
7+
<h3>All done!</h>
8+
<p>You are now registered!<br /><br />
9+
Click <a href="/">here</a> to go to your homepage</p>
10+
{% endblock %}
11+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Someone, hopefully you, signed up for an account at Ravenous using this email address. To activate your account, click the link below, or paste it into your browser's address bar:
2+
3+
http://ravenous.alexravenel.com/accounts/activate/{{ activation_key }}
4+
5+
If not activated, this account will expire automatically in {{ expiration_days }} days.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Activate your Ravenous account!
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
3+
{% block scripts %}
4+
{% endblock %}
5+
6+
{% block main_content %}
7+
<h3>Sorry!</h>
8+
<p>Registration is closed at this time. Please try again in the future!</p>
9+
{% endblock %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
3+
{% block scripts %}
4+
{% endblock %}
5+
6+
{% block main_content %}
7+
<h3>Thanks!</h>
8+
<p>An email has been sent with details to confirm your registration.</p>
9+
{% endblock %}

WeeklyMenus/templates/registration/registration_form.html

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,26 @@
1010
{% endif %}
1111

1212
<h2>Register for an account on Ravenous</h>
13-
13+
1414
<form class="form-horizontal" method="post" action="">
1515
{% csrf_token %}
16-
<div class="control-group">
17-
<label class="control-label" for="id_username">Username</label>
18-
<div class="controls">
19-
<input type="text" id="username" placeholder="Username">
20-
</div>
21-
</div>
22-
<div class="control-group">
23-
<label class="control-label" for="id_email">Email Address</label>
24-
<div class="controls">
25-
<input type="text" id="email" placeholder="Email address">
26-
</div>
27-
</div>
28-
<div class="control-group">
29-
<label class="control-label" for="id_password1">Password</label>
30-
<div class="controls">
31-
<input type="password" id="password1" placeholder="Password">
32-
</div>
33-
</div>
34-
<div class="control-group">
35-
<label class="control-label" for="id_password2">Password Confirmation</label>
36-
<div class="controls">
37-
<input type="password" id="password2" placeholder="Password (again)">
16+
17+
{% for field in form %}
18+
<div class="control-group {% if field.errors %}error{% endif %}">
19+
<label class="control-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
20+
<div class="controls">
21+
{{ field }}
22+
{% if field.errors %}
23+
<span class="help-inline">
24+
{% for error in field.errors %}
25+
{{ error }}<br />
26+
{% endfor %}
27+
</span>
28+
{% endif %}
29+
</div>
3830
</div>
39-
</div>
31+
{% endfor %}
32+
4033

4134
<div class="control-group">
4235
<div class="controls">

settings/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,5 @@
338338
#Valid number of recipes per page
339339
VALID_RECIPES_PERPAGE = [20, 40, 100]
340340

341+
#Days before account expires
342+
ACCOUNT_ACTIVATION_DAYS = 14

settings/prod.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@
6868
MEDIA_ROOT = '/srv/www/menus-prod/media'
6969
MEDIA_URL = '/media/'
7070

71+
EMAIL_HOST = 'localhost'
72+
EMAIL_PORT = 1025
73+
EMAIL_HOST_USER = ''
74+
EMAIL_HOST_PASSWORD = ''
75+
EMAIL_USE_TLS = False
76+
DEFAULT_FROM_EMAIL = '[email protected]'
77+
78+
REGISTRATION_OPEN = False
79+
7180
# LOGGING['handlers']['logfile']['filename'] = r'/srv/www/menus-dev/http/logs/logfile.log'
7281
# LOGGING['handlers']['debug_logfile']['filename'] = r'/srv/www/menus-dev/http/logs/debug_logfile.log'
7382
# LOGGING['handlers']['default_logger']['filename'] = r'/srv/www/menus-dev/http/logs/default.log'

settings/vagrant.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@
6868
MEDIA_ROOT = '/srv/www/menus-dev/media'
6969
MEDIA_URL = '/media/'
7070

71+
EMAIL_HOST = 'localhost'
72+
EMAIL_PORT = 1025
73+
EMAIL_HOST_USER = ''
74+
EMAIL_HOST_PASSWORD = ''
75+
EMAIL_USE_TLS = False
76+
DEFAULT_FROM_EMAIL = '[email protected]'
77+
78+
REGISTRATION_OPEN = True
79+
7180
# LOGGING['handlers']['logfile']['filename'] = r'/srv/www/menus-dev/http/logs/logfile.log'
7281
# LOGGING['handlers']['debug_logfile']['filename'] = r'/srv/www/menus-dev/http/logs/debug_logfile.log'
7382
# LOGGING['handlers']['default_logger']['filename'] = r'/srv/www/menus-dev/http/logs/default.log'

0 commit comments

Comments
 (0)