diff --git a/.gitignore b/.gitignore index 242c941..a55eb1e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .sass-cache .vagrant .venv +.whoosh_index *.log *.un~ diff --git a/README.md b/README.md index e1e0b5c..6f014e1 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ - `createuser snippets` - `createdb snippets --owner=snippets` - `cp settings_local.py-template settings_local.py` // modify if necessary -- `brew install elasticsearch` -- `brew services start elasticsearch` - `curl -X PUT "localhost:9200/haystack?pretty"` - `python manage.py update_index` // optional if you have a local DB dump with snippets - `make run` @@ -29,7 +27,6 @@ - `dokku config:set DOKKU_LETSENCRYPT_EMAIL=team@siftie.com SECRET_KEY= USE_SSL=true` - `git remote add dokku dokku@server.nicksergeant.com:snippets` - `git push dokku` -- Elasticsearch 2.x only! ## Automatic deploy to Heroku diff --git a/requirements.txt b/requirements.txt index 5a23d32..1c1692e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,8 @@ Django==1.11.18 Fabric==1.12.0 PyYAML==3.13 Pygments==2.1.3 +Whoosh==2.7.4 +black==18.9b0 certifi==2016.9.26 dj-database-url==0.4.1 dj-static==0.0.6 @@ -15,7 +17,6 @@ django-registration-redux==1.4 django-storages==1.5.1 django-taggit==0.21.3 django-tastypie==0.14 -elasticsearch>=2.0.0,<3.0.0 git+git://github.com/matagus/django-pagination-py3.git#egg=django-pagination git+git://github.com/nicksergeant/django-templatetag-sugar.git#egg=django-templatetag-sugar gunicorn==19.6.0 diff --git a/settings.py b/settings.py index 8d53029..b2a7219 100644 --- a/settings.py +++ b/settings.py @@ -3,39 +3,9 @@ from urllib.parse import urlparse import dj_database_url import os - if 'DATABASE_URL' in os.environ: - DATABASES = {'default': dj_database_url.config()} -if 'SEARCHBOX_SSL_URL' in os.environ: - - url = os.environ.get('SEARCHBOX_SSL_URL') - - es = urlparse(url) - - HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', - 'URL': es.scheme + '://' + es.hostname + ':443', - 'INDEX_NAME': 'snipts', - }, - } - - if es.username: - HAYSTACK_CONNECTIONS['default']['KWARGS'] = { - "http_auth": es.username + ':' + es.password - } - -else: - HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine' - } - } - - - ABSOLUTE_URL_OVERRIDES = {'auth.user': lambda u: "/%s/" % u.username} ACCOUNT_ACTIVATION_DAYS = 0 ADMINS = (('Siftie', 'team@siftie.com'),) diff --git a/settings_local.py-template b/settings_local.py-template index 9624114..e045285 100644 --- a/settings_local.py-template +++ b/settings_local.py-template @@ -16,10 +16,3 @@ DATABASES = { 'PORT': '' } } -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', - 'URL': 'http://127.0.0.1:9200/', - 'INDEX_NAME': 'haystack', - }, -}