[GeoNode-devel] Geonode Thumbnails Error

Julierme Pinheiro juliermeopensourcedeveloper at gmail.com
Fri Jun 1 13:52:00 PDT 2018


Hi Toni Schonbuchner,

Thank you very much for your reply and great references. I was really
looking for something like that. And thank you very much for the very quick
test  (https://repl.it/repls/NoxiousPitifulResource) showing
local_settings.py  overwriting the settings.py.

I appreciated your time and help.

Best Regards

Julierme

2018-05-29 11:51 GMT-03:00 Toni Schönbuchner <toni.schoenbuchner at csgis.de>:

> Hi Julierme,
>
> sorry I haven´t found yet the time to go through your question in detail
> but like to give you
> a little help. In short. local_settings overwrites variables from
> settings.py
>
> *Why ? Read more here:*
> http://techstream.org/Bits/Local-Settings-in-django
>
> *Where? have a look at the code in settings.py:*
> https://github.com/GeoNode/geonode/blob/master/geonode/settings.py#L1372
>
> *How?*
> I´ve created a super simple example here:
> https://repl.it/repls/NoxiousPitifulResource
>
> Cheers,
>
> Toni
>
>
> -----------------------------------------------
> CSGIS
>
> -----------------------------------------------
> Kolonnadenstraße 1
> <https://maps.google.com/?q=Kolonnadenstra%C3%9Fe+1+04109+Leipzig&entry=gmail&source=g>
> 04109 Leipzig
> <https://maps.google.com/?q=Kolonnadenstra%C3%9Fe+1+04109+Leipzig&entry=gmail&source=g>
> -----------------------------------------------
> 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 29.05.2018 um 16:29 schrieb Julierme Pinheiro <
> juliermeopensourcedeveloper at gmail.com>:
>
> Dear Toni Schonbuchner,
>
>
> Though my questions in the previous e-mail do not help to fix the port
> 8000. And I am still having the issue related  to port 8000 while creating
> the thumbnails. Now, I am trying to find incoherent configuration between
> Settings.py and Local_settings.py. I know that settings.py inherits the
> configuration in local_settings.py, and that means, if I am not wrong, that
> whatever I set in local_settings.py will be copied to settings.py and vice
> versa, for instance, a variable that is defined in local_settings.py ca be
> used in settings.py and vice versa. Now, let's say, for instance, that I
> have MONITORING_ENABLE = True in the local_settings.py and
> MONITORING_ENABLE = False in the settings.py, which one will prevail, TRUE
> or FALSE value? or DEFAULT_MAP_CRS = "EPSG:900913" in local_settings.py and
> DEFAULT_MAP_CRS = "EPSG:3857" in settings.py, which one will prevail?
> 900913 or 3857? And my first shot is FALSE and 900913 for both questions
> because settings.py inherits local_settings.py.
>
> I will play with PROJECT_NAME values in both files to see what happens and
> get a better understanding.
>
>
> Also the variable OGC_SERVER has values defined through local_settings.py
> [1], but it does not have any value in OGC_SERVER being used in settings.py
> [2]. So, I guess the OGC_SERVER values and config in [1] are retrieved in
> [2] as settings.py inherits local_settings.py.
>
> *Different values found between settings.py and local_settings.py*
>
>
> *settings.py
> local_settings.py*
>
> PROJECT_NAME = 'my_geonode'
>
> INSTALLED_APPS += ('geonode', PROJECT_NAME,)
>                                                       INSTALLED_APPS =
> INSTALLED_APPS + ('my_geonode',)
>
> GROUP_MANDATORY_RESOURCES = True
>
> GROUP_MANDATORY_RESOURCES = False
>
> ACCOUNT_APPROVAL_REQUIRED = True
>
> ACCOUNT_APPROVAL_REQUIRED = False
>
> ACCOUNT_EMAIL_CONFIRMATION_EMAIL = True
>                                                ACCOUNT_EMAIL_CONFIRMATION_EMAIL
> = False
>
> ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = True
>                                         ACCOUNT_EMAIL_CONFIRMATION_REQUIRED
> = False
>
> NOTIFICATION_ENABLED = True
>
> NOTIFICATION_ENABLED = False
>
> MONITORING_ENABLED = False
>
> MONITORING_ENABLED = True
>
> WSGI_APPLICATION = "{}.wsgi.application".format(PROJECT_NAME)
>                                  WSGI_APPLICATION =
> "my_geonode.wsgi.application"
>
> ROOT_URLCONF = os.getenv('ROOT_URLCONF', '{}.urls'.format(PROJECT_NAME))
> ROOT_URLCONF = 'my_geonode.urls'
>
> # Queue non-blocking notifications.
>
> # Queue non-blocking notifications.
>
>
> PINAX_NOTIFICATIONS_QUEUE_ALL = False
>
> NOTIFICATION_QUEUE_ALL = False
>
> GEOIP_PATH = os.path.join(os.path.dirname(__file__), '..',
> 'GeoLiteCity.dat')                                      GEOIP_PATH =
> "/usr/local/share/GeoIP"
>
>
> Does these different values could be causing the issue related to the
> thumbnails? Which ones should I comment out?
>
>
> [1] https://github.com/GeoNode/geonode-project/blob/2.8.0/
> project_name/local_settings.py.sample#L105
> [2] https://github.com/GeoNode/geonode-project/blob/2.8.0/
> project_name/settings.py#L311
>
> Thank you very much for your time and help.
>
> I appreciated it
>
>
> Julierme
>
>
> 2018-05-28 13:11 GMT-03:00 Julierme Pinheiro <juliermeopensourcedeveloper@
> gmail.com>:
>
>> Dear Toni Schonbuchner,
>>
>> Thank you very much for your reply and highlights. While tweaking through
>> local_settings.py [1] and settings.py [1][2], trying to find any port 8000
>> set to geoserver URL, I got some questions:
>>
>> 1 - regarding local_settings.py
>>
>> 1.1 OGC_SERVER --> LOG_FILE
>>
>> OGC_SERVER : {
>>           ' default' : {
>>                           .
>>                           .
>>                           .
>>             'LOG_FILE' : '%s/geoserver/data/logs/geoserver.log' % os.path
>> .abspath(os.path.join(PROJECT_ROOT, os.pardir)),
>>
>>                           }}
>>
>>
>> PROJECT_ROOT is the only variable in the file, shouldn't it be changed to
>> LOCAL_ROOT? PROJECT_ROOT was set as LOCAL_ROOT at the top of the file.
>>
>> 1.2 LOCAL_GEOSERVER
>>
>> Should I keep the condition (if 'geonode.geoserver' in INSTALLED_APPS:)
>> before LOCAL_GEOSERVER configuration?
>>
>> 2 - regarding settings.py
>>
>> 2.1 -  LOGGING --> loggers
>>
>> The configuration in [1] differs from configuration in [2]. Config [2] in
>> settings.py gets
>>
>> "{{ project_name }}": {
>>         "handlers": ["console"], "level": "DEBUG", },
>>
>> "my_geonode": {
>>         "handlers": ["console"], "level": "DEBUG", },
>>
>> project_name = my_geonde
>>
>> but config [1] in local_settings does not. I guess this shouldn't be a
>> problem because settings.py inherits local_settings.py.
>>
>> LOGGING = {
>>      .
>>      .
>>      .
>>      }, 'loggers':
>>
>>
>> Lastly, my settings.py is different than settings.py in [3]. According to
>> [4], my settings.py [5] is downloaded from here [6].
>>
>> For instance, USE_GEOSERVER is set in Line 1249 [7], but it is not set in
>> [5], at least the configuration is different. Furthermore, some libraries
>> are imported in [7], but  they aren't in [5].
>>
>> Is it settings.py in [5] out of date?
>>
>> Yet, I am tweaking through geonode-updateip script and I will try to make
>> some changes in order to have it working for GeNode installed from source.
>> As soon as get it, I will share it here.
>>
>> I appreciated your time and help.
>>
>> Kind regards and greetings to Germany.
>>
>>
>> Julierme
>>
>>
>> [1] http://docs.geonode.org/en/master/tutorials/install_and_admi
>> n/geonode_install/setup_configure_httpd.html
>> [2] http://docs.geonode.org/en/master/tutorials/install_and_admi
>> n/geonode_install/create_geonode_db.html
>> [3] https://github.com/GeoNode/geonode/blob/2.8.0/geonode/settin
>> gs.py#L650
>> [4] http://docs.geonode.org/en/master/tutorials/install_and_admi
>> n/geonode_install/install_geonode_application.html
>> [5] https://github.com/GeoNode/geonode-project/blob/2.8.0/projec
>> t_name/settings.py
>> [6] http://github.com/Geonode/geonode-project/archive/2.8.0.zip
>> [7] https://github.com/GeoNode/geonode/blob/2.8.0/geonode/settin
>> gs.py#L1249
>>
>>
>>
>>
>>
>>
>>
>>
>> 2018-05-28 11:20 GMT-03:00 Julierme Pinheiro <
>> juliermeopensourcedeveloper at gmail.com>:
>>
>>> Dear Toni Schonbuchner,
>>>
>>> Thank you very much for your reply. While tweaking through settings.py
>>> and local_settings.py [1], trying to find any port 8000 set to geoserver
>>> URL, I got some questions:
>>>
>>> 1 - regarding local_settings.py
>>>
>>> OGC_SERVER : {
>>>           ' default' : {
>>>                           .
>>>                           .
>>>                           .
>>>             'LOG_FILE' : '%s/geoserver/data/logs/geoserver.log' % os.
>>> path.abspath(os.path.join(PROJECT_ROOT, os.pardir)),
>>>
>>>                           }}
>>>
>>>
>>>
>>>
>>> [1] http://docs.geonode.org/en/master/tutorials/install_and_admi
>>> n/geonode_install/setup_configure_httpd.html
>>>
>>>
>>>
>>>
>>>
>>> 2018-05-25 17:02 GMT-03:00 Toni Schönbuchner <
>>> toni.schoenbuchner at csgis.de>:
>>>
>>>> Dear Julierme,
>>>>
>>>> I think  using grep does not really help to get insights.
>>>> Why not look at the code? The geoserver URL is composed
>>>> in settings.py [1]. I think here you will find your 8000.
>>>>
>>>> Next I think the best way to see what´s going on is to have
>>>> a look at the helpers.py [2]. Here you should find the code which
>>>> is responsible for creating thumbnails and here [3] the signal
>>>> which you see in stdout logging. If there is some time I will
>>>> do a dev installation and will test it as well.
>>>>
>>>> Further you´ve asked if there is something like geonode-updateip
>>>> for an installation by source? Not that I know of but yes it would be
>>>> helpful.
>>>> But it should not be to hard to write a little script which does the
>>>> job.
>>>> Have a look what geonode-updateip actually does [4] it programatically
>>>> changes
>>>> the parts which the documentation [5] explains regarding auth.
>>>>
>>>> I hope this helps a bit.
>>>> Best greetings to Brasilia!
>>>>
>>>> Toni
>>>>
>>>>
>>>> [1] https://github.com/GeoNode/geonode/blob/2.8.0/geonode/se
>>>> ttings.py#L650
>>>> [2] https://github.com/GeoNode/geonode/blob/master/geonode/g
>>>> eoserver/helpers.py#L1730
>>>> [3] https://github.com/GeoNode/geonode/blob/df12893ced001973
>>>> bd748f86d08fa6ae4c10dde9/geonode/geoserver/signals.py#L497
>>>> [4] https://github.com/GeoNode/geonode/blob/df12893ced001973
>>>> bd748f86d08fa6ae4c10dde9/package/support/geonode.updateip#L126
>>>> [5] http://docs.geonode.org/en/master/tutorials/install_and_
>>>> admin/geonode_install/install_geoserver_application.html#geo
>>>> node-authentication-integration
>>>>
>>>> -----------------------------------------------
>>>> CSGIS
>>>>
>>>> -----------------------------------------------
>>>> Kolonnadenstraße 1
>>>> <https://maps.google.com/?q=Kolonnadenstra%C3%9Fe+1+04109+Leipzig&entry=gmail&source=g>
>>>> 04109 Leipzig
>>>> <https://maps.google.com/?q=Kolonnadenstra%C3%9Fe+1+04109+Leipzig&entry=gmail&source=g>
>>>> -----------------------------------------------
>>>> 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.
>>>>
>>>> From: Julierme Pinheiro <juliermeopensourcedeveloper at gmail.com>
>>>> To: Toni Schönbuchner <toni.schoenbuchner at csgis.de>, geonode-users
>>>> <geonode-users at lists.osgeo.org>,  geonode-devel
>>>> <geonode-devel at lists.osgeo.org>
>>>> Subject: Re: [GeoNode-devel] Geonode Thumbnails Error
>>>> Message-ID:
>>>> <CAKTKyJJmjL0QBMuZvw0DsBzeCu2yW5vKCj5dMjDN=cddheWJ+g at mail.gmail.com>
>>>> Content-Type: text/plain; charset="utf-8"
>>>>
>>>>
>>>> Here are some more paths that port 8000 could be coming from:
>>>>
>>>> geo/Envs/geonode/lib/python2.7/site-packages/pycsw/wsgi.py:#
>>>> http://localhost:8000/
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/DESCRIPTION.rst:You
>>>> can now open the API in your browser at ``http://127.0.0.1:8000/``
>>>> <http://127.0.0.1:8000/>,
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/DESCRIPTION.rst:
>>>> $ curl -H 'Accept: application/json; indent=4' -u admin:password
>>>> http://127.0.0.1:8000/users/
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/DESCRIPTION.rst:
>>>> "url": "http://127.0.0.1:8000/users/1/",
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/DESCRIPTION.rst:
>>>> $ curl -X POST -d username=new -d email=new at example.com -d
>>>> is_staff=false
>>>> -H 'Accept: application/json; indent=4' -u admin:password
>>>> http://127.0.0.1:8000/users/
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/DESCRIPTION.rst:
>>>> "url": "http://127.0.0.1:8000/users/2/",
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/METADATA:You
>>>> can now open the API in your browser at ``http://127.0.0.1:8000/``
>>>> <http://127.0.0.1:8000/>,
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/METADATA:
>>>> $ curl -H 'Accept: application/json; indent=4' -u admin:password
>>>> http://127.0.0.1:8000/users/
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/METADATA:
>>>> "url": "http://127.0.0.1:8000/users/1/",
>>>> geo/Envs/geonode/lib/python2.7/site-packages/djangorestframe
>>>> work-3.8.2.dist-info/METADATA:
>>>> $ curl -X POST -d username=new -d email=new at example.com -d
>>>> is_staff=false
>>>> -H 'Accept: application/json; indent=4' -u admin:password
>>>> http://127.0.0.1:8000/users/
>>>>
>>>> [...]
>>>>
>>>>
>>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20180601/6a0399a4/attachment-0001.html>


More information about the geonode-devel mailing list