Coder Social home page Coder Social logo

geonode / geonode-project Goto Github PK

View Code? Open in Web Editor NEW
78.0 32.0 170.0 2.17 MB

A django template project for creating custom GeoNode projects.

Home Page: http://geonode.org

Python 78.44% HTML 0.28% Makefile 0.50% JavaScript 0.62% Dockerfile 1.85% Shell 18.31%

geonode-project's Introduction

{{ project_name|title }}

GeoNode template project. Generates a django project with GeoNode support.

Table of Contents

Quick Docker Start

  python3.10 -m venv ~/.venvs/project_name
  source ~/.venvs/{{ project_name }}/bin/activate

  pip install Django==4.2.9

  mkdir ~/project_name

  GN_VERSION=master # Define the branch or tag you want to generate the project from
  django-admin startproject --template=https://github.com/GeoNode/geonode-project/archive/refs/heads/$GN_VERSION.zip -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name

  cd ~/project_name
  python create-envfile.py 

create-envfile.py accepts the following arguments:

  • --https: Enable SSL. It's disabled by default
  • --env_type:
    • When set to prod DEBUG is disabled and the creation of a valid SSL is requested to Letsencrypt's ACME server
    • When set to test DEBUG is disabled and a test SSL certificate is generated for local testing
    • When set to dev DEBUG is enabled and no SSL certificate is generated
  • --hostname: The URL that whill serve GeoNode (localhost by default)
  • --email: The administrator's email. Notice that a real email and a valid SMPT configurations are required if --env_type is seto to prod. Letsencrypt uses to email for issuing the SSL certificate
  • --geonodepwd: GeoNode's administrator password. A random value is set if left empty
  • --geoserverpwd: GeoNode's administrator password. A random value is set if left empty
  • --pgpwd: PostgreSQL's administrator password. A random value is set if left empty
  • --dbpwd: GeoNode DB user role's password. A random value is set if left empty
  • --geodbpwd: GeoNode data DB user role's password. A random value is set if left empty
  • --clientid: Client id of Geoserver's GeoNode Oauth2 client. A random value is set if left empty
  • --clientsecret: Client secret of Geoserver's GeoNode Oauth2 client. A random value is set if left empty
  docker compose build
  docker compose up -d

Developer Workshop

Available at

  http://geonode.org/dev-workshop

Create a custom project

NOTE: You can call your geonode project whatever you like except 'geonode'. Follow the naming conventions for python packages (generally lower case with underscores (_). In the examples below, replace {{ project_name }} with whatever you would like to name your project.

To setup your project follow these instructions:

  1. Generate the project

    git clone https://github.com/GeoNode/geonode-project.git -b <your_branch>
    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    mkvirtualenv --python=/usr/bin/python3 {{ project_name }}
    pip install Django==3.2.16
    
    django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile {{ project_name }}
    
    cd {{ project_name }}
  2. Create the .env file

    An .env file is requird to run the application. It can be created from the .env.sample either manually or with the create-envfile.py script.

    The script accepts several parameters to create the file, in detail:

    • hostname: e.g. master.demo.geonode.org, default localhost
    • https: (boolean), default value is False
    • email: Admin email (this is required if https is set to True since a valid email is required by Letsencrypt certbot)
    • env_type: prod, test or dev. It will set the DEBUG variable to False (prod, test) or True (dev)
    • geonodepwd: GeoNode admin password (required inside the .env)
    • geoserverpwd: Geoserver admin password (required inside the .env)
    • pgpwd: PostgreSQL password (required inside the .env)
    • dbpwd: GeoNode DB user password (required inside the .env)
    • geodbpwd: Geodatabase user password (required inside the .env)
    • clientid: Oauth2 client id (required inside the .env)
    • clientsecret: Oauth2 client secret (required inside the .env)
    • secret key: Django secret key (required inside the .env)
    • sample_file: absolute path to a env_sample file used to create the env_file. If not provided, the one inside the GeoNode project is used.
    • file: absolute path to a json file that contains all the above configuration

    NOTE:

    • if the same configuration is passed in the json file and as an argument, the CLI one will overwrite the one in the JSON file

    • If some value is not provided, a random string is used

      Example USAGE

      python create-envfile.py -f /opt/core/geonode-project/file.json \
        --hostname localhost \
        --https \
        --email [email protected] \
        --geonodepwd gn_password \
        --geoserverpwd gs_password \
        --pgpwd pg_password \
        --dbpwd db_password \
        --geodbpwd _db_password \
        --clientid 12345 \
        --clientsecret abc123 

      Example JSON expected:

      {
        "hostname": "value",
        "https": "value",
        "email": "value",
        "geonodepwd": "value",
        "geoserverpwd": "value",
        "pgpwd": "value",
        "dbpwd": "value",
        "geodbpwd": "value",
        "clientid": "value",
        "clientsecret": "value"
      } 

Start your server

Skip this part if you want to run the project using Docker instead see Start your server using Docker

  1. Setup the Python Dependencies

    NOTE: Important: modify your requirements.txt file, by adding the GeoNode branch before continue!

    (see Hints: Configuring requirements.txt)

    cd src
    pip install -r requirements.txt --upgrade
    pip install -e . --upgrade
    
    # Install GDAL Utilities for Python
    pip install pygdal=="`gdal-config --version`.*"
    
    # Dev scripts
    mv ../.override_dev_env.sample ../.override_dev_env
    mv manage_dev.sh.sample manage_dev.sh
    mv paver_dev.sh.sample paver_dev.sh
    
    source ../.override_dev_env
    
    # Using the Default Settings
    sh ./paver_dev.sh reset
    sh ./paver_dev.sh setup
    sh ./paver_dev.sh sync
    sh ./paver_dev.sh start
  2. Access GeoNode from browser

    NOTE: default admin user is admin (with pw: admin)

    http://localhost:8000/

Start your server using Docker

You need Docker 1.12 or higher, get the latest stable official release for your platform. Once you have the project configured run the following command from the root folder of the project.

  1. Run docker-compose to start it up (get a cup of coffee or tea while you wait)

    docker-compose build --no-cache
    docker-compose up -d
    set COMPOSE_CONVERT_WINDOWS_PATHS=1

    before running docker-compose up

  2. Access the site on http://localhost/

Run the instance in development mode

Use dedicated docker-compose files while developing

NOTE: In this example we are going to keep localhost as the target IP for GeoNode

docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml up

Run the instance on a public site

Preparation of the image (First time only)

NOTE: In this example we are going to publish to the public IP http://123.456.789.111

vim .env
  --> replace localhost with 123.456.789.111 everywhere

Startup the image

docker-compose up --build -d

Stop the Docker Images

docker-compose stop

Fully Wipe-out the Docker Images

WARNING: This will wipe out all the repositories created until now.

NOTE: The images must be stopped first

docker system prune -a

Backup and Restore from Docker Images

Run a Backup

SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME
  • BKP_FOLDER_NAME: Default value = backup_restore Shared Backup Folder name. The scripts assume it is located on "root" e.g.: /$BKP_FOLDER_NAME/

  • SOURCE_URL: Source Server URL, the one generating the "backup" file.

  • TARGET_URL: Target Server URL, the one which must be synched.

e.g.:

docker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME'

Run a Restore

SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME
  • BKP_FOLDER_NAME: Default value = backup_restore Shared Backup Folder name. The scripts assume it is located on "root" e.g.: /$BKP_FOLDER_NAME/

  • SOURCE_URL: Source Server URL, the one generating the "backup" file.

  • TARGET_URL: Target Server URL, the one which must be synched.

e.g.:

docker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME'

Recommended: Track your changes

Step 1. Install Git (for Linux, Mac or Windows).

Step 2. Init git locally and do the first commit:

git init
git add *
git commit -m "Initial Commit"

Step 3. Set up a free account on github or bitbucket and make a copy of the repo there.

Hints: Configuring requirements.txt

You may want to configure your requirements.txt, if you are using additional or custom versions of python packages. For example

Django==3.2.16
git+git://github.com/<your organization>/geonode.git@<your branch>

Increasing PostgreSQL Max connections

In case you need to increase the PostgreSQL Max Connections , you can modify the POSTGRESQL_MAX_CONNECTIONS variable in .env file as below:

POSTGRESQL_MAX_CONNECTIONS=200

In this case PostgreSQL will run accepting 200 maximum connections.

Test project generation and docker-compose build Vagrant usage

Testing with vagrant works like this: What vagrant does:

Starts a vm for test on docker swarm: - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project). - exposes service on localhost port 8888 - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login. - starts, reboots to check if docker services come up correctly after reboot.

