Django - update_index updates both test and production sites
This is a weird one that I cannot figure out.
I have two databases - test and production.
I have two websites - test and production.
Django is using elasticsearch for the indexing.
They are running off of different servers, have different IP address, etc.
There is no link at all between the two databases. They are maintained independently.
However, when I run update_index
or rebuild_index
on either the production or test site, the indexes on BOTH sites are getting updates. The two databases still remain independent and the data there is not transferred at all.
It doesn't matter if I run the command on test or on production - both will be updated from either source.
This is obviously causing me many problems and I cannot for the life of me figure it out.
TEST DATABASE AND HAYSTACK CONNECTION -
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": <test-database>,
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200',
'INDEX_NAME': 'products_index'
PRODUCTION DATABASE AND HAYSTACK CONNECTION
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": "<production-database>",
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'products_index',
,
I've been tearing my hair out and can't seem to find how the two are possibly communicating and updating each other! Can anyone help me out?
django elasticsearch django-haystack
add a comment |
This is a weird one that I cannot figure out.
I have two databases - test and production.
I have two websites - test and production.
Django is using elasticsearch for the indexing.
They are running off of different servers, have different IP address, etc.
There is no link at all between the two databases. They are maintained independently.
However, when I run update_index
or rebuild_index
on either the production or test site, the indexes on BOTH sites are getting updates. The two databases still remain independent and the data there is not transferred at all.
It doesn't matter if I run the command on test or on production - both will be updated from either source.
This is obviously causing me many problems and I cannot for the life of me figure it out.
TEST DATABASE AND HAYSTACK CONNECTION -
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": <test-database>,
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200',
'INDEX_NAME': 'products_index'
PRODUCTION DATABASE AND HAYSTACK CONNECTION
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": "<production-database>",
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'products_index',
,
I've been tearing my hair out and can't seem to find how the two are possibly communicating and updating each other! Can anyone help me out?
django elasticsearch django-haystack
add a comment |
This is a weird one that I cannot figure out.
I have two databases - test and production.
I have two websites - test and production.
Django is using elasticsearch for the indexing.
They are running off of different servers, have different IP address, etc.
There is no link at all between the two databases. They are maintained independently.
However, when I run update_index
or rebuild_index
on either the production or test site, the indexes on BOTH sites are getting updates. The two databases still remain independent and the data there is not transferred at all.
It doesn't matter if I run the command on test or on production - both will be updated from either source.
This is obviously causing me many problems and I cannot for the life of me figure it out.
TEST DATABASE AND HAYSTACK CONNECTION -
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": <test-database>,
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200',
'INDEX_NAME': 'products_index'
PRODUCTION DATABASE AND HAYSTACK CONNECTION
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": "<production-database>",
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'products_index',
,
I've been tearing my hair out and can't seem to find how the two are possibly communicating and updating each other! Can anyone help me out?
django elasticsearch django-haystack
This is a weird one that I cannot figure out.
I have two databases - test and production.
I have two websites - test and production.
Django is using elasticsearch for the indexing.
They are running off of different servers, have different IP address, etc.
There is no link at all between the two databases. They are maintained independently.
However, when I run update_index
or rebuild_index
on either the production or test site, the indexes on BOTH sites are getting updates. The two databases still remain independent and the data there is not transferred at all.
It doesn't matter if I run the command on test or on production - both will be updated from either source.
This is obviously causing me many problems and I cannot for the life of me figure it out.
TEST DATABASE AND HAYSTACK CONNECTION -
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": <test-database>,
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200',
'INDEX_NAME': 'products_index'
PRODUCTION DATABASE AND HAYSTACK CONNECTION
DATABASES =
"default":
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.oracle",
# DB name or path to database file if using sqlite3.
"NAME": "--",
# Not used with sqlite3.
"USER": "--",
# Not used with sqlite3.
"PASSWORD": "--",
# Set to empty string for localhost. Not used with sqlite3.
"HOST": "<production-database>",
# Set to empty string for default. Not used with sqlite3.
"PORT": "--",
HAYSTACK_CONNECTIONS =
'default':
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'products_index',
,
I've been tearing my hair out and can't seem to find how the two are possibly communicating and updating each other! Can anyone help me out?
django elasticsearch django-haystack
django elasticsearch django-haystack
asked Nov 13 '18 at 22:58
demluckycharmsdemluckycharms
5619
5619
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290767%2fdjango-update-index-updates-both-test-and-production-sites%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290767%2fdjango-update-index-updates-both-test-and-production-sites%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown