mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-03-16 22:20:28 +00:00
Fall back to MEDIA_URL actually, to make sure we don't hit an AttributeError with the default value of None.
This commit is contained in:
parent
c11afa37ad
commit
5c8d2eefde
2 changed files with 6 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
.. _contrib docs: http://docs.djangoproject.com/en/dev/ref/staticfiles/
|
||||
|
|
|
|||
Loading…
Reference in a new issue