Skip to content

Instantly share code, notes, and snippets.

@FinalAngel
Last active August 29, 2015 14:06
Show Gist options
  • Save FinalAngel/43ce250be5a03650c92d to your computer and use it in GitHub Desktop.
Save FinalAngel/43ce250be5a03650c92d to your computer and use it in GitHub Desktop.
Local Dev Storage

Instructions

Go to your projects src/settings_local.py and add the following code at the end:

DEFAULT_FILE_STORAGE = 'localdevstorage.http.HttpStorage'
LOCALDEVSTORAGE_HTTP_FALLBACK_DOMAIN = 'http://divio-live.divio.ch/'
LOCALDEVSTORAGE_HTTP_USERNAME = 'divio'
LOCALDEVSTORAGE_HTTP_PASSWORD = 'passsword'
LOCALDEVSTORAGE_IGNORE_PATTERNS = [
    '^filer_public_thumbnail.*',
]

FILER_STORAGES = {
    'public': {
        'thumbnails': {
            'ENGINE': 'django.core.files.storage.FileSystemStorage',
            'OPTIONS': {},
            'THUMBNAIL_OPTIONS': {
                'base_dir': 'filer_public_thumbnails',
            },
        },
    }
}

Set the correct values for:

  • LOCALDEVSTORAGE_HTTP_FALLBACK_DOMAIN
  • LOCALDEVSTORAGE_HTTP_USERNAME
  • LOCALDEVSTORAGE_HTTP_PASSWORD

Username and Password can be empty, if the dev or live server is protected use those credentials.

Finally install the requirement in your virtualenv by:

  • run source env/bin/activate
  • run pip install django-localdevstorage

more infos can be found on https://github.com/piquadrat/django-localdevstorage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment