diff --git a/euscanwww/djeuscan/templates/_base.html b/euscanwww/djeuscan/templates/_base.html index e2bcd44..052abd0 100644 --- a/euscanwww/djeuscan/templates/_base.html +++ b/euscanwww/djeuscan/templates/_base.html @@ -52,6 +52,15 @@
  • ---
  • API
  • About
  • +
  • ---
  • + + {% if user.is_authenticated %} +
  • Welcome {{ user }}
  • +
  • Logout
  • + {% else %} +
  • Login
  • +
  • Register
  • + {% endif %} {% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/_registration_base.html b/euscanwww/djeuscan/templates/registration/_registration_base.html new file mode 100644 index 0000000..9789436 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/_registration_base.html @@ -0,0 +1 @@ +{% extends "_base.html" %} diff --git a/euscanwww/djeuscan/templates/registration/activate.html b/euscanwww/djeuscan/templates/registration/activate.html new file mode 100644 index 0000000..2e47513 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/activate.html @@ -0,0 +1,13 @@ +{% extends "registration/_registration_base.html" %} + +{% block title %}{% if account %}Activation complete{% else %}Activation problem{% endif %}{% endblock %} + +{% block content %} + {% if account %} + Thanks {{ account }}, activation complete! You may now login + using the username and password you set at registration. + {% else %} + Oops – it seems that your activation key is invalid. + Please check the url again. + {% endif %} +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/activation_complete.html b/euscanwww/djeuscan/templates/registration/activation_complete.html new file mode 100644 index 0000000..9d53ca9 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/activation_complete.html @@ -0,0 +1,6 @@ +{% extends "registration/_registration_base.html" %} +{% block title %}Activation complete{% endblock %} +{% block content %} + Thanks, activation complete! You may now login + using the username and password you set at registration. +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/activation_email.txt b/euscanwww/djeuscan/templates/registration/activation_email.txt new file mode 100644 index 0000000..2e4d942 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/activation_email.txt @@ -0,0 +1,11 @@ +You (or someone pretending to be you) have asked to register an account at +{{ site.name }}. If this wasn't you, please ignore this email +and your address will be removed from our records. + +To activate this account, please click the following link within the next +{{ expiration_days }} days: + +http://{{site.domain}}{% url registration_activate activation_key %} + +Sincerely, +{{ site.name }} Management diff --git a/euscanwww/djeuscan/templates/registration/activation_email_subject.txt b/euscanwww/djeuscan/templates/registration/activation_email_subject.txt new file mode 100644 index 0000000..13912aa --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/activation_email_subject.txt @@ -0,0 +1 @@ +Account registration for {{ site.name }} diff --git a/euscanwww/djeuscan/templates/registration/login.html b/euscanwww/djeuscan/templates/registration/login.html new file mode 100644 index 0000000..d2e3547 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/login.html @@ -0,0 +1,28 @@ +{% extends "registration/_registration_base.html" %} +{% load url from future %} +{% load i18n %} + +{% block content %} + + {% if form.errors %} +

    Your username and password didn't match. Please try again.

    + {% endif %} + +
    + {% csrf_token %} + + + + + + + + + +
    {{ form.username.label_tag }}{{ form.username }}
    {{ form.password.label_tag }}{{ form.password }}
    + + + +
    + +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/logout.html b/euscanwww/djeuscan/templates/registration/logout.html new file mode 100644 index 0000000..03746d0 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/logout.html @@ -0,0 +1,13 @@ +{% extends "registration/_registration_base.html" %} +{% load i18n %} + +{% block content %} + +

    You're logged out."

    +

    Redirect...

    + + + +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_change_done.html b/euscanwww/djeuscan/templates/registration/password_change_done.html new file mode 100644 index 0000000..e223576 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_change_done.html @@ -0,0 +1,6 @@ +{% extends "registration/_registration_base.html" %} +{% block title %}Password changed{% endblock %} + +{% block content %} + Password successfully changed! +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_change_form.html b/euscanwww/djeuscan/templates/registration/password_change_form.html new file mode 100644 index 0000000..3bb9bb8 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_change_form.html @@ -0,0 +1,16 @@ +{% extends "registration/_registration_base.html" %} +{% block title %}Change password{% endblock %} + +{% block content %} +
    {% csrf_token %} + + {{ form }} + + + + +
    + +
    +
    +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_reset_complete.html b/euscanwww/djeuscan/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..932dabf --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_reset_complete.html @@ -0,0 +1,7 @@ +{% extends "registration/_registration_base.html" %} + +{% block title %}Password reset complete{% endblock %} + +{% block content %} + Your password has been reset! You may now log in. +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_reset_confirm.html b/euscanwww/djeuscan/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..653319b --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_reset_confirm.html @@ -0,0 +1,15 @@ +{% extends "registration/_registration_base.html" %} +{% block title %}Confirm password reset{% endblock %} + +{% block content %} + Enter your new password below to reset your password: +
    {% csrf_token %} + + {{ form.as_table }} + + + + +
    +
    +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_reset_done.html b/euscanwww/djeuscan/templates/registration/password_reset_done.html new file mode 100644 index 0000000..a263a5f --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_reset_done.html @@ -0,0 +1,10 @@ +{% extends "registration/_registration_base.html" %} + +{% block title %}Password reset{% endblock %} + +{% block content %} +

    + We have sent you an email with a link to reset your password. Please check + your email and click the link to continue. +

    +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/password_reset_email.html b/euscanwww/djeuscan/templates/registration/password_reset_email.html new file mode 100644 index 0000000..54fefff --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_reset_email.html @@ -0,0 +1,16 @@ +Greetings {% if user.get_full_name %}{{ user.get_full_name }}{% else %}{{ user }}{% endif %}, + +You are receiving this email because you (or someone pretending to be you) +requested that your password be reset on the {{ domain }} site. If you do not +wish to reset your password, please ignore this message. + +To reset your password, please click the following link, or copy and paste it +into your web browser: + +{{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uid token %} + +Your username, in case you've forgotten: {{ user.username }} + + +Best regards, +{{ site_name }} Management diff --git a/euscanwww/djeuscan/templates/registration/password_reset_form.html b/euscanwww/djeuscan/templates/registration/password_reset_form.html new file mode 100644 index 0000000..ae5c25b --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/password_reset_form.html @@ -0,0 +1,18 @@ +{% extends "registration/_registration_base.html" %} + +{% block title %}Reset password{% endblock %} + +{% block content %} + Forgot your password? Enter your email in the form below and we'll send you + instructions for creating a new one. + +
    {% csrf_token %} + + {{ form }} + + + + +
    +
    +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/registration_complete.html b/euscanwww/djeuscan/templates/registration/registration_complete.html new file mode 100644 index 0000000..ae8dfcb --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/registration_complete.html @@ -0,0 +1,6 @@ +{% extends "registration/_registration_base.html" %} +{% block title %}Activation email sent{% endblock %} + +{% block content %} + An activation email has been sent. Please check your email and click on the link to activate your account. +{% endblock %} diff --git a/euscanwww/djeuscan/templates/registration/registration_form.html b/euscanwww/djeuscan/templates/registration/registration_form.html new file mode 100644 index 0000000..c9ae8e4 --- /dev/null +++ b/euscanwww/djeuscan/templates/registration/registration_form.html @@ -0,0 +1,19 @@ +{% extends "registration/_registration_base.html" %} + +{% block title %} + Register for an account +{% endblock %} + +{% block content %} + + {% csrf_token %} + {{ form }} + + + + + +
    + +
    +{% endblock %} diff --git a/euscanwww/euscanwww/settings.py b/euscanwww/euscanwww/settings.py index d5f0ff6..6cae613 100644 --- a/euscanwww/euscanwww/settings.py +++ b/euscanwww/euscanwww/settings.py @@ -170,6 +170,7 @@ INSTALLED_APPS = ( # 'django.contrib.admindocs', 'south', 'djcelery', + 'registration', ) # A sample logging configuration. The only tangible logging @@ -201,6 +202,7 @@ LOGGING = { } } +ACCOUNT_ACTIVATION_DAYS = 7 PORTAGE_ROOT = "/usr/portage/" PORTAGE_CONFIGROOT = PORTAGE_ROOT diff --git a/euscanwww/euscanwww/urls.py b/euscanwww/euscanwww/urls.py index 767d375..dffb5a3 100644 --- a/euscanwww/euscanwww/urls.py +++ b/euscanwww/euscanwww/urls.py @@ -10,6 +10,7 @@ urlpatterns = patterns('', # (r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), + url(r'^accounts/', include('registration.backends.default.urls')), url(r'^', include('djeuscan.urls')), ) diff --git a/setup.py b/setup.py index 240f459..c6adb5f 100755 --- a/setup.py +++ b/setup.py @@ -89,7 +89,8 @@ setup( ), install_requires=['Django==1.4', 'django-annoying==0..7.6', 'South==0.7.4', 'django-piston==0.2.3', 'BeautifulSoup==3.2.1', - 'matplotlib==1.1.0', 'django-celery==2.5.5'], + 'matplotlib==1.1.0', 'django-celery==2.5.5', + 'django-registration==0.8'], package_dir={'': 'pym'}, packages=packages, package_data={},