Mercurial > public > sg101
annotate fabfile.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 | d9d6b4b8bab7 |
children |
rev | line source |
---|---|
bgneal@531 | 1 from fabric.api import cd, run |
bgneal@531 | 2 |
bgneal@655 | 3 PYTHON = '/svr/django-sites/sg101/bin/python' |
bgneal@655 | 4 PROJ_DIR = '/svr/django-sites/sg101/sg101' |
bgneal@531 | 5 |
bgneal@531 | 6 def update(): |
bgneal@531 | 7 """ |
bgneal@546 | 8 Runs hg pull --update to pull changes and update to them. |
bgneal@531 | 9 |
bgneal@531 | 10 """ |
bgneal@531 | 11 with cd(PROJ_DIR): |
bgneal@546 | 12 run('hg pull --update') |
bgneal@531 | 13 |
bgneal@531 | 14 |
bgneal@531 | 15 def collectstatic(): |
bgneal@531 | 16 """ |
bgneal@531 | 17 Runs the staticfiles collectstatic command to deploy static assets. |
bgneal@531 | 18 |
bgneal@531 | 19 """ |
bgneal@531 | 20 cmd = ('%s manage.py collectstatic ' |
bgneal@602 | 21 '--settings=sg101.settings.production --noinput') % PYTHON |
bgneal@531 | 22 |
bgneal@531 | 23 with cd(PROJ_DIR): |
bgneal@531 | 24 run(cmd) |
bgneal@531 | 25 |
bgneal@531 | 26 |
bgneal@531 | 27 def touch(): |
bgneal@531 | 28 """ |
bgneal@531 | 29 Touches the wsgi file to reload the Python code. |
bgneal@531 | 30 |
bgneal@531 | 31 """ |
bgneal@531 | 32 with cd(PROJ_DIR): |
bgneal@605 | 33 run('touch ./sg101/apache/sg101.wsgi') |