Browse Source

Now using compressor and trying to fix test CSRF issue.

tags/v0.4.1
Isaac Bythewood 12 years ago
parent
commit
643224d575
6 changed files with 18 additions and 24 deletions
  1. +10
    -17
      pinry/core/templates/core/base.html
  2. +0
    -3
      pinry/core/tests.py
  3. +0
    -4
      pinry/pins/tests.py
  4. +2
    -0
      pinry/pins/views.py
  5. +3
    -0
      pinry/settings/__init__.py
  6. +3
    -0
      requirements.txt

+ 10
- 17
pinry/core/templates/core/base.html View File

@@ -1,21 +1,19 @@
{% load new_pin %} {% load new_pin %}
{% load compress %}


<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>{{ site_name }} - {% block title %}{% endblock %}</title> <title>{{ site_name }} - {% block title %}{% endblock %}</title>


{% if debug %}
{% compress css %}
<link rel="stylesheet" href="/static/vendor/bootstrap/2.0.3/css/bootstrap.css"> <link rel="stylesheet" href="/static/vendor/bootstrap/2.0.3/css/bootstrap.css">
<link rel="stylesheet" href="/static/vendor/fancybox/2.0.6/jquery.fancybox.css"> <link rel="stylesheet" href="/static/vendor/fancybox/2.0.6/jquery.fancybox.css">
{% else %}
<link rel="stylesheet" href="/static/vendor/bootstrap/2.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/vendor/fancybox/2.0.6/jquery.fancybox.css">
{% endif %}


<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Monoton">
<link rel="stylesheet" href="/static/core/css/pinry.css">
{% endcompress %}


<link rel="stylesheet" href="/static/core/css/pinry.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Monoton">
</head> </head>
<body> <body>
<div class="navbar navbar-fixed-top"> <div class="navbar navbar-fixed-top">
@@ -46,21 +44,16 @@


{% new_pin request %} {% new_pin request %}


{% if debug %}
{% compress js %}
<script src="/static/vendor/jquery/1.7.2/jquery.js"></script> <script src="/static/vendor/jquery/1.7.2/jquery.js"></script>
<script src="/static/vendor/bootstrap/2.0.3/js/bootstrap.js"></script> <script src="/static/vendor/bootstrap/2.0.3/js/bootstrap.js"></script>
<script src="/static/vendor/wookmark/0.5/jquery.wookmark.js"></script> <script src="/static/vendor/wookmark/0.5/jquery.wookmark.js"></script>
<script src="/static/vendor/fancybox/2.0.6/jquery.fancybox.js"></script> <script src="/static/vendor/fancybox/2.0.6/jquery.fancybox.js"></script>
<script src="/static/vendor/imagesloaded/2.0.1/jquery.imagesloaded.js"></script> <script src="/static/vendor/imagesloaded/2.0.1/jquery.imagesloaded.js"></script>
{% else %}
<script src="/static/vendor/jquery/1.7.2/jquery.min.js"></script>
<script src="/static/vendor/bootstrap/2.0.3/js/bootstrap.min.js"></script>
<script src="/static/vendor/wookmark/0.5/jquery.wookmark.min.js"></script>
<script src="/static/vendor/fancybox/2.0.6/jquery.fancybox.pack.js"></script>
<script src="/static/vendor/imagesloaded/2.0.1/jquery.imagesloaded.min.js"></script>
{% endif %}


<script src="/static/core/js/pinry.js"></script>
<script src="/static/core/js/messages.js"></script>
<script src="/static/core/js/pinry.js"></script>
<script src="/static/core/js/messages.js"></script>
{% endcompress %}

</body> </body>
</html> </html>

+ 0
- 3
pinry/core/tests.py View File

@@ -3,9 +3,6 @@ from django.test.client import Client
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse




# pylint: disable-msg=E1103


class HomeTest(unittest.TestCase): class HomeTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.client = Client() self.client = Client()


+ 0
- 4
pinry/pins/tests.py View File

@@ -3,10 +3,6 @@ from django.test.client import Client
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse




# pylint: disable-msg=E1103
# pylint: disable-msg=R0904


class RecentPinsTest(TestCase): class RecentPinsTest(TestCase):
def setUp(self): def setUp(self):
self.client = Client() self.client = Client()


+ 2
- 0
pinry/pins/views.py View File

@@ -7,6 +7,8 @@ from .forms import PinForm
from .models import Pin from .models import Pin






def recent_pins(request): def recent_pins(request):
return TemplateResponse(request, 'pins/recent_pins.html', None) return TemplateResponse(request, 'pins/recent_pins.html', None)




+ 3
- 0
pinry/settings/__init__.py View File

@@ -29,6 +29,7 @@ STATIC_URL = '/static/'
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
) )
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader', 'django.template.loaders.filesystem.Loader',
@@ -53,6 +54,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
"pinry.core.context_processors.template_settings", "pinry.core.context_processors.template_settings",
) )


COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
ROOT_URLCONF = 'pinry.urls' ROOT_URLCONF = 'pinry.urls'
LOGIN_REDIRECT_URL = '/' LOGIN_REDIRECT_URL = '/'
INTERNAL_IPS = ['127.0.0.1'] INTERNAL_IPS = ['127.0.0.1']
@@ -71,6 +73,7 @@ INSTALLED_APPS = (
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'south', 'south',
'compressor',
'pinry.vendor', 'pinry.vendor',
'pinry.core', 'pinry.core',
'pinry.pins', 'pinry.pins',


+ 3
- 0
requirements.txt View File

@@ -2,4 +2,7 @@ Django==1.4
South==0.7.4 South==0.7.4
Pillow==1.7.7 Pillow==1.7.7
django-tastypie==0.9.11 django-tastypie==0.9.11
django_compressor==1.1.2
cssmin==0.1.4
jsmin==2.0.2



Loading…
Cancel
Save