I recently installed GeoNode and integrated an application into it and thought I would share some notes on the process.
By the end of the guide you should have a fully functioning GeoNode installed including multiple client and Django application locally or on a server.
In part I of the blog I covered installing GeoNode onto Ubuntu 10.10 server and adding a client application. Part II covers using Django-schemata/South in the context of GeoNode and adding multiple Django applications to GeoNode.
Step 3: Adding a Django a Application
If you also have a Django application that you would like to integrate there are just a few steps needed.
First place a copy of the application somewhere on your server or local machine and then create a symlink of your Django application in /var/lib/geonode/src/GeoNodePy/geonode with a comment like:
ln -s /location/of/Django_app/ /var/lib/geonode/src/GeoNodePy/geonode/Django_app
Then let GeoNode know that there is a new Django application by editing the client build.xml
<property name="app.proxy.MYDJANGOAPP" value="http://localhost/MYDJANGOAPP/"/>
Next add your Django application to INSTALLED_APPS in /var/lib/geonode/src/GeoNodePy/geonode/settings.py:
INSTALLED_APPS = (
'geonode.YOURDJANGOAPP',
....
)
You will then need to restart tomcat, apache, and postgres.
How are you feeling? Everything ok? At this point you should be able to view your application at the IP address you used above or localhost.
For my application it does not end here, there’s more… I need GeoNode to handel database schema migrations. I will be adjusting tables and views frequently. I also need my geometry columns to be properly registered within geometry_columns in the database.
Django south and Django Schemata are a solution. This allows one to migrate database changes, it allows one to use multiple database schemas, and it registers the geometry columns.
Step 4: Adding a Django-Schemata & South
Install Django South. * note you need to install south from inside your GeoNode virtual environment, to do so run:
source /var/lib/geonode/bin/activate
and then:
pip install South
You need to clone the Django-schemata github repository to your GeoNode server and the make a symlink to django_schemata/ directory from /var/lib/geonode/src/GeoNodePy/geonode
Now you’ve installed South system-wide, you’ll need to configure Django to use it. Doing so is simple; just edit your settings.pyand add to the end of INSTALLED_APPS:
'south'
and
'django_schemata'
Also in settings.py add to MIDDLEWARE_CLASSES:
'django_schemata.middleware.SchemataMiddleware'
In local_settings.py I have the following settings for the DATABASE:
DATABASES = {
'default': {
'ENGINE': 'django_schemata.postgresql_backend',
'NAME': DATABASE_NAME,
'USER': DATABASE_USER,
'PASSWORD': DATABASE_PASSWORD,
'HOST': DATABASE_HOST,
'PORT': DATABASE_PORT,
}
}
Also add to local_settings.py:
SOUTH_DATABASE_ADAPTERS = {
'default': 'south.db.postgresql_psycopg2',
}
To test and see if Django-Schemata and South are running correctly, and to set up your domains please refer to the schemata management commands
For more information:
At this point I am going to pass you along to other resources. You can find more information about GeoNode’s plans to use these tools here. You can learn more about how to setup and use Django-Schemat here at the project’s GitHub project repository, and in a nice blog written my colleague: PostgreSql schema support, PostGIS and Django. At this point I apologies for the limited documentation on the topic as we have been limited on time, here you can see some information about what was done on our specific application.
In summary you need to install Django South
Step 5: Adding multiple Django applications to GeoNode
With all of this in place you can now merge multiple Django application into one GeoNode environment, each one managing it’s own perspective database schema, while conglomerating all the required geometry columns into the public geometry_columns table.
First create a new Django app from your root Django project directory using django south with:
sudo python ./manage.py startapp YOURNEWDJANGOAPP
Add the new Django app to INSTALLED APPS in settings.py as we did above in step 3.
Then add the application to SCHEMATA_DOMAINS in /var/lib/geonode/src/GeoNodePy/geonode/local_settings.py this should look something like this:
SCHEMATA_DOMAINS = {
'178.79.183.128': {
'schema_name': 'gem',
},
'178.79.185.195': {
'schema_name': 'ged',
},
'django': {
'schema_name': 'public',
},
}
Now add the symlink for the new Django application in /var/lib/geonode/src/GeoNodePy/geonode/
then run (within your GeoNode virtual environment) in /var/lib/geonode/src/GeoNodePy/geonode:
python ./manage.py schemamigration YOURNEWAPPIP --initial
export DJANGO_SCHEMATA_DOMAIN=YOURNEWAPPIP
python ./manage.py migrate_schemata YOURNEWAPPNAME # add "--fake" depending on weather sync db has been used
If you have made it this far, congrats! You should now have fully functioning GeoNode that has multiple Django applications, all of which are maintaining their perspective database schemas.
Hope this helps and happy GeoNoding


Many of our users are members of the earthquake community. They are interested in learning how OpenQuake can compute Hazard and Risk and produce results. We have had some of our users install OpenQuake on their computers, but this has in some cases taken lots of time and effort. Once up and running, OpenQuake is large and complex and it can consume a lot of computing resources. It is due to these issues that we created OATS to provide access to OpenQuake without the overhead of a local install while providing good performance and most importantly a positive experience.