Some initial work on gutting es
parent
0f8556a80a
commit
6af387be82
|
@ -2,6 +2,7 @@
|
||||||
.sass-cache
|
.sass-cache
|
||||||
.vagrant
|
.vagrant
|
||||||
.venv
|
.venv
|
||||||
|
.whoosh_index
|
||||||
|
|
||||||
*.log
|
*.log
|
||||||
*.un~
|
*.un~
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
- `createuser snippets`
|
- `createuser snippets`
|
||||||
- `createdb snippets --owner=snippets`
|
- `createdb snippets --owner=snippets`
|
||||||
- `cp settings_local.py-template settings_local.py` // modify if necessary
|
- `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"`
|
- `curl -X PUT "localhost:9200/haystack?pretty"`
|
||||||
- `python manage.py update_index` // optional if you have a local DB dump with snippets
|
- `python manage.py update_index` // optional if you have a local DB dump with snippets
|
||||||
- `make run`
|
- `make run`
|
||||||
|
@ -29,7 +27,6 @@
|
||||||
- `dokku config:set DOKKU_LETSENCRYPT_EMAIL=team@siftie.com SECRET_KEY=<some-secret-key> USE_SSL=true`
|
- `dokku config:set DOKKU_LETSENCRYPT_EMAIL=team@siftie.com SECRET_KEY=<some-secret-key> USE_SSL=true`
|
||||||
- `git remote add dokku dokku@server.nicksergeant.com:snippets`
|
- `git remote add dokku dokku@server.nicksergeant.com:snippets`
|
||||||
- `git push dokku`
|
- `git push dokku`
|
||||||
- Elasticsearch 2.x only!
|
|
||||||
|
|
||||||
## Automatic deploy to Heroku
|
## Automatic deploy to Heroku
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ Django==1.11.18
|
||||||
Fabric==1.12.0
|
Fabric==1.12.0
|
||||||
PyYAML==3.13
|
PyYAML==3.13
|
||||||
Pygments==2.1.3
|
Pygments==2.1.3
|
||||||
|
Whoosh==2.7.4
|
||||||
|
black==18.9b0
|
||||||
certifi==2016.9.26
|
certifi==2016.9.26
|
||||||
dj-database-url==0.4.1
|
dj-database-url==0.4.1
|
||||||
dj-static==0.0.6
|
dj-static==0.0.6
|
||||||
|
@ -15,7 +17,6 @@ django-registration-redux==1.4
|
||||||
django-storages==1.5.1
|
django-storages==1.5.1
|
||||||
django-taggit==0.21.3
|
django-taggit==0.21.3
|
||||||
django-tastypie==0.14
|
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/matagus/django-pagination-py3.git#egg=django-pagination
|
||||||
git+git://github.com/nicksergeant/django-templatetag-sugar.git#egg=django-templatetag-sugar
|
git+git://github.com/nicksergeant/django-templatetag-sugar.git#egg=django-templatetag-sugar
|
||||||
gunicorn==19.6.0
|
gunicorn==19.6.0
|
||||||
|
|
30
settings.py
30
settings.py
|
@ -3,39 +3,9 @@ from urllib.parse import urlparse
|
||||||
import dj_database_url
|
import dj_database_url
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
if 'DATABASE_URL' in os.environ:
|
if 'DATABASE_URL' in os.environ:
|
||||||
|
|
||||||
DATABASES = {'default': dj_database_url.config()}
|
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}
|
ABSOLUTE_URL_OVERRIDES = {'auth.user': lambda u: "/%s/" % u.username}
|
||||||
ACCOUNT_ACTIVATION_DAYS = 0
|
ACCOUNT_ACTIVATION_DAYS = 0
|
||||||
ADMINS = (('Siftie', 'team@siftie.com'),)
|
ADMINS = (('Siftie', 'team@siftie.com'),)
|
||||||
|
|
|
@ -16,10 +16,3 @@ DATABASES = {
|
||||||
'PORT': ''
|
'PORT': ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HAYSTACK_CONNECTIONS = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
|
|
||||||
'URL': 'http://127.0.0.1:9200/',
|
|
||||||
'INDEX_NAME': 'haystack',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue