Introduction to Configuring GeoNode (Basics)
GeoNode is built on top of Django. As a Django application GeoNode follows the common rules of a Django project.
In particular every Django project must have a special python file called settings.py which will be used to set the global variables and behavior of the whole framework.
Some settings variables are mandatory for a Django project, as an instance the version, the site url, the allowed hosts, the database configuration, the debug mode, etc… For more information about the common Django settings you can check the official Django documentation.
GeoNode Settings
GeoNode, of course, has this file too which is located into the /opt/geonode/geonode/settings.py location.
-
In order to inspect the contents of the GeoNode
settingsfile, open a file system browser and open it with a text editor
There are plenty of variables listed on the settings file, most of them have a notation similar to the following one:
SITEURL = os.getenv('SITEURL', _default_siteurl)
That means that GeoNode looks first for the variable value into the System Environment and, if no value or variable has been found, it falls back to a default one.
You can find a full list of available settings from the GeoNode official documentation here.
Exercise: Settings Update to Toggle User Registration
Changing some GeoNode settings can be done by:
- Udate or add the corresponding
ENVvariable value (or add it if missing) - Restart the Django service
-
Go to the folder
/opt/geonode/and enable the Pythonvirtualenvby typing:workon geonode -
Edit the
UWSGIfile setting the systemENVby typing:sudo vim /etc/uwsgi/apps-enabled/geonode.ini -
Search for the line
env = ACCOUNT_OPEN_SIGNUP=Trueand turn it to
Falseenv = ACCOUNT_OPEN_SIGNUP=Falsesave and close by typing the sequence
ESC:wq! -
Restart the
UWSGIservice by typing:touch geonode/wsgi.py -
Follow the GeoNode
logsin order to be sure that everything is oksudo tail -500f /var/log/uwsgi/app/geonode.log -
Once the service restarted successfully, refresh the GeoNode home page, sign out if logged in, and verify that the user registration is now disabled
