SVN
—
Use SVN clients that are at SVN 1.6 or better.
Do not mix SVN client versions lest you enjoy pain and suffering.
If you are on windows 7 64 bit, you can get the svn command line client:
http://www.sliksvn.com/en/download
otherwise just take it from collabnet.
putty
Install the full suite.
python 2.5.4
http://www.python.org/ftp/python/2.5.4/ for msi to install this version. Download python-2.5.4.msi and run the installer.
Place this in the standard location.
windows: C:\Python25
linux: /usr/local/lib/python2.5/
NOTE: add %PATH%;C:\Python25 to your ENV PATH variable in Windows.
Right click My Computer/Properties/Advanced/Environment Variables and then in the User Variables create PATH if it
doesn't already exit. For the value add %PATH%;C:\Python25. If PATH does exist, simply edit path and append ;C:\Python25
to the value already there. See below for full path variables you need to add
simplejson
simplejson is distributed with Django
geojson http://pypi.python.org/pypi/geojson/1.0.1
gdalwin32-1.5
Install by following this link: http://pypi.python.org/pypi/GDAL/1.5.2
Path ENV will be C:\gdalwin32-1.5\bin;
Postgres 8.3.7
Download http://wwwmaster.postgresql.org/download/mirrors-ftp/binary/v8.3.7/win32/postgresql-8.3.7-1.zip
Unzip and install
During the installation process, a database will be created and Postgress server will run. It is not necessary to run
the database service. You can stop the service under Programs/PostGresSQL and select stop service.
Launch the Application Stack Builder (Programs -> PostgreSQL 8.3), choose
'PostgreSQL Database Server 8.3 on port 5432' from the drop down menu and then select to install PostGIS 1.3.3.
C:\Program Files\PostgreSQL\8.3\bin contains the necessary dlls for PostGIS and GEOS libraray and should be included in
your path (see below)
psycopg2
Richard is running psycopg2 2.0.7 because (Richard, we need some detail here)
http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.0.7.win32-py2.5-pg8.3.1-release.exe
Unless there is a compelling reason to do so, we should all be using else should be running 2.0.12.
This is the "prefer" version:
http://www.stickpeople.com/projects/python/win-psycopg/index.2.0.12.html#Version2
Django
use SVN --http://code.djangoproject.com/svn/django/trunk/django/
version 11368 (type this into the version area when exporting with SVN)
We use this version because of an issue with geodjango in the 1.1 release (version 11366)
This goes here:
C:\Python25\Lib\site-packages\django
or here
/usr/local/lib/python2.5/site-packages/django
Jogging
Download Jogging v0.2.2
http://github.com/zain/jogging/zipball/v0.2.2
or
http://github.com/zain/jogging/tarball/v0.2.2
in Windows: unzip file, copy the content folder called "jogging" to C:\Python25\Lib\site-packages or /usr/local/lib/python2.5/site-packages
in Linux: get gz file, unzip, untar, then run from jogging directory: $ python2.5 setup.py install
For the Change Notification process, the xmit_daemon.py script uses a system variable called MAD_HOME.
MAD_HOME is set by xmit_change_notifications.bsh; it must point to the path where the web application is deployed.
MAD_HOME is used to access the django settings.py.
This daemon process runs outside of the web server.
7-zip
Used for deploy automation.
Depending on your system you may need to add this to the system path.
Robocopy
Used for deploy automation.
Depending on your version of Windows you may need to install the Windows Server 2003 Resource Kit Tools specifically for Robocopy.
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
Geoserver
---------
We use Geoserver 1.7.4 to create maps.
http://geoserver.org/display/GEOS/Welcome
We run Geoserver on Tomcat 5.
http://tomcat.apache.org/
And we run tomcat on java 1.6.
http://www.java.com/en/
This install "how to" focuses on a production environment:
http://eas.googlecode.com/svn/trunk/docs/html/java_tomcat_geoserver.html
If you just want to get something running, you can probably just install tomcat and deploy geoserver.
Developer Setup
---------------
I install the code and libs here:
C:\svn\eas\
but of course, do what works for you.
For setup.bat to work as is you need access to google code and to SFs jira site.
C:\svn\> setup.bat eas
Add these to you system path:
python2.5 binaries (e.g. C:\Python25)
gdal binaries (e.g. C:\gdalwin32-1.5\bin)
postgres binaries (e.g. C:\Program Files\PostgreSQL\8.3\bin
After connecting to the database via Putty SSH tunnel, start the server with this command
/django/SF/web python manage.py startsever
URLs
Website address is: http://localhost:8000/debug
Website address is: http://localhost:8000/build
Website address is: http://localhost:8000/admin
Website address is: http://localhost:8000/
Database
We have also made available for download a dump from the San Francisco database.
The EAS databse is here
http://eas.googlecode.com/files/mad-1_0-prod.backup
The database used by geoserver is here
http://eas.googlecode.com/files/sfmaps.backup
ETL Processing
--------------
python as above
psycopg2 as above
application code: ETL node only
You also need to install the following packages.
PyDB2
This is the python db2 driver.
First install any DB2 distribution that has a DB2CLI.DLL, for example, DB2 Express-C.
Note that you cannot simply install DB2CLI.DLL because there are dependencies.
Then install PyDB2. Currently, works with PyDB2 1.1.1 using Windows installer.
PyDB2-1.1.1-1.win32-py2.5.zip
available here
http://sourceforge.net/projects/pydb2/
paramiko
http://www.lag.net/paramiko/
This is an ssh library.
We use paramiko for secure FTP.
We can and should debate weather to use plink (putty) or paramiko for ssh tunnels.
Follow the instructions provided by paramiko.
Apache settings
---------------------
This is for deployment onto QA/PROD using apache.
If using apache to serve the application, Django doesn't serve the admin media files.
So we will need to 1.) make a softlink to the django admin media files location in your web server
document root(defined in httpd conf), usually /var/www/html. Or 2.)copy the media files over.
More readings here http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-media-files
=======
TESTING
=======
We do not do take standard django approach to testing - its a bit too rigorous for a project this size.
For example, we do not want to truncate the database for our testing.
We use a relatively lightweight approach to testing.
To see how we do this take a look at the following:
./test_suites.py
./settings.deploy
To test, comment in the tests of interest in settings.deploy and simple type
$ python manage.py test
A lot has been written about when to write a test.
I kind of like the stupidity driven approach:
http://ivory.idyll.org/blog/feb-07/stupidity-driven-testing.html
In any case, if you find yourself repeatedly testing something by hand, please try to automate it.
A common anti pattern is to remove tests.
This rarely makes sense.
Please treat the test code is a first class citizen - craftsmanship counts as usual.
SUPPORT
=======
log files located here:
/mnt/logs/sfmaps_web
NOTES
=====
Projections
-----------
If you are having a problem getting a layer to show up, it might be the way a projection is defined.
Recall that projections are defined in several places including postgresql, geoserver, javascript, and gdal.
A good resource is
http://spatialreference.org/
but it's tricky
http://jira.codehaus.org/browse/GEOT-1511
URLs
Developer Geoserver Access
geoserver admin - DEV (sfgov3)
geoserver admin - QA (sfgov1)
Developer Desktop
http://localhost:8000/debug
http://localhost:8000/build
http://localhost:8000/
DEV (applogic)
http://209.126.186.37/debug
http://209.126.186.37/build
http://209.126.186.37/
QA (applogic)
http://174.37.80.164/mad/
Add Comment