vagrant plugin install vagrant-reload
#test things for docker-compose
vagrant up
# check services are up upon reboot
vagrant ssh geonode-compose -c 'docker ps'

Test geonode on http://localhost:8888/

To clean up things and delete the vagrant box:

vagrant destroy -f

Test project generation and Docker swarm build on vagrant

What vagrant does:

Starts a vm for test on docker swarm: - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project). - exposes service on localhost port 8888 - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login. - starts, reboots to check if docker services come up correctly after reboot.

To test on a docker swarm enable vagrant box:

vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant up
# check services are up upon reboot
VAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant ssh geonode-compose -c 'docker service ls'

Test geonode on http://localhost:8888/ Again, to clean up things and delete the vagrant box:

VAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant destroy -f

for direct deveolpment on geonode-project after first vagrant up to rebuild after changes to project, you can do vagrant reload like this:

vagrant up

What vagrant does (swarm or comnpose cases):

Starts a vm for test on plain docker service with docker-compose: - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project). - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login. - starts, reboots.

[1] to achieve docker-compose build --no-cache just destroy vagrant boxes vagrant destroy -f

geonode-project's People

Contributors

abulojoshua1 avatar afabiani avatar ahmednoureldeen avatar alex avatar bieganowski avatar brianl9995 avatar camuffo avatar cezio avatar dependabot-preview[bot] avatar drumbsd avatar ehj-52n avatar erwaen avatar etj avatar frafra avatar francbartoli avatar giohappy avatar ingenieroariel avatar jj0hns0n avatar kalxas avatar lpasquali avatar marthamareal avatar mattiagiupponi avatar moradwan74 avatar pjdufour avatar ppasq avatar randomorder avatar simod avatar t-book avatar vmendezm avatar waybarrios avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geonode-project's Issues

Application labels aren't unique, duplicates: ows_api

While trying to install 2.8.0, paver setup fails with:
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: ows_api

Full details:
(geonode) geo@debian:/home/geonode/my_geonode$ DJANGO_SETTINGS_MODULE=my_geonode .settings paver setup
---> pavement.setup
---> pavement.setup_geoserver
rmtree path('geoserver/data')
---> pavement.setup_qgis_server
---> pavement.updategeoip
python manage.py updategeoip -o
Traceback (most recent call last):
File "manage.py", line 31, in
execute_from_command_line(sys.argv)
File "/home/geo/Envs/geonode/local/lib/python2.7/site-packages/django/core/man agement/init.py", line 354, in execute_from_command_line
utility.execute()
File "/home/geo/Envs/geonode/local/lib/python2.7/site-packages/django/core/man agement/init.py", line 328, in execute
django.setup()
File "/home/geo/Envs/geonode/local/lib/python2.7/site-packages/django/init .py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/geo/Envs/geonode/local/lib/python2.7/site-packages/django/apps/reg istry.py", line 89, in populate
"duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, d uplicates: ows_api

