This document assumes you already have an up and running instance of django_compressor, and that you understand how to use it in your templates. The goal is to explain what the main template tag, {% compress %}, does behind the scenes, to help you debug performance problems for instance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cms/models/pluginmodel.py b/cms/models/pluginmodel.py | |
index fc318a9..108a165 100644 | |
--- a/cms/models/pluginmodel.py | |
+++ b/cms/models/pluginmodel.py | |
@@ -5,7 +5,8 @@ from cms.plugin_rendering import PluginContext, PluginRenderer | |
from cms.exceptions import DontUsePageAttributeWarning | |
from publisher import MpttPublisher | |
from django.db import models | |
-from django.db.models.base import ModelBase | |
+from django.db.models.base import ModelBase, model_unpickle, simple_class_factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cms/models/pluginmodel.py b/cms/models/pluginmodel.py | |
index fc318a9..108a165 100644 | |
--- a/cms/models/pluginmodel.py | |
+++ b/cms/models/pluginmodel.py | |
@@ -5,7 +5,8 @@ from cms.plugin_rendering import PluginContext, PluginRenderer | |
from cms.exceptions import DontUsePageAttributeWarning | |
from publisher import MpttPublisher | |
from django.db import models | |
-from django.db.models.base import ModelBase | |
+from django.db.models.base import ModelBase, model_unpickle, simple_class_factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py | |
index 2dabf3b..e9ab5c7 100644 | |
--- a/django/conf/global_settings.py | |
+++ b/django/conf/global_settings.py | |
@@ -194,7 +194,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( | |
'django.contrib.auth.context_processors.auth', | |
'django.core.context_processors.debug', | |
'django.core.context_processors.i18n', | |
- 'django.core.context_processors.media', | |
+ 'django.contrib.staticfiles.context_processors.staticfiles', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(django-dev)~/Code/git/django [git:master] $ time python tests/runtests.py --settings=django_testing.sqlite -v1 staticfiles_tests | |
Creating test database 'default'... | |
Creating test database 'other'... | |
Destroying old test database 'other'... | |
.................................... | |
---------------------------------------------------------------------- | |
Ran 36 tests in 1.198s | |
OK | |
Destroying test database 'default'... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/contrib/staticfiles/management/commands/runserver.py b/django/contrib/staticfiles/management/commands/runserver.py | |
new file mode 100644 | |
index 0000000..e138759 | |
--- /dev/null | |
+++ b/django/contrib/staticfiles/management/commands/runserver.py | |
@@ -0,0 +1,27 @@ | |
+from optparse import make_option | |
+ | |
+from django.conf import settings | |
+from django.core.management.commands.runserver import BaseRunserverCommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your settings.py | |
STATICFILES_FINDERS += ( | |
'mysite.finders.AppMediaFinder' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ar: translated: 65%, fuzzy: 0%, untranslated: 34% | |
bg: translated: 43%, fuzzy: 15%, untranslated: 40% | |
bn: translated: 38%, fuzzy: 8%, untranslated: 52% | |
bs: translated: 54%, fuzzy: 0%, untranslated: 44% | |
ca: translated: 84%, fuzzy: 7%, untranslated: 8% | |
cs: translated: 100%, fuzzy: 0%, untranslated: 0% | |
cy: translated: 18%, fuzzy: 22%, untranslated: 58% | |
da: translated: 98%, fuzzy: 0%, untranslated: 0% | |
de: translated: 100%, fuzzy: 0%, untranslated: 0% | |
el: translated: 27%, fuzzy: 26%, untranslated: 46% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.staticfiles.storage import AppStaticStorage | |
from django.contrib.staticfiles.finders import AppDirectoriesFinder | |
class LegacyAppMediaStorage(AppStaticStorage): | |
source_dir = 'media' | |
class LegacyAppDirectoriesFinder(AppDirectoriesFinder): | |
storage_class = LegacyAppMediaStorage | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### PS1 customization #### | |
NONE="\[\033[0m\]" # unsets color to term fg color | |
# regular colors | |
K="\[\033[0;30m\]" # black | |
R="\[\033[0;31m\]" # red | |
G="\[\033[0;32m\]" # green | |
Y="\[\033[0;33m\]" # yellow | |
B="\[\033[0;34m\]" # blue | |
M="\[\033[0;35m\]" # magenta |