Introduction to Configuring GeoNode (Basics)
GeoNode is built on the Django framework. As a Django application, GeoNode adheres to the common rules of a Django project.
In particular, every Django project must have a special python file called settings.py that will be used to set the global variables and behavior of the entire framework.
Some settings variables are mandatory for a Django project, such as the version, site url, allowed hosts, database configuration, debug mode, etc. For more information on the most common Django settings check out the official Django documentation.
GeoNode Settings
GeoNode, of course, also has the settings.py file. It can be located in the /opt/geonode/geonode/settings.py directory.
Open a file system browser and a text editor to inspect the contents of the GeoNode
settingsfile.
There are plenty of variables listed in the settings file, most of them have a similar notation to the following one:
SITEURL = os.getenv('SITEURL', _default_siteurl)
That means that GeoNode first looks for the variable value in 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 official GeoNode documentation here.
Exercise: Settings Update to Toggle User Registration
Changing some GeoNode settings can be done by:
Updating or adding the corresponding
ENVvariable valueRestarting 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=True
and change it to
Falseenv = ACCOUNT_OPEN_SIGNUP=False
save and close by typing the sequence
ESC:wq!Restart the
UWSGIservice by typing:touch geonode/wsgi.pyCheck the GeoNode
logsin order to be sure that everything is oksudo tail -500f /var/log/uwsgi/app/geonode.log
Once the service has successfully restarted, refresh the GeoNode home page, sign out if logged in, and verify that the user registration is now disabled
