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
|
||||
when: "'app' in group_names"
|
||||
when: "'app' in group_names or 'staging' in group_names"
|
||||
- import_playbook: playbooks/deploy_www.yml
|
||||
when: "'haproxy' in group_names"
|
||||
- import_playbook: playbooks/deploy_node.yml
|
||||
|
|
|
@ -27,6 +27,7 @@ django-nose==1.4.7
|
|||
django-oauth-toolkit==1.3.3
|
||||
django-paypal==1.0.0
|
||||
django-qurl==0.1.1
|
||||
django-pipeline>=2,<3
|
||||
django-redis-cache==3.0.0
|
||||
django-redis-sessions==0.6.1
|
||||
django-ses==1.0.3
|
||||
|
|
|
@ -10,7 +10,6 @@ RUN set -ex \
|
|||
&& buildDeps=' \
|
||||
patch \
|
||||
gfortran \
|
||||
lib32ncurses5-dev \
|
||||
libblas-dev \
|
||||
libffi-dev \
|
||||
libjpeg-dev \
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import sys
|
||||
import os
|
||||
import yaml
|
||||
|
||||
# ===========================
|
||||
# = Directory Declaractions =
|
||||
|
@ -35,7 +36,6 @@ import django.http
|
|||
import re
|
||||
from mongoengine import connect
|
||||
import boto3
|
||||
from utils import jammit
|
||||
|
||||
# ===================
|
||||
# = Server Settings =
|
||||
|
@ -80,10 +80,8 @@ MEDIA_URL = '/media/'
|
|||
|
||||
if DEBUG:
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = '/static/static_root/'
|
||||
else:
|
||||
STATIC_URL = '/media/'
|
||||
STATIC_ROOT = '/media/'
|
||||
|
||||
|
||||
# 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.admin',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django_extensions',
|
||||
'paypal.standard.ipn',
|
||||
'apps.rss_feeds',
|
||||
|
@ -335,6 +334,7 @@ INSTALLED_APPS = (
|
|||
'anymail',
|
||||
'oauth2_provider',
|
||||
'corsheaders',
|
||||
'pipeline',
|
||||
)
|
||||
|
||||
# ==========
|
||||
|
@ -777,7 +777,63 @@ accept_content = ['pickle', 'json', 'msgpack', 'yaml']
|
|||
# = 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 =
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.5.1
|
||||
// Generated by CoffeeScript 2.6.1
|
||||
(function() {
|
||||
var favicons, log, mongo;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.5.1
|
||||
// Generated by CoffeeScript 2.6.1
|
||||
(function() {
|
||||
var debug, info;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.5.1
|
||||
// Generated by CoffeeScript 2.6.1
|
||||
(function() {
|
||||
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() {
|
||||
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() {
|
||||
var Mercury, log, original_text;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.5.1
|
||||
// Generated by CoffeeScript 2.6.1
|
||||
(function() {
|
||||
var fs, log, redis, unread_counts;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% load utils_tags %}
|
||||
{% load static%}
|
||||
{% load static %}
|
||||
{% load pipeline %}
|
||||
{% autoescape off %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -118,7 +119,7 @@
|
|||
NEWSBLUR.app = {};
|
||||
</script>
|
||||
|
||||
{% include_stylesheets "common" %}
|
||||
{% stylesheet "common" %}
|
||||
|
||||
{% if debug %}
|
||||
<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 utils.user_functions import get_user
|
||||
from django.utils.safestring import mark_safe
|
||||
from pipeline.templatetags.pipeline import stylesheet, javascript
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
@ -212,15 +213,17 @@ def commify(n):
|
|||
return out
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def include_javascripts(asset_package):
|
||||
@register.tag
|
||||
def include_javascripts(parser, token):
|
||||
"""Prints out a template of <script> tags based on an asset package name."""
|
||||
asset_type = 'javascripts'
|
||||
return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||
return javascript(parser, token)
|
||||
# asset_type = 'javascripts'
|
||||
# return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def include_stylesheets(asset_package):
|
||||
@register.tag
|
||||
def include_stylesheets(parser, token):
|
||||
"""Prints out a template of <link> tags based on an asset package name."""
|
||||
asset_type = 'stylesheets'
|
||||
return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||
return stylesheet(parser, token)
|
||||
# asset_type = 'stylesheets'
|
||||
# return mark_safe(settings.JAMMIT.render_tags(asset_type, asset_package))
|
||||
|
|
Loading…
Add table
Reference in a new issue