[GeoNode-users] GeoNode-Project local_settings
Toni Schönbuchner
toni.schoenbuchner at csgis.de
Thu Jan 10 07:22:51 PST 2019
Really strange Julierme,
SITEURL should be set by this env var in docker context:
https://github.com/GeoNode/geonode-project/blob/master/docker-compose.override.yml#L17 <https://github.com/GeoNode/geonode-project/blob/master/docker-compose.override.yml#L17>
and then read by:
> os.getenv('SITEURL'
Let´s wait what the other "dockernistas" think.
– Francesco ;) ?
Cheers;
Toni
> Am 10.01.2019 um 15:34 schrieb Julierme Pinheiro <juliermeopensourcedeveloper at gmail.com>:
>
> Hi Toni,
>
> Thank you very much for your reply and wishes.
>
> Everything works fine, if I set wsgi.py to settings and do not make a copy of local_settings.py.sample as local_settings.py. That is how I got here:
> http://192.241.135.159/ <http://192.241.135.159/>
>
> However, if I set wsgi.py to settings (default configuration) and make a copy of local_settings.py.sample as local_settings.py. The celery and django container error remains:
>
> celery4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/" % (SITE_HOST_NAME, SITE_HOST_PORT))
> celery4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>
> django4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/" % (SITE_HOST_NAME, SITE_HOST_PORT))
> django4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>
> The reason I am changing the wsgi.py to local_settings when using local_settings.py is because there is a note on the guide <https://github.com/GeoNode/geonode-project/tree/2.8> that it says:
>
> Remember to update "wsgi.py" in case you are using "local_settings" vim my_geonode/wsgi.py --> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_geonode.local_settings")
>
> Anyway, using local_settings.py and configuring wsgi.py to either "my_geonode.settings" or "my_geonode.local_settings", celery and django container will not go up and the log file will return:
>
> celery4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/" % (SITE_HOST_NAME, SITE_HOST_PORT))
> celery4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>
> django4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/" % (SITE_HOST_NAME, SITE_HOST_PORT))
> django4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>
> If you consider that an issue, I will post it on github.
>
> Kind regards and thank you mery much for your patience
>
> Julierme
>
>
> On Thu, Jan 10, 2019 at 10:46 AM Toni Schönbuchner <toni.schoenbuchner at csgis.de <mailto:toni.schoenbuchner at csgis.de>> wrote:
> Hey Julierme,
>
> first of all the same to you. All the best for 2019.
>
> Docker sets some env vars where I do not have a complete
> overview. Other might guide you better here.
>
> But look at settings.py:
> https://github.com/GeoNode/geonode-project/blob/master/project_name/settings.py#L27 <https://github.com/GeoNode/geonode-project/blob/master/project_name/settings.py#L27>
> it includes local_settings ...
>
> So, what happens if you leave wsgi.py untouched (pointing to settings.py), rename
> local_settings.py.sample to local_settings.py (already happend) and make your changes
> there (local_settings). F.e. setup your smtp account or base layers etc.
>
> Does this help?
>
> Cheers,
>
> Toni
>
> -----------------------------------------------
> CSGIS
>
> -----------------------------------------------
> Kolonnadenstraße 1
> 04109 Leipzig
> -----------------------------------------------
> Mobil +49/ (0) 176 6680 3198
> Tel +49/ (0) 341 24 04 738
> Fax +49/ (0) 341 24 04 73
> Web http://csgis.de <http://csgis.de/>
> -----------------------------------------------
>
> Hinweis gemäß § 33 BDSG
> Daten der Verfahrensbeteiligten werden gespeichert. Dieses Dokument ist ausschließlich für den
> Adressaten bestimmt. Der Inhalt der E-Mail ist vertraulich. Falls Sie diese E-Mail versehentlich
> erhalten haben, rufen Sie uns unter obiger Rufnummer umgehend an und löschen Sie diese Nachricht
> von Ihrem Computer. Jegliche Art von Reproduktionen, Verbreitung, Vervielfältigung, Veränderung,
> Verteilung und/oder Veröffentlichung dieser E-Mail ist verboten.
>
>> Am 10.01.2019 um 13:33 schrieb Julierme Pinheiro <juliermeopensourcedeveloper at gmail.com <mailto:juliermeopensourcedeveloper at gmail.com>>:
>>
>> Hi Toni,
>> Thank you very much for your reply.
>> Find bellow the site working with wsgi.py configured to settings
>> http://192.241.135.159/ <http://192.241.135.159/>
>>
>> Now, going back to the issue related to wsgi.py configured to local_settings:
>>
>> Yes, checking the logs, I found out that there is an issue with SITEURL. Please see bellow:
>>
>> celery4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>> celery4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>>
>> django4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>> django4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>>
>> SITE_HOST_NAME is defined after SITEURL. I changed from:
>>
>> SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>>
>> # we need hostname for deployed
>> _surl = urlparse(SITEURL)
>> HOSTNAME = _surl.hostname
>>
>> # per-deployment settings should go here
>> SITE_HOST_NAME = os.getenv('SITE_HOST_NAME', HOSTNAME)
>> SITE_HOST_PORT = os.getenv('SITE_HOST_PORT', "80")
>>
>> To:
>>
>> #SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>>
>> # we need hostname for deployed
>> #_surl = urlparse(SITEURL)
>> #HOSTNAME = _surl.hostname
>>
>> # per-deployment settings should go here
>> SITE_HOST_NAME = os.getenv('SITE_HOST_NAME', "172.21.5.187")
>> SITE_HOST_PORT = os.getenv('SITE_HOST_PORT', "80")
>>
>> SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>>
>> # we need hostname for deployed
>> _surl = urlparse(SITEURL)
>> HOSTNAME = _surl.hostname
>>
>> But the django4my_geonode and celery4my_geonode container error remains the same:
>>
>> celery4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>> celery4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>>
>> django4my_geonode | SITEURL = os.getenv('SITEURL', "http://%s:%s/ <http://%s:%s/>" % (SITE_HOST_NAME, SITE_HOST_PORT))
>> django4my_geonode | NameError: name 'SITE_HOST_NAME' is not defined
>>
>> I appreciated your time and by the way, Happy 2019 for you all. I wish you all health and success in all life projects.
>>
>> Kind regards
>>
>> Julierme
>>
>>
>> On Wed, Jan 9, 2019 at 6:18 PM Toni Schönbuchner <toni.schoenbuchner at csgis.de <mailto:toni.schoenbuchner at csgis.de>> wrote:
>> Hey Julierme,
>>
>> have you checked the output of logs?
>>
>> $ docker-compose logs -f
>> or
>> $ docker-compose logs -f django
>> or
>> $ docker-compose logs -f celery
>>
>> Cheers,
>>
>> Toni
>>
>> > ----------------------------------------------------------------------
>> >
>> > Message: 1
>> > Date: Wed, 9 Jan 2019 11:27:59 -0200
>> > From: Julierme Pinheiro <juliermeopensourcedeveloper at gmail.com <mailto:juliermeopensourcedeveloper at gmail.com>>
>> > To: geonode-users <geonode-users at lists.osgeo.org <mailto:geonode-users at lists.osgeo.org>>
>> > Subject: [GeoNode-users] GeoNode-Project local_settings
>> > Message-ID:
>> > <CAKTKyJJ_6KV9d=zikW9SAj6bybDCD+p8-XT7OuDZL7QxGxVVzw at mail.gmail.com <mailto:zikW9SAj6bybDCD%2Bp8-XT7OuDZL7QxGxVVzw at mail.gmail.com>>
>> > Content-Type: text/plain; charset="utf-8"
>> >
>> > Dear all,
>> >
>> > I am running an Ubuntu 18.04 LTS VM. I am trying to install
>> > GeoNode-Project at 2.8 via Docker following the instructions in here.
>> > <https://github.com/GeoNode/geonode-project/tree/2.8 <https://github.com/GeoNode/geonode-project/tree/2.8>>
>> > By changing wsgi.py to local_settings, celery4my_geonode and
>> > django4my_geonode won't start and I am always getting the *502 Bad Gateway*
>> > response in the browser.
>> >
>> > Has anyone faced the same issue and could guide me on how to solve it?
>> >
>> > Thank you for your time in advance
>> >
>> > Regards
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190110/c6d5e79e/attachment-0001.html>
More information about the geonode-users
mailing list