<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><blockquote type="cite"><div dir="ltr">Hi Toni,<div>My purpose is changing the database connection(postgresql in docker) with  postgresql that i already have outside the docker (different server),what file configuration that i must change?</div></div></blockquote><div><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; -webkit-text-size-adjust: 100%; background-color: rgb(255, 255, 255);"><br></span></div><div><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; -webkit-text-size-adjust: 100%; background-color: rgb(255, 255, 255);">Any help how can I configure geonode docker if database used from external postgresql server?</span></div><br><blockquote type="cite"><div dir="ltr"><div>Thanks i will try your suggestion</div></div></blockquote><br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On 19 Nov 2020, at 5.13 AM, irland fardani <irlan128@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8">Hi Toni,<div>My purpose is changing the database connection(postgresql in docker) with  postgresql that i already have outside the docker (different server),what file configuration that i must change?</div><div>Thanks i will try your suggestion</div><div><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On 19 Nov 2020, at 3.20 AM, Toni Schönbuchner <toni.schoenbuchner@csgis.de> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">Hi Irlan,<div class=""><br class=""></div><div class="">in Docker the database is addressed by the container name ‚db‘</div><div class=""><br class=""></div><div class=""><span style="color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-variant-ligatures: normal; orphans: 2; white-space: pre; widows: 2; background-color: rgb(255, 251, 221);" class="">DATABASE_URL=postgis://{{project_name}}:geonode@db:5432/{{project_name}}</span></div><div class=""><a href="https://github.com/GeoNode/geonode-project/blob/master/.env#L34" class="">https://github.com/GeoNode/geonode-project/blob/master/.env#L34</a></div><div class=""><br class=""></div><div class="">In other words Django calls the database by it’s container name not the IP.</div><div class="">You can try to change it but I’m not sure if this all what is needed …</div><div class=""><div style="orphans: 2; widows: 2;" class="">Probably not, as the geonode postgis image has some logic built in …</div><div style="orphans: 2; widows: 2;" class=""><a href="https://github.com/GeoNode/postgis-docker" class="">https://github.com/GeoNode/postgis-docker</a></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; orphans: 2; white-space: pre; widows: 2; background-color: rgb(255, 251, 221);" class="">DATABASE_URL=postgis://{{project_name}}:geonode@db:192.168.100.22/{{project_name}}</span></div><div class=""><div style="orphans: 2; widows: 2;" class=""><br class=""></div><div style="orphans: 2; widows: 2;" class="">The env file will overwrite:</div><div style="orphans: 2; widows: 2;" class=""><a href="https://github.com/GeoNode/geonode/blob/master/geonode/settings.py#L104" class="">https://github.com/GeoNode/geonode/blob/master/geonode/settings.py#L104</a></div><div style="orphans: 2; widows: 2;" class="">!</div><div style="orphans: 2; widows: 2;" class=""><br class=""></div><div style="orphans: 2; widows: 2;" class=""><br class=""></div><div style="orphans: 2; widows: 2;" class=""><br class=""></div><div style="orphans: 2; widows: 2;" class="">cheers,</div><div style="orphans: 2; widows: 2;" class=""><br class=""></div><div style="orphans: 2; widows: 2;" class="">Toni</div><div><br class=""><blockquote type="cite" class=""><div class="">Am 18.11.2020 um 21:00 schrieb <a href="mailto:geonode-users-request@lists.osgeo.org" class="">geonode-users-request@lists.osgeo.org</a>:</div><br class="Apple-interchange-newline"><div class="">Send geonode-users mailing list submissions to<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span><a href="mailto:geonode-users@lists.osgeo.org" class="">geonode-users@lists.osgeo.org</a><br class=""><br class="">To subscribe or unsubscribe via the World Wide Web, visit<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>https://lists.osgeo.org/mailman/listinfo/geonode-users<br class="">or, via email, send a message with subject or body 'help' to<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>geonode-users-request@lists.osgeo.org<br class=""><br class="">You can reach the person managing the list at<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>geonode-users-owner@lists.osgeo.org<br class=""><br class="">When replying, please edit your Subject line so it is more specific<br class="">than "Re: Contents of geonode-users digest..."<br class="">Today's Topics:<br class=""><br class="">   1. Re: GeoNode-Project Docker Postgres Access (irlan128)<br class=""><br class=""><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">Von: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">irlan128 <irlan128@gmail.com><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">Betreff: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">Aw: [GeoNode-users] GeoNode-Project Docker Postgres Access</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">Datum: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">18. November 2020 um 14:21:49 MEZ<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">An: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">geonode-users@lists.osgeo.org<br class=""></span></div><br class=""><br class="">Hi Julierme<br class="">I`m install geonode via docker, i`m want to change the database with another<br class="">database in another server(192.168.100.22), i`m already change my<br class="">local_settings.py<br class="">*DATABASES = {<br class="">    'default': {<br class="">        'ENGINE': 'django.db.backends.postgresql_psycopg2',<br class="">        'NAME': 'geonode',<br class="">        'USER': 'geonode',<br class="">        'PASSWORD': 'geonode',<br class="">        'HOST': '192.168.100.22',<br class="">        'PORT': '5432',<br class="">        'CONN_MAX_AGE': 0,<br class="">        'CONN_TOUT': 5,<br class="">        'OPTIONS': {<br class="">            'connect_timeout': 5,<br class="">        }<br class="">    },<br class="">    # vector datastore for uploads<br class="">    'datastore': {<br class="">        'ENGINE': 'django.contrib.gis.db.backends.postgis',<br class="">        # 'ENGINE': '', # Empty ENGINE name disables<br class="">        'NAME': 'geonode_data',<br class="">        'USER': 'geonode',<br class="">        'PASSWORD': 'geonode',<br class="">        'HOST': '192.168.100.22',<br class="">        'PORT': '5432',<br class="">        'CONN_MAX_AGE': 0,<br class="">                            *<br class=""><br class="">and i`m already change wsgi.py to localhost<br class="">*os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geonode.local_settings")<br class="">*<br class=""><br class="">but still when i`m running "docker logs -f django4geonode" ,still the<br class="">database redirect to db not my postgre host  which on192.168.100.22<br class="">* "postgres://geonode:geonode@db:5432/geonode"<br class="">*<br class="">can you give me a way to solve this problem?<br class="">thanks<br class=""><br class="">*<br class="">2369 static files copied to '/mnt/volumes/statics/static'.<br class="">static data refreshed<br class="">Executing UWSGI server uwsgi --ini /usr/src/app/uwsgi.ini for Production<br class="">command to be executed is uwsgi --ini /usr/src/app/uwsgi.ini<br class="">[uWSGI] getting INI configuration from /usr/src/app/uwsgi.ini<br class="">Restarting periodic command scheduler: cronStopping periodic command<br class="">scheduler: cron.<br class="">Starting periodic command scheduler: cron.<br class="">IS_CELERY=false<br class="">DATABASE_URL=postgres://geonode:geonode@db:5432/geonode<br class="">GEODATABASE_URL=postgis://geonode_data:geonode_data@db:5432/geonode_data<br class="">SITEURL=http://localhost/<br class="">ALLOWED_HOSTS=['localhost', 'localhost', 'localhost:None', 'django',<br class="">'geonode']<br class="">GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/<br class="">GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/<br class="">waitfordbs task done<br class=""><br class="">*<br class=""><br class=""><br class=""><br class="">--<br class="">Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNode-users-f5185389.html<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">geonode-users mailing list<br class="">geonode-users@lists.osgeo.org<br class="">https://lists.osgeo.org/mailman/listinfo/geonode-users<br class=""></div></blockquote></div><br class=""></div><span>_______________________________________________</span><br><span>geonode-users mailing list</span><br><span>geonode-users@lists.osgeo.org</span><br><span>https://lists.osgeo.org/mailman/listinfo/geonode-users</span><br></div></blockquote></div></div></blockquote></body></html>