[GeoNode-users] Command updatelayers and createsuperuser in docker-compose

G. Allegri giovanni.allegri at geo-solutions.it
Wed Feb 13 08:24:38 PST 2019


I don't have a dockerized geonode right now, but if you run the container
with DEBUG=True you should be able to run the management command.
I.e.

>docker-compose run -e DEBUG=True python manage.py crweatesuperuser

In this case the entrypoint.hs will execute the command as it is (see here
<https://github.com/GeoNode/geonode/blob/master/entrypoint.sh#L61>).
The run command runs a new container, but in this case the management
commands are meant to do things on the DB (as it generally happens) it will
be fine, because it will use the same DB as the running geonode instance.

Giovanni

Il giorno mer 13 feb 2019 alle ore 15:07 Andres Juarez <
albertoandres.juarez at gmail.com> ha scritto:

> Hello Giovanni
> Thanks for the clarification.
> What would be the correct way to execute these commands?
>
> *docker-compose exec django django-admin updatelayers*
>
> Is this the same as running it in the bash of the container?
> do not take the .env
>
> If I run *python manage.py updatelayers* outside the container, I get the
> error
>
> ImportError: No module named geonode.settings
>
> Thank you and sorry for my newbie question ...
>
> El mar., 5 feb. 2019 a las 6:12, G. Allegri (<
> giovanni.allegri at geo-solutions.it>) escribió:
>
>> When you exec into the docker container the Dockerfile entrypoint is not
>> hit, thus the .env variables are not translated and set to the variables
>> expected by GeoNode.
>>
>> Giovanni
>>
>>
>> Il giorno mar 5 feb 2019 alle ore 02:05 Andres Juarez <
>> albertoandres.juarez at gmail.com> ha scritto:
>>
>>> Hello
>>> It worked, I was able to create the superuser and publish the layers
>>> from geoserver.
>>>
>>> Thank you very much for the help...
>>> regards
>>>
>>> El lun., 4 feb. 2019 a las 20:47, MDG DEE (<kula009 at gmail.com>)
>>> escribió:
>>>
>>>> Hello,
>>>>
>>>> I had a similar issue before. Here is the solution someone offered and
>>>> it worked for me:
>>>>
>>>> Log into your django container docker exec -it ...and try:
>>>>
>>>> mkdir -p /usr/src/app/; \
>>>>     source $HOME/.override_env; \
>>>>     echo DATABASE_URL=$DATABASE_URL; \
>>>>     echo GEODATABASE_URL=$GEODATABASE_URL; \
>>>>     echo SITEURL=$SITEURL; \
>>>>     echo ALLOWED_HOSTS=$ALLOWED_HOSTS; \
>>>>     echo GEOSERVER_PUBLIC_LOCATION=$GEOSERVER_PUBLIC_LOCATION; \
>>>>     django-admin createsuperuser
>>>>
>>>> this will create your new superuser correctly.
>>>>
>>>>
>>>> Ran
>>>>
>>>> On Mon, Feb 4, 2019 at 3:38 PM Andres Juarez <
>>>> albertoandres.juarez at gmail.com> wrote:
>>>>
>>>>> Hello Francesco, thanks for the reply
>>>>>
>>>>> I access the container django4my_geonode with
>>>>>
>>>>> docker exec -i -t django4my_geonode bash
>>>>>
>>>>> then I execute
>>>>>
>>>>> python manage.py migrate
>>>>> (because without this it did not allow to create the superuser), then
>>>>>
>>>>> python manage.py createsuperuser
>>>>>
>>>>> and after loading the layers in geoserver run
>>>>> python manage.py updatelayers
>>>>>
>>>>> regards
>>>>> and thanks again ...
>>>>>
>>>>> El lun., 4 feb. 2019 a las 18:36, Francesco Bartoli (<
>>>>> xbartolone at gmail.com>) escribió:
>>>>>
>>>>>> Can you briefly show which commands have been executed and against
>>>>>> which container?
>>>>>>
>>>>>> Regards,
>>>>>> Francesco
>>>>>> Il 4 feb 2019, 21:43 +0100, Andres Juarez <
>>>>>> albertoandres.juarez at gmail.com>, ha scritto:
>>>>>>
>>>>>>
>>>>>> Hello everyone
>>>>>> I continue with Geonode 2.10 in docker, and I find a problem when
>>>>>> executing the updatelayers command.
>>>>>>
>>>>>> I have several layers in a postgres database on another server, and I
>>>>>> load it through a geoserver store.
>>>>>>
>>>>>> The updatelayers command runs flawlessly and warns me that the layers
>>>>>> were updated, but they do not appear in the geonode layers section.
>>>>>> However, I can create an empty map and load these same layers using the add
>>>>>> layer button, selecting 'Geoserver - Public layers'.
>>>>>>
>>>>>> The same happens when executing createsuperuser, the process ends
>>>>>> successfully in the command line, but I can not log in with that user.
>>>>>>
>>>>>> Thank you in advance for any help you can provide.
>>>>>> --
>>>>>>    Andrés Juarez
>>>>>> _______________________________________________
>>>>>> geonode-users mailing list
>>>>>> geonode-users at lists.osgeo.org
>>>>>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>>    Andrés Juarez
>>>>> _______________________________________________
>>>>> geonode-users mailing list
>>>>> geonode-users at lists.osgeo.org
>>>>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>>>>
>>>>
>>>
>>> --
>>>    Andrés Juarez
>>> _______________________________________________
>>> geonode-users mailing list
>>> geonode-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>>
>>
>>
>> --
>> Giovanni Allegri
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> <https://maps.google.com/?q=Via+di+Montramito+3/A%0D+55054+%C2%A0Massarosa&entry=gmail&source=g>
>> 55054  Massarosa
>> <https://maps.google.com/?q=Via+di+Montramito+3/A%0D+55054+%C2%A0Massarosa&entry=gmail&source=g>
>>  (LU)
>> Italy
>> phone: +39 0584 962313 <+39%200584%20962313>
>> fax:     +39 0584 1660272 <+39%200584%20166%200272>
>>
>> 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.
>>
>
>
> --
>    Andrés Juarez
>


-- 
Giovanni Allegri
GeoSolutions S.A.S.
Via di Montramito 3/A
<https://maps.google.com/?q=Via+di+Montramito+3/A%0D+55054+%C2%A0Massarosa&entry=gmail&source=g>
55054  Massarosa
<https://maps.google.com/?q=Via+di+Montramito+3/A%0D+55054+%C2%A0Massarosa&entry=gmail&source=g>
 (LU)
Italy
phone: +39 0584 962313 <+39%200584%20962313>
fax:     +39 0584 1660272 <+39%200584%20166%200272>

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/20190213/46ce4b1b/attachment-0001.html>


More information about the geonode-users mailing list