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
settings
file.
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
ENV
variable valueRestarting the Django service
Go to the folder
/opt/geonode/
and enable the Pythonvirtualenv
by typing:workon geonode
Edit the
UWSGI
file setting the systemENV
by typing:sudo vim /etc/uwsgi/apps-enabled/geonode.ini
Search for the line
env = ACCOUNT_OPEN_SIGNUP=True
and change it to
False
env = ACCOUNT_OPEN_SIGNUP=False
save and close by typing the sequence
ESC
:wq!
Restart the
UWSGI
service by typing:touch geonode/wsgi.py
Check the GeoNode
logs
in 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