“GeoNode provides additional management operations which are available from the commandline”
GeoNode provides command-line options for doing various administrative tasks in GeoNode. These are provided from the command line interface and utilize the python administration utilities which are only accessible on the host where GeoNode is installed.
These commands can be run by an administrator with programming knowledge and are an extension of the admin interface as they allow users to do additional tasks that are not available in the admin interface. Some of the functions that might be performed using this interface may include:
In this module, we explore the management interface from the command line.
Goal: To explore the some management commands
Docker or Kubernetes
Run the following command
python manage.py --help
Download the raster using the command line tool like get or curl
mkdir raster;
wget https://github.com/kartoza/docker-mapserver/blob/master/map/E020N40.tif - O raster/E020N40.tif
Inspect the command to use to ingest the raster into GeoNode
python manage.py importlayers -n "East Africa" -v 3 raster
Inspect the layer in GeoNode to see if has been published.
Virtual Env
Check your results
When you are in the Django container you should be able to run a command without getting an error message. Execute python manage.py createsuperuser to ensure that you set up a master account on GeoNode.
Name | Expectation |
---|---|
GeoNode Install method ❗ |
Rancher, Docker-compose, Ansible, Virtual Env |
Docker container lookup ❗ |
docker ps -a |
Django Container Log in (Docker) ❗ |
docker exec it django bash |
Python Management Commands lookup ❗ |
python manage.py --help |
GeoNode is built with Django and Python, with a backend of Geoserver and a PostgreSQL database. The application framework provides an admin interface that allows users to manipulate all the data and other related components relating to permissions for layers, however, a management commandline interface provides a set of management tools that extend the functionality of the administrative interface with additional commands.
Management commands are executed with the python interpreter and modify the Django project configuration settings. Typically, this will be executed using the command formatted similar to python manage.py <command_name>
, or with the settings object explicitly stated with additional command flags similar to the format of DJANGO_SETTINGS_MODULE=geonode.settings python manage.py <command_name> --<flags>
.
The application supports multiple management commands inclusing:
For a full list of all the management commands execute python manage.py -help
. Each individual command may require additional parameters which may be reviewed e.g. python manage.py importlayers -help
The two most common applications of the management commands are typically:
What components make up GeoNode :❗
Why would you want to use the command line management commands vs admin interface accessible on the browser:❗
Can users execue the command line management tools:❗