Mercurial > public > sg101
view accounts/urls.py @ 943:cf9918328c64
Haystack tweaks for Django 1.7.7.
I had to upgrade to Haystack 2.3.1 to get it to work with Django
1.7.7. I also had to update the Xapian backend. But I ran into
problems.
On my laptop anyway (Ubuntu 14.0.4), xapian gets mad when search terms
are greater than 245 chars (or something) when indexing. So I created
a custom field that would simply omit terms greater than 64 chars and
used this field everywhere I previously used a CharField.
Secondly, the custom search form was broken now. Something changed in
the Xapian backend and exact searches stopped working. Fortunately the
auto_query (which I was using originally and broke during an upgrade)
started working again. So I cut the search form back over to doing an
auto_query. I kept the form the same (3 fields) because I didn't want
to change the form and I think it's better that way.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 13 May 2015 20:25:07 -0500 |
parents | be233ba7ca31 |
children | 5ba2508939f7 |
line wrap: on
line source
"""urls for the accounts application""" from django.conf.urls import patterns, url from django.conf import settings from django.views.generic import TemplateView urlpatterns = patterns('accounts.views', url(r'^register/$', 'register', name='accounts-register'), url(r'^register/1/$', 'register1', name='accounts-register1'), url(r'^register/2/$', 'register2', name='accounts-register2'), url(r'^register/code/$', 'get_code', name='accounts-code'), url(r'^register/thanks/$', 'register_thanks', name='accounts-register_thanks'), url(r'^register/confirm/(?P<username>[\w.@+-]{1,30})/(?P<key>[a-zA-Z0-9]{20})/$', 'register_confirm', name='accounts-register_confirm'), ) urlpatterns += patterns('', url(r'^login/$', 'django.contrib.auth.views.login', kwargs={'template_name': 'accounts/login.html'}, name='accounts-login'), url(r'^logout/$', 'django.contrib.auth.views.logout', kwargs={'template_name': 'accounts/logout.html'}, name='accounts-logout'), (r'^password/$', 'django.contrib.auth.views.password_change', {'template_name': 'accounts/password_change.html', 'post_change_redirect': settings.LOGIN_REDIRECT_URL}), url(r'^password/reset/$', 'django.contrib.auth.views.password_reset', kwargs={'template_name': 'accounts/password_reset.html', 'email_template_name': 'accounts/password_reset_email.txt', 'post_reset_redirect': '/accounts/password/reset/sent/'}, name='accounts-password_reset'), url(r'^password/reset/sent/$', 'django.contrib.auth.views.password_reset_done', kwargs={'template_name': 'accounts/password_reset_sent.html'}, name='accounts-password_reset_sent'), url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z]+-\w+)/$', 'django.contrib.auth.views.password_reset_confirm', kwargs={ 'template_name': 'accounts/password_reset_confirm.html', 'post_reset_redirect': '/accounts/password/reset/success/', }, name='accounts-password_reset_confirm'), url(r'^password/reset/success/$', 'django.contrib.auth.views.password_reset_complete', kwargs={'template_name': 'accounts/password_reset_complete.html'}, name='accounts-password_reset_success'), url(r'^username/query/$', 'accounts.views.username_query', name='accounts-username_query'), url(r'^username/sent/$', TemplateView.as_view(template_name='accounts/username_sent.html'), name='accounts-username_sent'), )