Skip to main content

An app to enable development and hosting capabilities for Tethys Apps.

Project description

Tethys apps is an app that adds the capabilities to develop and host Tethys apps within your site.

Installation

Tethys Apps can be installed via pip or by downloading the source. To install via pip or easy_install:

pip install django-tethys_apps

To install via download:

git clone https://github.com/CI-WATER/django-tethys_apps.git
cd django-tethys_apps
python setup.py install

Django Configuration

  1. Add “tethys_apps” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'tethys_apps',
    )
    
  2. Include the Tethys URLconf in your project urls.py like this:

    url(r'^apps/', include('tethys_apps.urls')),
    
  3. Add the Tethys static files finder to STATICFILES_FINDERS setting. Also, include the default staticfiles finders:

    STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder',
                           'django.contrib.staticfiles.finders.AppDirectoriesFinder',
                           'tethys_apps.utilities.TethysAppsStaticFinder')
    
  4. Add the Tethys apps template loaders to the TEMPLATE_LOADERS setting. Also, include the default template loaders:

    TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
                        'django.template.loaders.app_directories.Loader',
                        'tethys_apps.utilities.tethys_apps_template_loader')
    
  5. Add the Tethys apps context processor and include all the default context processors:

    TEMPLATE_CONTEXT_PROCESSORS = ('django.contrib.auth.context_processors.auth',
                                   'django.core.context_processors.debug',
                                   'django.core.context_processors.i18n',
                                   'django.core.context_processors.media',
                                   'django.core.context_processors.static',
                                   'django.core.context_processors.tz',
                                   'django.contrib.messages.context_processors.messages',
                                   'tethys_apps.context_processors.tethys_apps_context')
    

6. Tethys apps requires a PostgreSQL > 9.1 database with the PostGIS > 2.1 extension. Refer to the documentation for each project for installation instructions. After installing the database, create two users with databases. Take note of the passwords, you will need them in the next step:

sudo -u postgres createuser -S -d -R -P tethys_db_manager
sudo -u postgres createdb -O tethys_db_manager tethys_db_manager -E utf-8

sudo -u postgres createuser --superuser -d -R -P tethys_super
sudo -u postgres createdb -O tethys_super tethys_super -E utf-8
  1. Provide the connection credentials for the two databases you created. Replace “pass” with the passwords you gave the users:

    TETHYS_DATABASES = {
        'tethys_db_manager': {
            'NAME': 'tethys_db_manager',
            'USER': 'tethys_db_manager',
            'PASSWORD': 'pass',
            'HOST': '127.0.0.1',
            'PORT': '5435'
        },
        'tethys_super': {
            'NAME': 'tethys_super',
            'USER': 'tethys_super',
            'PASSWORD': 'pass',
            'HOST': '127.0.0.1',
            'PORT': '5435'
        }
    }
    
  2. Run python manage.py migrate to create the database models.

9. Tethys Apps synthesizes several other django apps. They will be automatically installed when you run the setup script but you will need to add the configuration parameters for those apps to your settings file. Rather than duplicate the documentation for configuration of those apps here, please refer to the readme’s for each of the following django apps (which you can find on git hub):

  1. Start up the server with python manage.py runserver and visit http://127.0.0.1:8000/apps/ to view the apps library.

Quick Start

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-tethys_apps-0.9.0.tar.gz (102.4 kB) Copy SHA256 hash SHA256 Source None Feb 4, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page