annotate user_photos/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 |
71d17d267e27 |
children |
4f265f61874b |
rev |
line source |
bgneal@695
|
1 """URLs for the user_photos application."""
|
bgneal@695
|
2 from django.conf.urls import patterns, url
|
bgneal@696
|
3 from django.views.generic import DetailView
|
bgneal@696
|
4
|
bgneal@696
|
5 from user_photos.models import Photo
|
bgneal@704
|
6 from user_photos.views import GalleryView
|
bgneal@696
|
7
|
bgneal@695
|
8
|
bgneal@704
|
9 urlpatterns = patterns('',
|
bgneal@704
|
10 url(r'^upload/$', 'user_photos.views.upload', name='user_photos-upload'),
|
bgneal@722
|
11 url(r'^upload-ajax/$',
|
bgneal@722
|
12 'user_photos.views.upload_ajax',
|
bgneal@722
|
13 name='user_photos-upload_ajax'),
|
bgneal@696
|
14 url(r'^photo/(?P<pk>\d+)/$',
|
bgneal@696
|
15 DetailView.as_view(model=Photo),
|
bgneal@704
|
16 name='user_photos-detail'),
|
bgneal@704
|
17 url(r'^gallery/(?P<username>[\w.@+-]{1,30})/$',
|
bgneal@704
|
18 GalleryView.as_view(),
|
bgneal@704
|
19 name='user_photos-gallery'),
|
bgneal@710
|
20 url(r'^delete/$', 'user_photos.views.delete', name='user_photos-delete'),
|
bgneal@695
|
21 )
|