diff --git a/accounts/urls.py b/accounts/urls.py index 950f0d7..6c6a78a 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -1,4 +1,3 @@ -from django.views.generic.simple import direct_to_template from django.conf.urls.defaults import * from accounts import views diff --git a/requirements.txt b/requirements.txt index d14c79e..837ff15 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ boto -Django==1.4.5 +Django django-annoying django-bcrypt django-debug-toolbar django-extensions django-markdown-deux django-pagination -django-tastypie==0.9.12 +django-tastypie django-taggit django-templatetag-sugar fabric diff --git a/settings.py b/settings.py index 95ad1b1..ea6c17e 100644 --- a/settings.py +++ b/settings.py @@ -42,6 +42,7 @@ USE_L10N = True # the operating system. On a Windows environment, this must be set to the same # as your system time zone TIME_ZONE = 'America/New_York' +USE_TZ = True # Language code for the Django installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html diff --git a/templates/registration/login.html b/templates/registration/login.html index 783d288..16c8389 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -5,9 +5,9 @@ {% block body-class %}{{ block.super }} static login{% endblock %} {% block content %} -
+
- Notice: OpenID is no longer supported. You can reset your password here. + Notice: OpenID is no longer supported. You can reset your password here.
{% if request.GET.activationcomplete %}
@@ -55,7 +55,7 @@
Sign up - Reset password + Reset password
diff --git a/templates/registration/logout.html b/templates/registration/logout.html index ccf6f6a..395f24a 100644 --- a/templates/registration/logout.html +++ b/templates/registration/logout.html @@ -7,7 +7,7 @@ {% block content %}
- Successfully logged out. Log in again? + Successfully logged out. Log in again?
{% endblock %} diff --git a/templates/registration/password_reset_email.html b/templates/registration/password_reset_email.html index 6b7b4ad..909360e 100644 --- a/templates/registration/password_reset_email.html +++ b/templates/registration/password_reset_email.html @@ -1,3 +1,3 @@ -Reset your Snipt password here: {{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uid token %} +Reset your Snipt password here: {{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uid token %} (btw, your username is "{{ user }}") diff --git a/urls.py b/urls.py index 6b1367c..e0737f3 100644 --- a/urls.py +++ b/urls.py @@ -1,7 +1,7 @@ from views import (homepage, lexers, pro_signup, sitemap, tags, pro_signup_complete) from django.conf.urls.defaults import include, patterns, url -from django.views.generic.simple import direct_to_template -from utils.forms import SniptRegistrationForm +from utils.views import SniptRegistrationView +from django.views.generic import TemplateView from django.http import HttpResponseRedirect from django.contrib import admin from snipts.views import search @@ -31,15 +31,15 @@ urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), - url(r'^404/$', direct_to_template, {'template': '404.html'}), - url(r'^500/$', direct_to_template, {'template': '500.html'}), + url(r'^404/$', TemplateView.as_view(template_name='404.html')), + url(r'^500/$', TemplateView.as_view(template_name='500.html')), - url(r'^robots.txt$', direct_to_template, {'template': 'robots.txt'}), - url(r'^humans.txt$', direct_to_template, {'template': 'humans.txt'}), + url(r'^robots.txt$', TemplateView.as_view(template_name='robots.txt')), + url(r'^humans.txt$', TemplateView.as_view(template_name='humans.txt')), url(r'^sitemap.xml$', sitemap), url(r'^tags/$', tags), - url(r'^pro/$', direct_to_template, {'template': 'pro.html'}), + url(r'^pro/$', TemplateView.as_view(template_name='pro.html')), url(r'^pro/signup/$', pro_signup), url(r'^pro/signup/complete/$', pro_signup_complete), @@ -54,10 +54,7 @@ urlpatterns = patterns('', url(r'^register/$', lambda x: HttpResponseRedirect('/signup/')), url(r'^signup/$', - 'registration.views.register', { - 'backend': 'registration.backends.default.DefaultBackend', - 'form_class': SniptRegistrationForm, - }, + SniptRegistrationView.as_view(), name='registration_register'), url(r'', include('registration.backends.default.urls')), diff --git a/utils/forms.py b/utils/forms.py index de82c5c..92bfd1f 100644 --- a/utils/forms.py +++ b/utils/forms.py @@ -7,7 +7,7 @@ from django import forms class SniptRegistrationForm(RegistrationForm): """ Subclass of ``RegistrationForm`` which enforces uniqueness of - email addresses. + email addresses and further restricts usernames. """ def clean_username(self): diff --git a/utils/models.py b/utils/models.py deleted file mode 100644 index e69de29..0000000 diff --git a/utils/views.py b/utils/views.py index 60f00ef..7204558 100644 --- a/utils/views.py +++ b/utils/views.py @@ -1 +1,9 @@ -# Create your views here. +from registration.backends.default.views import RegistrationView +from utils.forms import SniptRegistrationForm + +class SniptRegistrationView(RegistrationView): + """ + Custom registration view that uses our custom form. + + """ + form_class = SniptRegistrationForm