Skip to content

Instantly share code, notes, and snippets.

@slinkp
Created November 29, 2010 18:11
Show Gist options
  • Save slinkp/720314 to your computer and use it in GitHub Desktop.
Save slinkp/720314 to your computer and use it in GitHub Desktop.
## SETUP
pw@slinktopp2 ~ $ cd tmp/
pw@slinktopp2 tmp $ virtualenv test_django_static
New python executable in test_django_static/bin/python2.6
Also creating executable in test_django_static/bin/python
Installing distribute......................................................................................................................................................................................done.
pw@slinktopp2 tmp $ cd test_django_static/
pw@slinktopp2 test_django_static $ source bin/activate
(test_django_static)pw@slinktopp2 test_django_static $ pip install django django-static
/home/pw/tmp/test_django_static/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/req.py:641: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)
self.satisfied_by = pkg_resources.get_distribution(self.req)
Downloading/unpacking django-static
Using download cache from /home/pw/tmp/pip-download-cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fd%2Fdjango-static%2Fdjango-static-1.4.0.tar.gz
Running setup.py egg_info for package django-static
Downloading/unpacking django
Downloading Django-1.2.3.tar.gz (6.3Mb): 6.3Mb downloaded
Storing download in cache at /home/pw/tmp/pip-download-cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FD%2FDjango%2FDjango-1.2.3.tar.gz
Running setup.py egg_info for package django
warning: no files found matching 'django/dispatch/LICENSE.txt'
warning: no files found matching '*' under directory 'examples'
Installing collected packages: django, django-static
Running setup.py install for django
changing mode of build/scripts-2.6/django-admin.py from 644 to 755
warning: no files found matching 'django/dispatch/LICENSE.txt'
warning: no files found matching '*' under directory 'examples'
changing mode of /home/pw/tmp/test_django_static/bin/django-admin.py to 755
Running setup.py install for django-static
Successfully installed django django-static
Cleaning up...
(test_django_static)pw@slinktopp2 foo $ pip install slimmer
/home/pw/tmp/test_django_static/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg/pip/req.py:641: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)
self.satisfied_by = pkg_resources.get_distribution(self.req)
Downloading/unpacking slimmer
Using download cache from /home/pw/tmp/pip-download-cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fs%2Fslimmer%2Fslimmer-0.1.30.tar.gz
Running setup.py egg_info for package slimmer
Installing collected packages: slimmer
Running setup.py install for slimmer
Successfully installed slimmer
Cleaning up...
(test_django_static)pw@slinktopp2 test_django_static $
(test_django_static)pw@slinktopp2 test_django_static $ django-admin.py startproject foo
(test_django_static)pw@slinktopp2 test_django_static $ cd foo/
(test_django_static)pw@slinktopp2 foo $ chmod +x manage.py
### TESTS PASS WITH GOOD CONFIG
(test_django_static)pw@slinktopp2 foo $ cp /tmp/settings.py.OK settings.py
(test_django_static)pw@slinktopp2 foo $ ./manage.py test django_static
Creating test database 'default'...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Installing index for auth.Permission model
Installing index for auth.Group_permissions model
Installing index for auth.User_user_permissions model
Installing index for auth.User_groups model
Installing index for auth.Message model
No fixtures found.
...........................................
----------------------------------------------------------------------
Ran 43 tests in 0.081s
OK
Destroying test database 'default'...
### TESTS FAIL WITH BAD CONFIG
(test_django_static)pw@slinktopp2 foo $ cp /tmp/settings.py.BAD settings.py
(test_django_static)pw@slinktopp2 foo $ ./manage.py test django_static
Creating test database 'default'...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Installing index for auth.Permission model
Installing index for auth.Group_permissions model
Installing index for auth.User_user_permissions model
Installing index for auth.User_groups model
Installing index for auth.Message model
No fixtures found.
...F.....E.FFF.FFF.FFFFFFFFFF.FF.FE.F.F.FFF
======================================================================
ERROR: you can use slimfile() and staticfile() without using template tags
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1330, in test_shortcut_functions
content = open(new_filepath).read()
IOError: [Errno 2] No such file or directory: '/tmp/tmpvbzHmE/foo102.1291053667.js'
======================================================================
ERROR: staticfile a css file that contains image urls
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1291, in test_staticfile_css_with_image_urls
content = open(new_filepath).read()
IOError: [Errno 2] No such file or directory: u'/tmp/tmpSqjVQz/medis.1291053667.css'
======================================================================
FAIL: Test that static files in multiple media roots works.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 338, in test_combined_files_in_multiple_media_roots
self._assertProcessedFileExists(dir1, "test_A_test_B.js")
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 259, in _assertProcessedFileExists
self.assertEqual(len(match), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_slimall_basic (django_static.tests.TestDjangoStatic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 952, in test_slimall_basic
self._test_slimall(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1002, in _test_slimall
css_medias=css_medias)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1084, in _test_staticall
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: test_slimall_basic_css (django_static.tests.TestDjangoStatic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 965, in test_slimall_basic_css
self._test_slimall(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1002, in _test_slimall
css_medias=css_medias)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1084, in _test_staticall
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: test_slimall_css_files (django_static.tests.TestDjangoStatic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 980, in test_slimall_css_files
css_medias={'/testxx.css':'screen'})
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1002, in _test_slimall
css_medias=css_medias)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1084, in _test_staticall
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: This is effectively the same as test_slimfile_multiple_debug_on()
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 694, in test_slimfile_multiple_debug_off
self._test_slimfile_multiple(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 780, in _test_slimfile_multiple
self.assertEqual(rendered, name_prefix + expect_filename)
AssertionError: u'/cache-forever/test_A_test_B.1291053667.js' != '/test_A_test_B.1291053667.js'
======================================================================
FAIL: same as test_slimfile_multiple_debug_on() but this time with a
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 724, in test_slimfile_multiple_debug_off_with_name_prefix
self._test_slimfile_multiple(filenames, codes, name_prefix='/infinity')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 791, in _test_slimfile_multiple
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: Where there are multiple files instead if just one:
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 677, in test_slimfile_multiple_debug_on
self._test_slimfile_multiple(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 780, in _test_slimfile_multiple
self.assertEqual(rendered, name_prefix + expect_filename)
AssertionError: u'/cache-forever/test_1_test_2.1291053667.js' != '/test_1_test_2.1291053667.js'
======================================================================
FAIL: same as test_slimfile_multiple_debug_on() but this time with a
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 709, in test_slimfile_multiple_debug_on_with_name_prefix
self._test_slimfile_multiple(filenames, codes, name_prefix='/infinity')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 791, in _test_slimfile_multiple
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: same as test_slimfile_multiple_debug_on() but this time with a
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 738, in test_slimfile_multiple_debug_on_with_save_prefix
self._test_slimfile_multiple(filenames, codes, save_prefix='forever')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 780, in _test_slimfile_multiple
self.assertEqual(rendered, name_prefix + expect_filename)
AssertionError: u'/cache-forever/test_a_test_b.1291053667.js' != '/test_a_test_b.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 519, in test_slimfile_single_debug_off
'var a = function() { return ; }')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 597, in _test_slimfile_single
self.assertEqual(rendered, name_prefix + new_filename)
AssertionError: u'/cache-forever/testing.1291053667.js' != '/testing.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 533, in test_slimfile_single_debug_off_with_name_prefix
name_prefix='/infinity')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 612, in _test_slimfile_single
len(media_root_files_after))
AssertionError: 2 != 1
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 562, in test_slimfile_single_debug_off_with_save_prefix
save_prefix='special')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 597, in _test_slimfile_single
self.assertEqual(rendered, name_prefix + new_filename)
AssertionError: u'/cache-forever/testingXXX.1291053667.js' != '/testingXXX.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 507, in test_slimfile_single_debug_on
'function () { return 1; }')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 597, in _test_slimfile_single
self.assertEqual(rendered, name_prefix + new_filename)
AssertionError: u'/cache-forever/test.1291053667.js' != '/test.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 547, in test_slimfile_single_debug_on_with_name_prefix
name_prefix='/infinity')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 612, in _test_slimfile_single
len(media_root_files_after))
AssertionError: 2 != 1
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 576, in test_slimfile_single_debug_on_with_save_prefix
save_prefix='special')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 597, in _test_slimfile_single
self.assertEqual(rendered, name_prefix + new_filename)
AssertionError: u'/cache-forever/testingAAA.1291053667.js' != '/testingAAA.1291053667.js'
======================================================================
FAIL: Test that static files in multiple media roots works.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 295, in test_static_in_multiple_media_roots
self._assertProcessedFileExists(dir1, "img100.gif")
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 259, in _assertProcessedFileExists
self.assertEqual(len(match), 1)
AssertionError: 0 != 1
======================================================================
FAIL: test_staticall_basic (django_static.tests.TestDjangoStatic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 930, in test_staticall_basic
self._test_staticall(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1084, in _test_staticall
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 3 != 2
======================================================================
FAIL: test_staticall_one_file_only (django_static.tests.TestDjangoStatic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 939, in test_staticall_one_file_only
self._test_staticall(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1084, in _test_staticall
self.assertEqual(len(filenames_set) + 1, len(new_filenames_set))
AssertionError: 2 != 1
======================================================================
FAIL: You put this in the template:
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 222, in test_staticall_with_already_minified_files
os.listdir(settings.MEDIA_ROOT))
AssertionError
======================================================================
FAIL: Use the 'as' operator to define the src name
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1246, in test_staticfile_as_context_variable
re.findall('<script src=\"/foo.\d+\.js\"></script>', rendered)
AssertionError
======================================================================
FAIL: Where there are multiple files instead if just one:
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 841, in test_staticfile_multiple_debug_on
self._test_staticfile_multiple(filenames, codes)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 866, in _test_staticfile_multiple
self.assertEqual(rendered, name_prefix + expect_filename)
AssertionError: u'/cache-forever/test_33_test_44.1291053667.js' != '/test_33_test_44.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 373, in test_staticfile_single_debug_off
'function () { return 1; }')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 427, in _test_staticfile_single
self.assertEqual(rendered, media_url + name_prefix + new_filename)
AssertionError: u'/cache-forever/jquery-2.min.1291053667.js' != '/jquery-2.min.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 409, in test_staticfile_single_debug_off_with_name_and_save_prefix_with_media_url
media_url=media_url)
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 427, in _test_staticfile_single
self.assertEqual(rendered, media_url + name_prefix + new_filename)
AssertionError: u'http://static.example.com/cache-forever/jquery-4.min.1291053667.js' != 'http://static.example.com/jquery-4.min.1291053667.js'
======================================================================
FAIL: Most basic test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 358, in test_staticfile_single_debug_on
'function () { return 1; }')
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 427, in _test_staticfile_single
self.assertEqual(rendered, media_url + name_prefix + new_filename)
AssertionError: u'/cache-forever/jquery.min.1291053667.js' != '/jquery.min.1291053667.js'
======================================================================
FAIL: Reported on
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pw/tmp/test_django_static/lib/python2.6/site-packages/django_static/tests.py", line 1136, in test_stupidity_bug_report_2
self.assertTrue(result.startswith('css/base.'))
AssertionError
----------------------------------------------------------------------
Ran 43 tests in 0.076s
FAILED (failures=25, errors=2)
Destroying test database 'default'...
# Django settings for foo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/tmp/foo.sqlite', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
# 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 = ''
# 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/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'szh7bha$0hh1^0u!v^5(^!d%5--v&b%d%$*@kd$4wnepte$8ie'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'foo.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'django_static',
)
DJANGO_STATIC = True
DJANGO_STATIC_NAME_PREFIX = '/cache-forever'
DJANGO_STATIC_SAVE_PREFIX = '/tmp/static%s' % DJANGO_STATIC_NAME_PREFIX
# Django settings for foo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/tmp/foo.sqlite', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
# 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 = ''
# 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/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'szh7bha$0hh1^0u!v^5(^!d%5--v&b%d%$*@kd$4wnepte$8ie'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'foo.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'django_static',
)
DJANGO_STATIC = True
@slinkp
Copy link
Author

slinkp commented Nov 29, 2010

here's the shell session with just the commands; copy/paste this into a terminal, it should give the expected failures on the first run and succeed on the second run, as long as you save the two attached settings files into /tmp

cd tmp/
virtualenv test_django_static
cd test_django_static/
source bin/activate
pip install django django-static slimmer
django-admin.py startproject foo
cd foo/
chmod +x manage.py

rm -f settings.py && cp -f /tmp/settings.py.BAD settings.py
./manage.py test django_static

rm -f settings.py && cp /tmp/settings.py.OK settings.py
./manage.py test django_static

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment