mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Switching from Jammit to django-pipeline. Doesn't work yet, needs compressor hooked up and assets checked.
This commit is contained in:
parent
b2a325f7e5
commit
b6db14dacd
12 changed files with 82 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- import_playbook: playbooks/deploy_app.yml
|
- import_playbook: playbooks/deploy_app.yml
|
||||||
when: "'app' in group_names"
|
when: "'app' in group_names or 'staging' in group_names"
|
||||||
- import_playbook: playbooks/deploy_www.yml
|
- import_playbook: playbooks/deploy_www.yml
|
||||||
when: "'haproxy' in group_names"
|
when: "'haproxy' in group_names"
|
||||||
- import_playbook: playbooks/deploy_node.yml
|
- import_playbook: playbooks/deploy_node.yml
|
||||||
|
|
|
@ -27,6 +27,7 @@ django-nose==1.4.7
|
||||||
django-oauth-toolkit==1.3.3
|
django-oauth-toolkit==1.3.3
|
||||||
django-paypal==1.0.0
|
django-paypal==1.0.0
|
||||||
django-qurl==0.1.1
|
django-qurl==0.1.1
|
||||||
|
django-pipeline>=2,<3
|
||||||
django-redis-cache==3.0.0
|
django-redis-cache==3.0.0
|
||||||
django-redis-sessions==0.6.1
|
django-redis-sessions==0.6.1
|
||||||
django-ses==1.0.3
|
django-ses==1.0.3
|
||||||
|
|
|
@ -10,7 +10,6 @@ RUN set -ex \
|
||||||
&& buildDeps=' \
|
&& buildDeps=' \
|
||||||
patch \
|
patch \
|
||||||
gfortran \
|
gfortran \
|
||||||
lib32ncurses5-dev \
|
|
||||||
libblas-dev \
|
libblas-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
libjpeg-dev \
|
libjpeg-dev \
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import yaml
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# = Directory Declaractions =
|
# = Directory Declaractions =
|
||||||
|
@ -35,7 +36,6 @@ import django.http
|
||||||
import re
|
import re
|
||||||
from mongoengine import connect
|
from mongoengine import connect
|
||||||
import boto3
|
import boto3
|
||||||
from utils import jammit
|
|
||||||
|
|
||||||
# ===================
|
# ===================
|
||||||
# = Server Settings =
|
# = Server Settings =
|
||||||
|
@ -80,10 +80,8 @@ MEDIA_URL = '/media/'
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = '/static/static_root/'
|
|
||||||
else:
|
else:
|
||||||
STATIC_URL = '/media/'
|
STATIC_URL = '/media/'
|
||||||
STATIC_ROOT = '/media/'
|
|
||||||
|
|
||||||
|
|
||||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
||||||
|
@ -311,6 +309,7 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
|
'django.contrib.staticfiles',
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
'paypal.standard.ipn',
|
'paypal.standard.ipn',
|
||||||
'apps.rss_feeds',
|
'apps.rss_feeds',
|
||||||
|
@ -335,6 +334,7 @@ INSTALLED_APPS = (
|
||||||
'anymail',
|
'anymail',
|
||||||
'oauth2_provider',
|
'oauth2_provider',
|
||||||
'corsheaders',
|
'corsheaders',
|
||||||
|
'pipeline',
|
||||||
)
|
)
|
||||||
|
|
||||||
# ==========
|
# ==========
|
||||||
|
@ -777,7 +777,63 @@ accept_content = ['pickle', 'json', 'msgpack', 'yaml']
|
||||||
# = Assets =
|
# = Assets =
|
||||||
# ==========
|
# ==========
|
||||||
|
|
||||||
JAMMIT = jammit.JammitAssets(ROOT_DIR)
|
STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
|
||||||
|
STATICFILES_FINDERS = (
|
||||||
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||||
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
|
'pipeline.finders.PipelineFinder',
|
||||||
|
)
|
||||||
|
STATICFILES_DIRS = (
|
||||||
|
MEDIA_ROOT,
|
||||||
|
)
|
||||||
|
with open(os.path.join(ROOT_DIR, 'assets.yml')) as stream:
|
||||||
|
assets = yaml.safe_load(stream)
|
||||||
|
|
||||||
|
PIPELINE = {
|
||||||
|
'PIPELINE_ENABLED': not DEBUG_ASSETS,
|
||||||
|
'CSS_COMPRESSOR': 'pipeline.compressors.NoopCompressor',
|
||||||
|
'JS_COMPRESSOR': 'pipeline.compressors.NoopCompressor',
|
||||||
|
'JAVASCRIPT': {
|
||||||
|
'common': {
|
||||||
|
'source_filenames': assets['javascripts']['common'],
|
||||||
|
'output_filename': 'static/js/common.js',
|
||||||
|
},
|
||||||
|
'statistics': {
|
||||||
|
'source_filenames': assets['javascripts']['statistics'],
|
||||||
|
'output_filename': 'static/js/statistics.js',
|
||||||
|
},
|
||||||
|
'payments': {
|
||||||
|
'source_filenames': assets['javascripts']['payments'],
|
||||||
|
'output_filename': 'static/js/payments.js',
|
||||||
|
},
|
||||||
|
'bookmarklet': {
|
||||||
|
'source_filenames': assets['javascripts']['bookmarklet'],
|
||||||
|
'output_filename': 'static/js/bookmarklet.js',
|
||||||
|
},
|
||||||
|
'blurblog': {
|
||||||
|
'source_filenames': assets['javascripts']['blurblog'],
|
||||||
|
'output_filename': 'static/js/blurblog.js',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'STYLESHEETS': {
|
||||||
|
'common': {
|
||||||
|
'source_filenames': assets['stylesheets']['common'],
|
||||||
|
'output_filename': 'static/css/common.css',
|
||||||
|
},
|
||||||
|
'mobile': {
|
||||||
|
'source_filenames': assets['stylesheets']['mobile'],
|
||||||
|
'output_filename': 'static/css/mobile.css',
|
||||||
|
},
|
||||||
|
'bookmarklet': {
|
||||||
|
'source_filenames': assets['stylesheets']['bookmarklet'],
|
||||||
|
'output_filename': 'static/css/bookmarklet.css',
|
||||||
|
},
|
||||||
|
'blurblog': {
|
||||||
|
'source_filenames': assets['stylesheets']['blurblog'],
|
||||||
|
'output_filename': 'static/css/blurblog.css',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# =======
|
# =======
|
||||||
# = AWS =
|
# = AWS =
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var favicons, log, mongo;
|
var favicons, log, mongo;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var debug, info;
|
var debug, info;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var ENV_DEV, ENV_DOCKER, ENV_PROD, Sentry, Tracing, app, envresult, favicons, log, original_page, original_text, server, unread_counts;
|
var ENV_DEV, ENV_DOCKER, ENV_PROD, Sentry, Tracing, app, envresult, favicons, log, original_page, original_text, server, unread_counts;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var busboy, fs, log, mkdirp, original_page, path;
|
var busboy, fs, log, mkdirp, original_page, path;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var Mercury, log, original_text;
|
var Mercury, log, original_text;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 2.5.1
|
// Generated by CoffeeScript 2.6.1
|
||||||
(function() {
|
(function() {
|
||||||
var fs, log, redis, unread_counts;
|
var fs, log, redis, unread_counts;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{% load utils_tags %}
|
{% load utils_tags %}
|
||||||
{% load static%}
|
{% load static %}
|
||||||
|
{% load pipeline %}
|
||||||
{% autoescape off %}
|
{% autoescape off %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -118,7 +119,7 @@
|
||||||
NEWSBLUR.app = {};
|
NEWSBLUR.app = {};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include_stylesheets "common" %}
|
{% stylesheet "common" %}
|
||||||
|
|
||||||
{% if debug %}
|
{% if debug %}
|
||||||
<link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6565292/731824/css/fonts.css" />
|
<link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6565292/731824/css/fonts.css" />
|
||||||
|
|
|
@ -8,6 +8,7 @@ from apps.social.models import MSocialProfile
|
||||||
from vendor.timezones.utilities import localtime_for_timezone
|
from vendor.timezones.utilities import localtime_for_timezone
|
||||||
from utils.user_functions import get_user
|
from utils.user_functions import get_user
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
from pipeline.templatetags.pipeline import stylesheet, javascript
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
@ -212,15 +213,17 @@ def commify(n):
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.tag
|
||||||
def include_javascripts(asset_package):
|
def include_javascripts(parser, token):
|
||||||
"""Prints out a template of <script> tags based on an asset package name."""
|
"""Prints out a template of <script> tags based on an asset package name."""
|
||||||
asset_type = 'javascripts'
|
return javascript(parser, token)
|
||||||
return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
# asset_type = 'javascripts'
|
||||||
|
# return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.tag
|
||||||
def include_stylesheets(asset_package):
|
def include_stylesheets(parser, token):
|
||||||
"""Prints out a template of <link> tags based on an asset package name."""
|
"""Prints out a template of <link> tags based on an asset package name."""
|
||||||
asset_type = 'stylesheets'
|
return stylesheet(parser, token)
|
||||||
return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
# asset_type = 'stylesheets'
|
||||||
|
# return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||||
|
|
Loading…
Add table
Reference in a new issue