From: Stefan Kögl Date: Sun, 21 Jul 2013 09:34:50 +0000 (+0200) Subject: use django.contrib.staticfiles X-Git-Url: https://repo.or.cz/w/mygpo.git/commitdiff_plain/8e0ab5c12250d297b18ed47f196726b5563f6e1e use django.contrib.staticfiles --- diff --git a/.gitignore b/.gitignore index c436afc5..438e23b8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ doc/_build # vim swap files *.swp + +# static files copied by the collectstatic command +mygpo/staticfiles/ diff --git a/mygpo/settings.py b/mygpo/settings.py index 049f7874..2bfd81b1 100644 --- a/mygpo/settings.py +++ b/mygpo/settings.py @@ -102,14 +102,12 @@ SITE_ID = 1 # to load the internationalization machinery. USE_I18N = True -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__)) +STATIC_ROOT = 'staticfiles' +STATIC_URL = '/static/' -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '' +STATICFILES_DIRS = ( + os.path.abspath(os.path.join(BASE_DIR, '..', 'htdocs', 'media')), +) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -135,6 +133,7 @@ INSTALLED_APPS = ( 'django.contrib.contenttypes', # unused, but tests fail otherwise (?) 'django.contrib.messages', 'django.contrib.humanize', + 'django.contrib.staticfiles', 'couchdbkit.ext.django', 'django_couchdb_utils.auth', 'django_couchdb_utils.sessions', diff --git a/mygpo/web/templates/base.html b/mygpo/web/templates/base.html index 8914b8c8..73fabd02 100644 --- a/mygpo/web/templates/base.html +++ b/mygpo/web/templates/base.html @@ -1,5 +1,6 @@ {% load i18n %} {% load menu %} +{% load static %} @@ -11,7 +12,7 @@ - + - - - + + + @@ -47,7 +48,7 @@ @@ -59,7 +60,7 @@ - gpodder.net + gpodder.net
{% if user.is_authenticated %} @@ -223,8 +224,8 @@ - - + + {% block javascript %}{% endblock javascript %} diff --git a/mygpo/web/templates/embed.html b/mygpo/web/templates/embed.html index aa59d488..034852ce 100644 --- a/mygpo/web/templates/embed.html +++ b/mygpo/web/templates/embed.html @@ -1,5 +1,6 @@ {% load i18n %} {% load menu %} +{% load static %} @@ -11,7 +12,7 @@ - + - - - + + + - + {% block javascript %}{% endblock javascript %} diff --git a/mygpo/web/templates/home.html b/mygpo/web/templates/home.html index 3816b0f1..58d574aa 100644 --- a/mygpo/web/templates/home.html +++ b/mygpo/web/templates/home.html @@ -1,5 +1,6 @@ {% load i18n %} {% load menu %} +{% load static %} @@ -11,7 +12,7 @@ - + - - - + + + @@ -53,7 +54,7 @@ - gpodder.net + gpodder.net