Skip to content

Installation for developers

Craig M. Stimmel edited this page May 23, 2012 · 23 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 (2.5 or greater)
  • pip or easy_install
  • git
  • JPEG libraries from http://www.ijg.org/ (Optional, but PIL will not support JPEG images without it.)

Step-by-step

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

    $ pip install virtualenv
    

    if you don't have pip, you may be able to:

    $ easy_install virtualenv
    
  2. Clone the spotseeker-server repository

    $ git clone git://github.com/vegitron/spotseeker-server.git
    
  3. Turn spotseeker-server into a virtualenv:

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

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

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

    $ django-admin.py startproject spotseeker .
    

    That '.' at the end is important!

  7. Modify at least the following settings in spotseeker/settings.py:

    • ADMINS
    • DATABASES
    • MEDIA_ROOT
    • MEDIA_URL
    • INSTALLED_APPS (add 'south', 'spotseeker_server', and 'oauth_provider')
    • SPOTSEEKER_AUTH_MODULE (set it to either 'spotseeker_server.auth.all_ok' or 'spotseeker_server.auth.oauth')
  8. Map urls to the spotseeker_server app by adding the following to urlpatterns in spotseeker/urls.py:

    url(r'^api/', include('spotseeker_server.urls')),
  9. Add uploaded 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'^media/(?P<path>.*)$', 'django.views.static.serve', {
                'document_root': settings.MEDIA_ROOT,
            }),
        )
  10. Create your database:

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

    $ python manage.py runserver
    

Clone this wiki locally