Captured Task Output:
---> pavement.setup
---> pavement.setup_geoserver
rmtree path('geoserver/data')
---> pavement.setup_qgis_server
---> pavement.updategeoip
python manage.py updategeoip -o

Build failed running pavement.setup: Subprocess return code: 1

Docker build fails, when being connected to a VPN

When I'm connected to the VPN of my company, docker-compose up --build fails with following errors:

Get:4 http://deb.debian.org/debian stretch/main amd64 xxd amd64 2:8.0.0197-4+deb9u1 [132 kB]
Err:4 http://deb.debian.org/debian stretch/main amd64 xxd amd64 2:8.0.0197-4+deb9u1
  Hash Sum mismatch
  Hashes of expected file:
   - SHA256:6cf151f1921bf1e347aa7bef73745844caa40f2d54a33c4b1be1448bb98ca744
   - MD5Sum:f6c519ed7826f32b610279d0f5af799b [weak]
   - Filesize:131540 [weak]
  Hashes of received file:
   - SHA256:a6873de8c875e4f9ce390cd1c2e877e83388a2fabc0a3a22bf9978f86f6bde23
   - MD5Sum:916b0eb03c79f96d6af434c81cf169ba [weak]
   - Filesize:155466 [weak]
  Last modification reported: Wed, 24 May 2017 15:55:43 +0000
Get:5 http://deb.debian.org/debian stretch/main amd64 vim-common all 2:8.0.0197-4+deb9u1 [159 kB]

Searching the internet I found following fix for that. Creating the file 99fixbadproxy and add the three lines to it.

RUN echo "Acquire::http::Pipeline-Depth 0;" > /etc/apt/apt.conf.d/99fixbadproxy
RUN echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/99fixbadproxy
RUN echo "Acquire::BrokenProxy    true;" >> /etc/apt/apt.conf.d/99fixbadproxy

I couldn't find any explanation of these lines, so I'm sure if this is good practice.

If somebody can confirm, that this is nothing to worry about, I would create I pull request.

Thanks.

OSX Docker 502 Bad Gateway

Hi @afabiani,

Platform OSX 10.13.5
Docker Version 18.06.0-ce-mac70 (26399)

For a quick test of the new template under Docker I´ve run

git clone https://github.com/GeoNode/geonode-project.git -b master
virtualenv ~/env/my_geonode
source ~/env/my_geonode/bin/activate
pip install Django==1.11.11
django-admin startproject --template=./geonode-project -e py,rst,json,yml,ini,env,sample -n Dockerfile my_geonode
cd my_geonode
docker-compose build --no-cache
docker-compose up -d

All containers are running. I would expect that geonode is available at http://localhost as the Readme says. Unfortuantely I get a 502 Bad request.

nginx4           | 2018/08/09 09:36:59 [error] 6#6: *8 upstream prematurely closed connection while reading response header from upstream, client: 172.22.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://172.22.0.3:8000/", host: "localhost"

Do I miss to set some LB_HOST var?

Thanks for you help,

Toni

django container crashes: missing dependency elasticsearch

Hello,
I'm new to GeoNode development and just followed your instructions to build docker containers to run a development version of GeoNode. Unfortunately the django and celery containers constantly crash because of a missing elasticsearch dependency:

