diff --git a/dbtemplates/settings.py b/dbtemplates/settings.py index deee121..677260f 100644 --- a/dbtemplates/settings.py +++ b/dbtemplates/settings.py @@ -18,8 +18,11 @@ ADD_DEFAULT_SITE = getattr(settings, 'DBTEMPLATES_ADD_DEFAULT_SITE', True) AUTO_POPULATE_CONTENT = getattr(settings, 'DBTEMPLATES_AUTO_POPULATE_CONTENT', True) +base_url = getattr(settings, "STATIC_URL", None) +if base_url is None: + base_url = settings.MEDIA_URL MEDIA_PREFIX = getattr(settings, 'DBTEMPLATES_MEDIA_PREFIX', - posixpath.join(settings.STATIC_URL, "dbtemplates/")) + posixpath.join(base_url, "dbtemplates/")) USE_REVERSION = getattr(settings, 'DBTEMPLATES_USE_REVERSION', False) diff --git a/docs/settings.txt b/docs/settings.txt index a6ded84..3494c14 100644 --- a/docs/settings.txt +++ b/docs/settings.txt @@ -43,10 +43,10 @@ slash, and to have this be different from the ``STATIC_URL`` setting files). .. warning:: - Starting in version 1.0 dbtemplates uses the ``STATIC_URL`` setting, + Starting in version 1.0, ``dbtemplates`` uses the ``STATIC_URL`` setting, originally introduced by the django-staticfiles_ app. The app has since been added to Django itself and isn't needed if you use Django 1.3 or higher. Please refer to the `contrib docs`_ in that case. .. _django-staticfiles: http://pypi.python.org/pypi/django-staticfiles -.. _contrib docs: http://docs.djangoproject.com/en/dev/ref/staticfiles/ \ No newline at end of file +.. _contrib docs: http://docs.djangoproject.com/en/dev/ref/staticfiles/