From 0e3f1dd1f27d4dcfc73f585be46a16f0a4048c7b Mon Sep 17 00:00:00 2001 From: pendletongp Date: Thu, 2 Feb 2012 22:19:11 -0500 Subject: [PATCH 1/2] support new admin static files layout introduced in django 1.4 --- djangorestframework/utils/staticviews.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/djangorestframework/utils/staticviews.py b/djangorestframework/utils/staticviews.py index 12a36f6c2..a13160a2e 100644 --- a/djangorestframework/utils/staticviews.py +++ b/djangorestframework/utils/staticviews.py @@ -62,7 +62,8 @@ def api_login(request, template_name='api_login.html', redirect_field_name: redirect_to, #'site': current_site, #'site_name': current_site.name, - 'ADMIN_MEDIA_PREFIX': settings.ADMIN_MEDIA_PREFIX, + 'ADMIN_MEDIA_PREFIX': "%sadmin/" % settings.STATIC_URL if hasattr(settings,"STATIC_URL") + else settings.ADMIN_MEDIA_PREFIX, }, context_instance=RequestContext(request)) From 687e56b5c9f2ad56a62c3509f153b4254f7423f2 Mon Sep 17 00:00:00 2001 From: pendletongp Date: Thu, 2 Feb 2012 22:24:17 -0500 Subject: [PATCH 2/2] Explicitly copy the css folder contents to avoid the following setup.py install error: "can't copy 'djangorestframework\static\css': doesn't exist or not a regular file" --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 690a7e0fd..e04215948 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( 'djangorestframework.runtests', 'djangorestframework.utils'], package_dir={'djangorestframework': 'djangorestframework'}, - package_data = {'djangorestframework': ['templates/*', 'static/*']}, + package_data = {'djangorestframework': ['templates/*', 'static/*.*', 'static/css/*']}, test_suite = 'djangorestframework.runtests.runcoverage.main', install_requires=['URLObject>=0.6.0'], classifiers = [