django4my_geonode | Traceback (most recent call last):
django4my_geonode |   File "manage.py", line 31, in <module>
django4my_geonode |     execute_from_command_line(sys.argv)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
django4my_geonode |     utility.execute()
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
django4my_geonode |     self.fetch_command(subcommand).run_from_argv(self.argv)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
django4my_geonode |     self.execute(*args, **cmd_options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
django4my_geonode |     output = self.handle(*args, **options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 227, in handle
django4my_geonode |     self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", line 53, in emit_post_migrate_signal
django4my_geonode |     **kwargs
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 193, in send
django4my_geonode |     for receiver in self._live_receivers(sender)
django4my_geonode |   File "/usr/src/geonode/geonode/monitoring/__init__.py", line 38, in run_setup_hooks
django4my_geonode |     populate()
django4my_geonode |   File "/usr/src/geonode/geonode/monitoring/models.py", line 1813, in populate
django4my_geonode |     m.save()
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save
django4my_geonode |     force_update=force_update, update_fields=update_fields)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 848, in save_base
django4my_geonode |     update_fields=update_fields, raw=raw, using=using,
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 193, in send
django4my_geonode |     for receiver in self._live_receivers(sender)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/haystack/signals.py", line 51, in handle_save
django4my_geonode |     index = self.connections[using].get_unified_index().get_index(sender)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/haystack/utils/loading.py", line 109, in __getitem__
django4my_geonode |     self.thread_local.connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/haystack/utils/loading.py", line 60, in load_backend
django4my_geonode |     return import_class(full_backend_path)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/haystack/utils/loading.py", line 27, in import_class
django4my_geonode |     module_itself = importlib.import_module(module_path)
django4my_geonode |   File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
django4my_geonode |     __import__(name)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/haystack/backends/elasticsearch2_backend.py", line 23, in <module>
django4my_geonode |     Please refer to the documentation.")
django4my_geonode | haystack.exceptions.MissingDependency: The 'elasticsearch2' backend requires the                             installation of 'elasticsearch>=2.0.0,<3.0.0'.                             Please refer to the documentation.

I've build the images with

docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml build --no-cache

and started the containers with

docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml up

Am I missing something?

GeoNode UpdateLayers

I am running GeoNode-Project Master installed via Docker and I am facing an issue while updating GeoNode layers (python manage.py updatelayers -w geonode -f cbge_trecho_arruamento) the response is in [1]:

Looking at GeoNode tree, I found updalayers.py file, but I could not find it under GeoNode-Project Master tree
https://github.com/GeoNode/geonode/blob/master/geonode/geoserver/management/commands/updatelayers.py

[1] Response for python manage.py updatelayers -w geonode -f cbge_trecho_arruamento

File "manage.py", line 31, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/src/geonode/geonode/geoserver/management/commands/updatelayers.py", line 98, in handle
owner = get_valid_user(user)
File "/usr/src/geonode/geonode/people/utils.py", line 44, in get_valid_user
theuser = get_default_user()
File "/usr/src/geonode/geonode/people/utils.py", line 31, in get_default_user
if superusers.count() > 0:
File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 364, in count
return self.query.get_count(using=self.db)
File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 499, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 480, in get_aggregation
result = compiler.execute_sql(SINGLE)
File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
raise original_exception
django.db.utils.OperationalError: no such table: people_profile

Login failed in dev mode

Expected Behavior

After building a new Geonode instance from scratch in development mode, use the admin credential admin & admin to log in, the login should be successful.

Create some other accounts (either superuser or user) then try to log in with them. The logins should also be successful.

Actual Behavior

  1. admin account cannot be found, therefore login was failed.
    image

image

  1. Using any other account to log in will be immediately kicked out by getting a Session is Expired. Please login again! message.
    image

Steps to Reproduce the Problem

  1. git clone the current version of geonode-project files
  2. Run docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml up --build to build and run the geonode in dev mode
  3. Use admin credential to log in, this will fail.
  4. Create a new account either using Register or command line django-admin createsuperuser .
  5. Log in to Geonode with the account created in the above step, the account will log in first but will be logged out instantly.

Specifications

  • GeoNode version: 2.10rc5
  • Installation method (manual, GeoNode Docker, SPCGeoNode Docker): GeoNode docker
  • Platform: Ubuntu 16.04
  • Additional details: Running docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build to build and run the geonode won't encounter the issues. Only the dev mode has the problem described above.

Docker CollectStatic

Hi All,

I am trying to run docker-compose exec django django-admin.py collectstatic --noinput on [email protected] instance. The response is: 2 static files copied to '/mnt/volumes/statics/static', 1716 unmodified. But the subdirectories ./volumes/statics/static do not exist. The directory static_root was not created either. Any comment on that will be very appreciated it.
Thank you very much for your time in advance

SELinux support

Celery cannot access to /mnt/volumes/statics/geonode_init.lock while using docker-compose up --build in a new project, so it keep restarting.

I removed a couple of fixtures to overcome issue #52

django4nina_catalog | **************************fixtures********************************
django4nina_catalog | Installed 1 object(s) from 1 fixture(s)
celery4nina_catalog | fixture task done
celery4nina_catalog | /bin/bash: /mnt/volumes/statics/geonode_init.lock: Permission denied
celery4nina_catalog | **************************init file********************************
django4nina_catalog | Installed 1 object(s) from 1 fixture(s)
django4nina_catalog | Installed 300 object(s) from 1 fixture(s)
django4nina_catalog | fixture task done
django4nina_catalog | /bin/bash: /mnt/volumes/statics/geonode_init.lock: Permission denied
django4nina_catalog | **************************init file********************************
celery4nina_catalog exited with code 1

Branch: 2.8

[email protected] docker installation fails configuring WSGI as local_settings

I have noticed that [email protected] docker installation fails configuring WSGI.py as os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_geonode.local_settings").
I realized that the issue may be related to the settings and local_settings.py files. I used [email protected] and [email protected] and the installation succeeded except, geonode-project instance is unable to retrieve site_base.css file.

Any help will be very appreciated

Julierme

Explanation for apt installation missing in 2.8

geonode_project documentation does not mention how to work with geonode_project and geonode installed by apt.

( Which it did in past ).
If geonode_project is meant to be used with installation from ppa as well this should be added/explained.

Connection refused

Good day

I am trying to install the Geonode 2.10 project follow these steps:

1.- git clone https://github.com/GeoNode/geonode-project.git

2.- mkvirtualenv my_geonode
pip install Django == 1.11.21

3.- django-admin startproject --template =. / Geonode-project -e py, rst, json, yml, ini, env, sample -n Dockerfile my_geonode

4.- cd my_geonode

5.- Edit wsgi.py to use local_setting.py
os.environ.setdefault ("DJANGO_SETTINGS_MODULE", "my_geonode.local_settings")

6.- Rename local_setting.py.sample> local_setting.py

7.- I edit docker-compose.override.ym and register my domain

8.- docker-compose build --no-cache

9.- docker-compose up to -d

Problem seeing django4_my_geonode records

Error: django.db.utils.OperationalError: could not connect to server: connection refused

Any ideas to solve this problem?

Thanks for your attention

config_local_setting

Connection_refused

"Filter by Attributes" Download Layer Failed

Hello, when downloading a layer, I was trying to use the "filter by attributes" feature. However, the download filter did not work properly, it did not return any attribute values in the list (in fact the list was not created at all). I found an exactly the same issue from here: GeoNode/geonode#3609. Has it been addressed yet? If not, is there a workaround for it? I'm using GeoNode 2.8 installed via sudo apt-get install geonode. Thanks!

Issues with paver tasks

In behalf of Julierme (keeping track of ml issues)

Dear GeoNode users,

I am setting a new geonode-project in a python virtualenv following [1]. While running all the command line, paver sync is hitting a error:

Traceback (most recent call last):
File "manage.py", line 31, in
execute_from_command_line(sys.argv)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/geonode_project/my_geonode/my_geonode/urls.py", line 24, in
from geonode.urls import urlpatterns
File "/home/geo/Envs/geonode_project/src/geonode/geonode/urls.py", line 89, in
url(r'^catalogue/', include('geonode.catalogue.urls')),
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/geo/Envs/geonode_project/src/geonode/geonode/catalogue/urls.py", line 22, in
from . import views
File "/home/geo/Envs/geonode_project/src/geonode/geonode/catalogue/views.py", line 29, in
from pycsw import server
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pycsw/init.py", line 35, in
version = pkg_resources.require("pycsw")[0].version
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pkg_resources/init.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pkg_resources/init.py", line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (xmltodict 0.9.2 (/home/geo/Envs/geonode_project/lib/python2.7/site-packages), Requirement.parse('xmltodict==0.10.2'), set(['pycsw']))

And paver start

pavement.start
---> pavement.start_geoserver
cd /home/geonode_project/my_geonode/geoserver/data
java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
java -Xms512m -Xmx2048m -server -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m -DGEOSERVER_DATA_DIR=/home/geonode_project/my_geonode/geoserver/data -Dgeofence.dir=/home/geonode_project/my_geonode/geoserver/data/geofence -jar /home/geonode_project/my_geonode/downloaded/jetty-runner-9.4.7.v20170914.jar --port 8080 --log /home/geonode_project/my_geonode/geoserver/jetty.log /home/geonode_project/my_geonode/scripts/misc/jetty-runner.xml > /dev/null &
cd /home/geonode_project/my_geonode
Starting GeoServer on http://localhost:8080/geoserver/
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
2018-08-01 11:43:11.942:INFO::main: Logging initialized @483ms to org.eclipse.jetty.util.log.StdErrLog
2018-08-01 11:43:11.962:INFO:oejr.Runner:main: Runner
2018-08-01 11:43:12.832:INFO:oejs.Server:main: jetty-9.4.7.v20170914
2018-08-01 11:43:19.024:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2018-08-01 11:43:19.029:INFO:oejs.session:main: No SessionScavenger set, using defaults
2018-08-01 11:43:19.032:INFO:oejs.session:main: Scavenging every 660000ms
ago 01, 2018 11:43:20 AM it.geosolutions.imageio.gdalframework.GDALUtilities loadGDAL
WARNING: Failed to load the GDAL native libs. This is not a problem unless you need to use the GDAL plugins: they won't be enabled.
java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path
ago 01, 2018 11:43:23 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'XStreamPersisterInitializer', but ApplicationContext is unset.
ago 01, 2018 11:43:23 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
ago 01, 2018 11:43:23 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
ago 01, 2018 11:43:23 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
2018-08-01 11:43:23.501:INFO:oejshC.geoserver:main: Initializing Spring root WebApplicationContext
ago 01, 2018 11:43:40 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'MonitorDAO', but ApplicationContext is unset.
ago 01, 2018 11:43:40 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
ago 01, 2018 11:43:40 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
ago 01, 2018 11:43:40 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
ago 01, 2018 11:43:42 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'GeoServerSecurityProvider', but ApplicationContext is unset.
ago 01, 2018 11:43:42 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
ago 01, 2018 11:43:42 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
ago 01, 2018 11:43:42 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
Security framework of XStream not initialized, XStream is probably vulnerable.
2018-08-01 11:44:34.666:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@19bb089b{/geoserver,file:///home/geonode_project/my_geonode/geoserver/geoserver/,AVAILABLE}{../geoserver}
2018-08-01 11:44:34.676:INFO:oejs.AbstractNCSARequestLog:main: Opened /home/geonode_project/my_geonode/geoserver/jetty.log
2018-08-01 11:44:34.716:INFO:oejs.AbstractConnector:main: Started ServerConnector@3934e643{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2018-08-01 11:44:34.721:INFO:oejs.Server:main: Started @83260ms
2018-08-01 11:44:35.206:INFO:oejshC.geoserver:qtp885284298-13: Initializing Spring FrameworkServlet 'dispatcher'
The logs are available at /home/geonode_project/my_geonode/geoserver/jetty.log
---> pavement.start_qgis_server
---> pavement.start_django
python -W ignore manage.py runserver 0.0.0.0:8000 &
sleep 30
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7f616da7f7d0>
Traceback (most recent call last):
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
self.check(display_num_errors=True)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/geonode_project/my_geonode/my_geonode/urls.py", line 24, in
from geonode.urls import urlpatterns
File "/home/geo/Envs/geonode_project/src/geonode/geonode/urls.py", line 89, in
url(r'^catalogue/', include('geonode.catalogue.urls')),
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/geo/Envs/geonode_project/src/geonode/geonode/catalogue/urls.py", line 22, in
from . import views
File "/home/geo/Envs/geonode_project/src/geonode/geonode/catalogue/views.py", line 29, in
from pycsw import server
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pycsw/init.py", line 35, in
version = pkg_resources.require("pycsw")[0].version
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pkg_resources/init.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/geo/Envs/geonode_project/local/lib/python2.7/site-packages/pkg_resources/init.py", line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (xmltodict 0.9.2 (/home/geo/Envs/geonode_project/lib/python2.7/site-packages), Requirement.parse('xmltodict==0.10.2'), set(['pycsw']))
GeoNode is now available.

has anyone faced these issues and could give me a hint?

[1] https://github.com/geosolutions-it/geonode-project

docker-compose up is broken

Containers of django and celery don't go up with the following error:

[uwsgi-cron] command "/usr/local/bin/python /usr/src/my_geonode/manage.py collect_metrics -n" running with pid 432 exited after 3 second(s)
Fri Dec 21 08:38:42 2018 - [uwsgi-cron] running "/usr/local/bin/python /usr/src/my_geonode/manage.py collect_metrics -n" (pid 440)
Unknown command: 'collect_metrics'
Type 'manage.py help' for usage.

Effectively running the command from the shell of the container gives the same error and the usage doesn't return the collect_metrics as available command

Adapt for production using Docker

Hi !

I've been trying out this project using Docker. I'm currently have some problems running it with Docker (probably linked to #5 ), but will probably have that sorted out at some point.

I think it's very promising, as it makes it very easy to develop a custom Geonode project without all the hassle of configuring all required services.

However, going from there to production is still very involved.

Here are a few problems I noticed :

  • Images have no tags, which mean docker-compose up can pull a different image at anytime (whenever a new postgres image is released for example)
  • Some services Dockerfiles are stored in other repo. Since they are (I think) specific to geonode-project, it would make more sense to keep them in the same repo (e.g. terranodo/nginx:geoserver and waybarrios/geoserver). This would make it much easier to adapt the setup if needed.
  • Some critical actions are not enforced (set the public URL, change geoserver default admin login, ...)
  • settings.py looks overwhelming, especially since it is supposed to inherit from default geonode settings
  • Django runs in debug mode and serves static/media files, which could be done by nginx
  • Django runs using dev server, instead of uwsgi or other more robust python server
  • Nothing about https encryption
  • Nothing about data backup
  • Some of the docker images are quite heavy to pull (they could probably be optimized, which can be a big deal in some places of the world).

Do you think providing a production-ready, easy-to-customize and almost-one-line-deployable setup through Docker is a realistic goal ? Is it in the scope of geonode-project ?

I'm currently working on exactly this (I started from scratch, also I'm relatively new to Geonode and Docker) and am willing to contribute to that goal.

Kind regards,

Olivier

Error Install Geonode 2.10

Ubuntu 16.04

Error:
pkg_resources.ContextualVersionConflict: (idna 2.8 (/usr/local/lib/python2.7/site-packages), Requirement.parse('idna<2.7,>=2.5'), set(['django-mapstore-adapter']))

impossible dependencies in requirements.txt

geonode 2.10.1 has requirements six<1.11.0 and parse-type==0.5.2 BUT parse-type 0.5.2 has requirement six>=1.11
this leads to an error when running pip install -r requirements.txt --upgrade --no-cache --no-cache-dir
tested with master branch (1ec49d46c81d395854859ab94fa0bdd26f7a163b)

save map broken on 2.8 branch?

Hi,

I´ve just installed GeoNode project 2.8 on two different Mac boxes. After saving a map I'm getting following error:

Internal Server Error: /maps/new/data
Traceback (most recent call last):
  File "/Users/ts/Documents/env/my_project/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/maps/views.py", line 698, in new_map_json
    map_obj.save()
  File "/Users/ts/Documents/env/my_project/lib/python2.7/site-packages/polymorphic/models.py", line 82, in save
    return super(PolymorphicModel, self).save(*args, **kwargs)
  File "/Users/ts/Documents/env/my_project/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/Users/ts/Documents/env/my_project/lib/python2.7/site-packages/django/db/models/base.py", line 771, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/Users/ts/Documents/env/my_project/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/geoserver/signals.py", line 620, in geoserver_post_save_map
    create_gs_thumbnail(instance, overwrite=False)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/geoserver/helpers.py", line 2004, in create_gs_thumbnail
    return implementation(instance, overwrite)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/layers/utils.py", line 1024, in create_gs_thumbnail_geonode
    overwrite=overwrite, check_bbox=check_bbox)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/layers/utils.py", line 974, in create_thumbnail
    image = _prepare_thumbnail_body_from_opts(request_body)
  File "/Users/ts/Documents/env/my_project/src/geonode/geonode/geoserver/helpers.py", line 1863, in _prepare_thumbnail_body_from_opts
    bbox_to_projection([float(coord) for coord in request_body['bbox']] + [request_body['srid'], ],
ValueError: could not convert string to float: None

I´ve tried with different test layers (shp boundaries, raster etc. from training). This does not happen when using master branch. (Will do another check on Ubuntu as well but assume something wrong with GS13 or helper.py)

Cannot apply fixtures from Docker

Branch: 2.8

django4my_geonode | Synchronizing apps without migrations:
django4my_geonode |   Creating tables...
django4my_geonode |     Running deferred SQL...
django4my_geonode |   Installing custom SQL...
db4my_geonode    | ERROR:  relation "base_topiccategory" does not exist at character 8
db4my_geonode    | STATEMENT:  UPDATE "base_topiccategory" SET "identifier" = 'geoscientificInformation', "description" = 'information pertaining to earth sciences. Examples: geophysical features and processes, geology, minerals, sciences dealing with the composition, structure and origin of the earth s rocks, risks of earthquakes, volcanic activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion', "description_en" = 'information pertaining to earth sciences. Examples: geophysical features and processes, geology, minerals, sciences dealing with the composition, structure and origin of the earth s rocks, risks of earthquakes, volcanic activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion', "gn_description" = 'Geoscientific Information', "gn_description_en" = 'Geoscientific Information', "is_choice" = true, "fa_class" = 'fa-bullseye' WHERE "base_topiccategory"."id" = 1
celery4my_geonode | Operations to perform:
celery4my_geonode |   Synchronize unmigrated apps: django_basic_auth, tasks, floppyforms, allauth, modeltranslation, django_extensions, rest_framework, polymorphic, treebeard, corsheaders, geonode, django_forms_bootstrap, catalogue, humanize, bootstrap3_datetime, api_basemaps, storages, mptt, staticfiles, metadataxsl, geoexplorer, sitemaps, proxy, gis, pinax_theme_bootstrap, autocomplete_light, messages, leaflet, api, my_geonode, social, messaging, security, dj_pagination, ows_api
celery4my_geonode |   Apply all migrations: dialogos, people, tastypie, agon_ratings, documents, actstream, sites, maps, contenttypes, announcements, user_messages, layers, sessions, guardian, auth, invitations, base, pinax_notifications, groups, services, oauth2_provider, account, admin, geonode_themes, upload, geonode_client, avatar, taggit, socialaccount
celery4my_geonode | Synchronizing apps without migrations:
celery4my_geonode |   Creating tables...
celery4my_geonode |     Running deferred SQL...
celery4my_geonode |   Installing custom SQL...
django4my_geonode | Traceback (most recent call last):
django4my_geonode |   File "manage.py", line 31, in <module>
django4my_geonode |     execute_from_command_line(sys.argv)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
django4my_geonode |     utility.execute()
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
django4my_geonode |     self.fetch_command(subcommand).run_from_argv(self.argv)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
django4my_geonode |     self.execute(*args, **cmd_options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
django4my_geonode |     output = self.handle(*args, **options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 179, in handle
django4my_geonode |     created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 365, in sync_apps
django4my_geonode |     hide_empty=True,
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
django4my_geonode |     return command.execute(*args, **defaults)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
django4my_geonode |     output = self.handle(*args, **options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/modeltranslation/management/commands/loaddata.py", line 61, in handle
django4my_geonode |     return super(Command, self).handle(*fixture_labels, **options)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 60, in handle
django4my_geonode |     self.loaddata(fixture_labels)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 100, in loaddata
django4my_geonode |     self.load_label(fixture_label)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 157, in load_label
django4my_geonode |     obj.save(using=self.using)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/core/serializers/base.py", line 173, in save
django4my_geonode |     models.Model.save_base(self.object, using=using, raw=True)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 762, in save_base
django4my_geonode |     updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 827, in _save_table
django4my_geonode |     forced_update)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 877, in _do_update
django4my_geonode |     return filtered._update(values) > 0
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 580, in _update
django4my_geonode |     return query.get_compiler(self.db).execute_sql(CURSOR)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1062, in execute_sql
django4my_geonode |     cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
django4my_geonode |     cursor.execute(sql, params)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
django4my_geonode |     return super(CursorDebugWrapper, self).execute(sql, params)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
django4my_geonode |     return self.cursor.execute(sql, params)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
django4my_geonode |     six.reraise(dj_exc_type, dj_exc_value, traceback)
django4my_geonode |   File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
django4my_geonode |     return self.cursor.execute(sql, params)
django4my_geonode | django.db.utils.ProgrammingError: Problem installing fixture '/usr/src/my_geonode/my_geonode/fixtures/initial_data.json': Could not load base.TopicCategory(pk=1): relation "base_topiccategory" does not exist
django4my_geonode | LINE 1: UPDATE "base_topiccategory" SET "identifier" = 'geoscientifi...
django4my_geonode |                ^
django4my_geonode |
db4my_geonode    | ERROR:  relation "base_topiccategory" does not exist at character 8
db4my_geonode    | STATEMENT:  UPDATE "base_topiccategory" SET "identifier" = 'geoscientificInformation', "description" = 'information pertaining to earth sciences. Examples: geophysical features and processes, geology, minerals, sciences dealing with the composition, structure and origin of the earth s rocks, risks of earthquakes, volcanic activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion', "description_en" = 'information pertaining to earth sciences. Examples: geophysical features and processes, geology, minerals, sciences dealing with the composition, structure and origin of the earth s rocks, risks of earthquakes, volcanic activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion', "gn_description" = 'Geoscientific Information', "gn_description_en" = 'Geoscientific Information', "is_choice" = true, "fa_class" = 'fa-bullseye' WHERE "base_topiccategory"."id" = 1

Dockerfile expression to get correct pygdal version fails

Using 2.8 branch docker-compose build fails when unable to correctly assign the $PYGDAL_VERSION variable The expression:

PYGDAL_VERSION="$(pip install pygdal==$GDAL_VERSION 2>&1 | grep -oP '(?<=: )(.*)(?=))' | grep -oh $GDAL_VERSION.[0-9])"

on line 38 returns 2 lines.

Solution:
Append " | tail -1 " to the expression to return only one line.

"CommandError: No fixture named 'initial_data' found" during build

Hello,
when building the image in a fresh new geonode-project with docker-compose -f docker-compose.yml -f docker-compose.override.yml build --no-cache:

...
django4igag_geonode | CommandError: No fixture named 'initial_data' found.
django4igag_geonode | ***************************initial*********************************
...

I tried changing in tasks.py the line:

ctx.run("python manage.py loaddata /usr/src/geonode/geonode/base/fixtures/initial_data.json \

in:

ctx.run("python manage.py loaddata initial_data.json \

and it works, but I don't know if it's correct.

404 on thumbnails & other element

I have installed Geonode on Ubuntu in a client machine using VirtualBox. The network setting is NAT with port forwarding. So I can access the app from host machine using a port.

The problem is I got 404 on some elements such as thumbnails and image. It is because they are still on the original URL without port.

example:
http://localhost/uploaded/thumbs/layer-43ff4bd2-b699-11e8-87ab-0800272d59b9-thumb.png
This is the url as set in client machine. But in host machine, it still the same, without port. It should be:
http://localhost:82/uploaded/thumbs/layer-43ff4bd2-b699-11e8-87ab-0800272d59b9-thumb.png

So how to fix this? Is it possible?

config.xml file missing

using the geonode docs there is a configure file miss from here

  1. Edit /data/geoserver-data/security/auth/geonodeAuthProvider/config.xml with a text editor

$ sudo gedit /data/geoserver-data/security/auth/geonodeAuthProvider/config.xml

which doesnt exist. there are two other config files geofence and default

Migration error people_profile__old on pip install -r

when running pip install -r requirements.txt on a vanilla geonode-project following error is thrown:

  return super(Command, self).handle(*fixture_labels, **options)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 69, in handle
    self.loaddata(fixture_labels)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 115, in loaddata
    connection.check_constraints(table_names=table_names)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 286, in check_constraints
    column_name, referenced_column_name,
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/Users/ts/.virtualenvs/geonode_project/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 326, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: Problem installing fixtures: no such table: people_profile__old
```

CreateLayer function

Hi good day
Note that the crealayer function is not available in this version of geonode-project. Should we wait for an update? or can be activated

image

[GNPIP] Add geonode-project CLI with docker subcommand

Proposal

Currently we have got rid of mounting docker socket and the deployment cannot automagically discover ip address of the daemon along all the possible cases (Docker4Mac, Docker Machine, Native Linux, etc).
The aim of this command line is to give the users an utility to ease the configuration of docker-compose or optionally do automatically it through by modifying the root .env file.
Something like:

$ my_geonode docker (assuming django-admin has created a geonode-project called my_geonode)

docker-compose configuration
============================

GEONODE_HOST in .env file has to be as follow:

.env
----
GEONODE_HOST=localhost
$ my_geonode docker --config

GEONODE_HOST in .env file is being configured...
OK

After the manual/automatic configuration the stack can be launched as usual:

docker-compose up

Problems running this project

I'm having problems to run this project, both in my local machine and a freshly setup virtual machine, both running Ubuntu 16.04.

Docker version 1.13.0, build 49bf474
docker-compose version 1.10.0, build 4bd6f1a

Here are the steps to replicate the problem:

  1. Open the terminal, run the command: docker run -v 'pwd':/usr/src/app GeoNode/django:geonode django-admin.py startproject --template=https://github.com/GeoNode/geonode-project/archive/docker.zip -epy,rst,yml my_geonode
  2. Change my_geonode permission: sudo chown -R $USER:$USER my_geonode
  3. cd my_geonode
  4. docker-compose up

At this point the images are going to be retrieved, but an error rise when trying to pull waybarrios/geoserver:

Pulling geoserver (waybarrios/geoserver:latest)...
ERROR: manifest for waybarrios/geoserver:latest not found

So, I downloaded the necessary docker files from the waybarrios/geoserver repo, these are the steps:

  1. cd /my-docker-images/
  2. git clone https://github.com/waybarrios/docker-geoserver.git
  3. cd docker-geoserver
  4. docker build -t "waybarrios/geoserver" .

At this point, I went back into my_geonode folder, and ran again the command docker-compose up. This pastebin shows everything that have been printed on the screen.

Following the instructions on this repom, I opened a new terminal and run this command:
docker-compose run django python manage.py migrate
but it exited with an error. You can see what has been printed on the screen in this pastebin.

Am I doing something wrong?

/var/run/docker.sock should not be mounted

/var/run/docker.sock is mounted on many different containers and that is not suitable for production (it is not acceptable to give the right to geonode to manage Docker: this would be a security issue).
What it is used for? The software seems to run even without it.

"ImportError: No module named contrib" when using local_settings.py

I have been experiencing an issue for Geonode project running on docker. When using local_settings.py instead of settings.py, the Geonode cannot be built successfully.

I have reproduced this on a freshly started Geonode project. Here are the steps I took:

  1. git clone https://github.com/GeoNode/geonode-project.git -b master
  2. Start a new geonode project: django-admin startproject --template=./geonode-project -e py,rst,json,yml,ini,env,sample -n Dockerfile my_gdp
  3. Copy local_settings.py.sample and rename it into local_settings.py
  4. In wsgi.py, apply the change: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_gdp.local_settings")
  5. Run: docker-compose -f docker-compose.yml -f docker-compose.override.yml up --build

After that, you'll see the error message as below:

celery4my_gdp    | running migrations
django4my_gdp    | **************************migrations*******************************
django4my_gdp    | Traceback (most recent call last):
django4my_gdp    |   File "manage.py", line 31, in <module>
django4my_gdp    |     execute_from_command_line(sys.argv)
django4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
django4my_gdp    |     utility.execute()
django4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
django4my_gdp    |     django.setup()
django4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
django4my_gdp    |     apps.populate(settings.INSTALLED_APPS)
django4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
django4my_gdp    |     app_config = AppConfig.create(entry)
django4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 120, in create
django4my_gdp    |     mod = import_module(mod_path)
django4my_gdp    |   File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
django4my_gdp    |     __import__(name)
django4my_gdp    | ImportError: No module named contrib
celery4my_gdp    | **************************migrations*******************************
celery4my_gdp    | Traceback (most recent call last):
celery4my_gdp    |   File "manage.py", line 31, in <module>
celery4my_gdp    |     execute_from_command_line(sys.argv)
celery4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
celery4my_gdp    |     utility.execute()
celery4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
celery4my_gdp    |     django.setup()
celery4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
celery4my_gdp    |     apps.populate(settings.INSTALLED_APPS)
celery4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
celery4my_gdp    |     app_config = AppConfig.create(entry)
celery4my_gdp    |   File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 120, in create
celery4my_gdp    |     mod = import_module(mod_path)
celery4my_gdp    |   File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
celery4my_gdp    |     __import__(name)
celery4my_gdp    | ImportError: No module named contrib

The Geonode project cannot be built successfully due to the above error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.