Skip to content

Installation instructions

Patrick Michaud edited this page Dec 29, 2013 · 12 revisions

Installation for Developers

This is our recommended installation for developers who wish to contribute to SQLShare 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

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 sqlshare repository

    $ git clone git://github.com/vegitron/sqlshare.git
    
  3. Turn sqlshare into a virtualenv:

    $ virtualenv --no-site-packages sqlshare
    
  4. Activate your virtualenv:

    cd sqlshare
    source bin/activate
    
  5. Install required Python packages with pip:

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

    $ django-admin.py startproject ss_project .
    

    That '.' at the end is important!

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

    • INSTALLED_APPS ('sqlshare')
    • SQLSHARE_SECRET

    SQLSHARE_SECRET should have the value used in the Authorization header, that looks like this: ss_trust <username> : <SQLSHARE_SECRET>

  8. Map urls to the sqlshare app by adding the following to urlpatterns in ss_project/urls.py:

    In the content below, make sure you replace with the actual path.

    url(r'^sqlshare/', include('sqlshare.urls')),
    url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
  9. Create your database:

    $ python manage.py syncdb
    
  10. Create yourself a user:

https://docs.djangoproject.com/en/dev/topics/auth/default/#user-objects
  1. You should now be able to run your development server:

    $ python manage.py runserver
    
Clone this wiki locally