From patchwork Wed Nov 6 04:52:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 289071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 683392C0389 for ; Thu, 7 Nov 2013 11:27:28 +1100 (EST) Received: from mail-pb0-x233.google.com (mail-pb0-x233.google.com [IPv6:2607:f8b0:400e:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 553CE2C00BA for ; Wed, 6 Nov 2013 15:55:20 +1100 (EST) Received: by mail-pb0-f51.google.com with SMTP id xa7so2587595pbc.38 for ; Tue, 05 Nov 2013 20:55:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9bCvtzr6xIwXOCBWiyZUTIop332WIZd3luG9a/gKrZw=; b=SuW6l+fPiVvMhO6Dp0/jw8j0ffuVammjVpKU80teADmzQ6CW2Gbb78+YCOlNW7W/Pl 2sajV7gq2KPRqrmqMphrec3gLqwx1W89qANJw57kWADROl370OnT7jsCzZvrroBAMU7O THrCeXPgtPQO3tgLHoa9KpunrKUh7S1BdSgM6FLz8tQMTNrezc6dGc9QuCijnBbanp/H HCewUhy6NdjoET22bgg6M4eTaERQuYlEsos/Ac6/kWTiv0vO6rrQfBqAileRMtqIHGIq wdA0asZWGSpFSZBCS1xPwAFjSY+94S99M2LZRqX0VAI/W12plmMXoRTaJsS7ygyf0xS9 bsRw== X-Received: by 10.68.218.165 with SMTP id ph5mr1256206pbc.11.1383713716968; Tue, 05 Nov 2013 20:55:16 -0800 (PST) Received: from isis.gateway.2wire.net (99-57-140-209.lightspeed.sntcca.sbcglobal.net. [99.57.140.209]) by mx.google.com with ESMTPSA id ef10sm44771129pac.1.2013.11.05.20.55.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2013 20:55:16 -0800 (PST) From: Khem Raj To: jk@ozlabs.org, patchwork@lists.ozlabs.org Subject: [PATCH] Define and use STATIC_URL and STATIC_ROOT on Django 1.4+ Date: Tue, 5 Nov 2013 20:52:00 -0800 Message-Id: <1383713520-8293-1-git-send-email-raj.khem@gmail.com> X-Mailer: git-send-email 1.8.4.2 X-Mailman-Approved-At: Thu, 07 Nov 2013 11:27:22 +1100 Cc: Khem Raj X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" ADMIN_MEDIA_PREFIX is deprecated Signed-off-by: Khem Raj --- apps/settings.py | 11 ++++++----- lib/apache2/patchwork.fastcgi.conf | 2 +- lib/apache2/patchwork.mod_python.conf | 2 +- lib/apache2/patchwork.wsgi.conf | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/settings.py b/apps/settings.py index 43a37d8..8d996c9 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -41,8 +41,9 @@ MEDIA_URL = '' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/' +# Corresponds to alias name in webserver (e.g. apache) config file. +# Examples: "http://foo.com/static/", "/static/". +STATIC_URL = '/static/' # Make this unique, and don't share it with anybody. SECRET_KEY = '00000000000000000000000000000000000000000000000000' @@ -77,10 +78,10 @@ TEMPLATE_DIRS = ( # Don't forget to use absolute paths, not relative paths. os.path.join(ROOT_DIR, 'templates') ) -# Absolute path to the directory that holds media. +# Absolute path to the directory that holds admin static media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join( - ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'media') +STATIC_ROOT = os.path.join( + ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'static') TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", diff --git a/lib/apache2/patchwork.fastcgi.conf b/lib/apache2/patchwork.fastcgi.conf index a739164..5547927 100644 --- a/lib/apache2/patchwork.fastcgi.conf +++ b/lib/apache2/patchwork.fastcgi.conf @@ -2,7 +2,7 @@ NameVirtualHost patchwork.example.com:80 DocumentRoot /srv/patchwork/htdocs/ - Alias /media/ /srv/patchwork/lib/python/django/contrib/admin/media/ + Alias /static/ /srv/patchwork/lib/python/django/contrib/admin/static/ FastCGIExternalServer /srv/patchwork/htdocs/patchwork.fcgi -socket /srv/patchwork/var/fcgi.sock -pass-header Authorization diff --git a/lib/apache2/patchwork.mod_python.conf b/lib/apache2/patchwork.mod_python.conf index 6dbb09b..f6d1ef0 100644 --- a/lib/apache2/patchwork.mod_python.conf +++ b/lib/apache2/patchwork.mod_python.conf @@ -2,7 +2,7 @@ NameVirtualHost patchwork.example.com:80 DocumentRoot /srv/patchwork/htdocs/ - Alias /media/ /srv/patchwork/lib/python/django/contrib/admin/media/ + Alias /static/ /srv/patchwork/lib/python/django/contrib/admin/static/ SetHandler python-program diff --git a/lib/apache2/patchwork.wsgi.conf b/lib/apache2/patchwork.wsgi.conf index 3756e5a..e682d74 100644 --- a/lib/apache2/patchwork.wsgi.conf +++ b/lib/apache2/patchwork.wsgi.conf @@ -8,9 +8,9 @@ Allow from all - Alias /media/ "/usr/share/python-support/python-django/django/contrib/admin/media/" + Alias /static/ "/usr/share/python-support/python-django/django/contrib/admin/static/" - + Order allow,deny Allow from all