“GeoNode has additional python commands which is only accessible on the host where GeoNode is installed”
GeoNode provides command-line options for doing various administrative tasks in GeoNode. These commands can be run by an administrator with programming knowledge. These commands also help in the automatic ingestion of the large raster into GeoNode. The management commands are an extension of the admin interface as they allow user to do additional tasks that are not available in the admin interface.
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 either Geoserver or QGIS server and a PostgreSQL database backend. Django has an admin interface that allows users to manipulate all the data and other related components relating to permissions for layers. The management command provides a set of management tools that extend the functionality of the Django admin.
Example of management commands on the command-line. Assume all commands start with python manage.py $name of the command. Where the $name of command could be
For a full list of all the management commands execute python manage.py –help and choose each individual command to understand how it can be executed for example python manage.py importlayers –help
Probably the two main reasons you would need the management commands are:
What components make up GeoNode :
Why would you want to use the command line management commands vs admin interface accessible on the browser:
How would you use the command line management tools: