Install GeoNode for Development¶
In order to install Geonode 2.0 in developing mode on Ubuntu 12.04 the following steps are required:
For Windows: (_install_win_devmode)
- install build tools and libraries
- install dependencies (Python and Java) and supporting tools
- add PPA repository
- set up a virtual environment (virtualenv)
- clone geonode from github and install it in the virtual environment
- run paver to get install geoserver and start the development servers
Note
The following steps have to be executed in your terminal. The steps have to be done as a root user, therefore don´t forget to type sudo in front!
retrieve latest apt-get list
$ sudo apt-get update
Install build tools and libraries
$ sudo apt-get install -y build-essential libxml2-dev libxslt1-dev libpq-dev zlib1g-dev
Install dependencies
Python native dependencies
$ sudo apt-get install -y python-dev python-imaging python-lxml python-pyproj python-shapely python-nose python-httplib2 python-pip python-software-properties
Install Python Virtual Environment
$ sudo pip install virtualenvwrapper
Java dependencies
$ sudo apt-get install -y --force-yes openjdk-6-jdk ant maven2 --no-install-recommends
supporting tools
$ sudo apt-get install -y git gettext
Node and tools required for static development
This is required for static development
$ sudo add-apt-repository -y ppa:chris-lea/node.js $ sudo apt-get update $ sudo apt-get install -y nodejs $ sudo npm install -y -g bower $ sudo npm install -y -g grunt-cli
Set up a virtual environment
Here is where Geonode will later be running.
Add the virtualenvwrapper to your new environement
$ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python $ export WORKON_HOME=~/.venvs $ source /usr/local/bin/virtualenvwrapper.sh $ export PIP_DOWNLOAD_CACHE=$HOME/.pip-downloads
set up the local virtual environment for Geonode
$ mkvirtualenv geonode $ workon geonode
This creates a new directory where you want your project to be and creates a new virtualenvironment
Get the code
To download the latest geonode version from github, the command clone is used
$ git clone https://github.com/GeoNode/geonode.git
Install GeoNode in the new active local virtualenv
$ pip install -e geonode --use-mirrors $ cd geonode
If the install fails because of an error related to pyproj not being verified (happens on pip 1.5), use the following:
$ pip install -e geonode --use-mirrors --allow-external pyproj --allow-unverified pyproj
Compile and Start the server
The last step is to compile GeoServer and setup
$ paver setup
Now we can start our geonode instance
$ paver start
Visit the geonode site by typing http://localhost:8000 into your browser window.
If the start fails because of an import error related to osgeo, then please consult the GDAL for Development Guide.
To stop the server
type hold Ctrl c on your keyboard to stop the server
now type:
$ paver stop # to stop all django, geoserver services
Next create a superuser for your django geonode
Create a superuser so you can log on to your local geonode installation at http://localhost:8000
$ django-admin.py createsuperuser –-settings=geonode.settings
Start working on Geonode the next day after install¶
With every restart of your machine, you have to restart geonode as well. That means, you will not be able to open http://localhost:8000 directly after starting your machine new. In order to be able to use geonode now, you have to activate your virtualenvironment and to start the development servers.
Note
username is the name of your machine and personal folder!
Activate virtualenv
To activate your virtualenv you just need to type
$ workon geonode
or
$ source /home/username/.venvs/geonode/bin/activateNote
Be careful with the path, it might not be the same for you!
Start the server
$ cd geonode $ paver start_geoserver $ paver start_djangoNow you are able to access http://localhost:8000 again.
Note
Remember that you have to do these steps each time you restart your machine!!
Hint
Now you’ve followed these installation instructions, geonode is running in development mode. This also means that you are using all the default settings of geonode. If you want to change them, e.g use Tomcat instead of Jetty, or Postgresql instead of sqlite3, you may follow the steps from the section Configure Manually in Custom Installation Guide.