Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

Installation for Developers

Craig M. Stimmel edited this page Mar 13, 2013 · 6 revisions

Installation for Developers

This is our recommended installation for developers who wish to contribute to SpotSeeker or adapt it for their own purposes. The use of virtualenv is optional, but helps to keep your system Python installation tidy.

Prerequisites

  • A Python installation
  • pip
  • git

Step-by-step

  1. If you don't have it already, install virtualenv:

    $ pip install virtualenv
    
  2. Clone the spotseeker-web repository

    $ git clone git://github.com/uw-it-aca/spotseeker-web.git
    
  3. Turn spotseeker-web into a virtualenv:

    $ virtualenv --no-site-packages spotseeker-web
    
  4. Activate your virtualenv:

    cd spotseeker-web
    source bin/activate
    
  5. Install required Python packages with pip:

    $ pip install -r requirements.txt
    
  6. Create a django project in spotseeker-web dir:

    $ django-admin.py startproject spotseeker .
    
  7. Modify at least the following settings in spotseeker/settings.py:

    • ADMINS
    • DATABASES
    • MEDIA_ROOT
    • MEDIA_URL
    • TEMPLATE_DIRS - needs to include the full path to (and including) spotseeker_web/templates
    • INSTALLED_APPS (add spotseeker_web)
  8. Map urls to the spotseeker_web app by adding the following to urlpatterns in spotseeker/urls.py:

    url(r'', include('spotseeker_web.urls')),
  9. Add static files as something the development server should serve in spotseeker/urls.py after the existing urlpatterns:

    from django.conf import settings
    
    if settings.DEBUG:
        urlpatterns += patterns('',
            url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
                'document_root': settings.MEDIA_ROOT,
            }),
        )
  10. Add configuration to your settings.py needed to talk to a spotseeker rest server:

Required configuration (these also go in your settings.py):

SS_WEB_SERVER_HOST = 'http://hostname:port_number'
SS_WEB_OAUTH_KEY = 'your oauth key'
SS_WEB_OAUTH_SECRET = 'your oauth secret'

Optional configuration - with these your map will start centered on the UW Seattle campus:

DEFAULT_CENTER_LATITUDE = '47.655003'
DEFAULT_CENTER_LONGITUDE = '-122.306864'
DEFAULT_ZOOM_LEVEL = '15'
  1. Create your database:

    $ python manage.py syncdb
    $ python manage.py migrate
    
  2. You should now be able to run your development server:

    $ python manage.py runserver
    
Clone this wiki locally