[GeoNode-users] GeoNode-Project local_settings

Julierme Pinheiro juliermeopensourcedeveloper at gmail.com
Mon Jan 14 05:06:22 PST 2019


Thank you Alessio and Toni,

I used local_settings at master instead of local_settings at 2.8. The issue is
solved.

I appreciated your time and patience.

Kind regards

Julierme

On Thu, Jan 10, 2019 at 1:39 PM Toni Schönbuchner <
toni.schoenbuchner at csgis.de> wrote:

>
> – I falsely looked at master!
>
> thanks Alessio!
>
> Am 10.01.2019 um 16:30 schrieb Alessio Fabiani <
> alessio.fabiani at geo-solutions.it>:
>
> Dear all,
> currently I guess Julierme is getting that error because the
> "local_settings.py.sample" of 2.8 branch is wrong (see this line here
> https://github.com/GeoNode/geonode-project/blob/2.8/project_name/local_settings.py.sample#L44
> )
>
> If you take a look at it, it tries to use SITE_HOST_NAME variable before
> it is actually defined.
>
> The version of "master" branch (aka 2.10) should be correct instead
>
>
> https://github.com/GeoNode/geonode-project/blob/master/project_name/local_settings.py.sample
>
>
>
> Il giorno gio 10 gen 2019 alle ore 16:23 Toni Schönbuchner <
> toni.schoenbuchner at csgis.de> ha scritto:
>
>> 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
>>
>> 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/
>>
>> 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> 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
>>> 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
>>> -----------------------------------------------
>>>
>>> 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>:
>>>
>>> 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/
>>>
>>> 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/"
>>> % (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
>>>
>>> SITE_HOST_NAME is defined after SITEURL. *I changed from*:
>>>
>>> SITEURL = os.getenv('SITEURL', "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/" % (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/" % (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/"
>>> % (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
>>>
>>> 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> 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>
>>>> > To: geonode-users <geonode-users at lists.osgeo.org>
>>>> > Subject: [GeoNode-users] GeoNode-Project local_settings
>>>> > Message-ID:
>>>> >       <CAKTKyJJ_6KV9d=
>>>> zikW9SAj6bybDCD+p8-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>
>>>> > 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
>>>>
>>>>
>>>
>> _______________________________________________
>> geonode-users mailing list
>> geonode-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>
>
>
> --
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
> Ing. Alessio Fabiani
> @alfa7691
> Founder/Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A - 55054  Massarosa (LU) - Italy
> phone: +39 0584 962313
> fax:     +39 0584 1660272
> mob:   +39 331 6233686
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
> -------------------------------------------------------
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20190114/8fd46588/attachment-0001.html>


More information about the geonode-users mailing list