[BUGFIX] Staticfiles + Pipeline work now.

This commit is contained in:
Jan Philipp Timme 2014-07-27 10:26:36 +02:00
parent 06fd6da45f
commit f274ec4bb3
7 changed files with 76 additions and 31 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
.pydevproject
*.pyc
citavi_mapper/private_settings.py
static

7
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "public/static/contrib/bootstrap"]
path = public/static/contrib/bootstrap
[submodule "static/contrib/bootstrap"]
path = static/contrib/bootstrap
url = https://github.com/twbs/bootstrap.git
[submodule "contrib/bootstrap"]
path = contrib/bootstrap
url = https://github.com/twbs/bootstrap.git

View File

@ -20,14 +20,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
#PIPELINE_ENABLED = False
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
@ -37,6 +36,8 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
'pipeline',
'crispy_forms',
'bootstrap3_datetime',
'django_bootstrap_breadcrumbs',
'frontend',
)
@ -53,16 +54,24 @@ ROOT_URLCONF = 'citavi_mapper.urls'
WSGI_APPLICATION = 'citavi_mapper.wsgi.application'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'contrib'),)
PIPELINE_COMPILERS = (
'pipeline.compilers.less.LessCompiler',
)
PIPELINE_CSS = {
'colors': {
'bootstrap': {
'source_filenames': (
'css/core.css',
'css/colors/*.css',
'css/layers.css'
'bootstrap/less/bootstrap.less',
),
'output_filename': 'css/colors.css',
'output_filename': 'css/b.css',
'extra_context': {
'media': 'screen,projection',
},
@ -70,17 +79,25 @@ PIPELINE_CSS = {
}
PIPELINE_JS = {
'stats': {
'bootstrap': {
'source_filenames': (
'js/jquery.js',
'js/d3.js',
'js/collections/*.js',
'js/application.js',
'bootstrap/js/transition.js',
'bootstrap/js/modal.js',
'bootstrap/js/dropdown.js',
'bootstrap/js/scrollspy.js',
'bootstrap/js/tab.js',
'bootstrap/js/tooltip.js',
'bootstrap/js/popover.js',
'bootstrap/js/alert.js',
'bootstrap/js/button.js',
'bootstrap/js/collapse.js',
'bootstrap/js/carousel.js',
'bootstrap/js/affix.js',
'js/language_picker.js'
),
'output_filename': 'js/stats.js',
}
'output_filename': 'js/b.js',
},
}
CRISPY_TEMPLATE_PACK = 'bootstrap3'
# Internationalization
@ -96,13 +113,5 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
# import the private settings last to allow override
from private_settings import *

View File

@ -1,3 +1,4 @@
{% load staticfiles compressed %}
<!DOCTYPE html>
<html>
<head>
@ -5,12 +6,40 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Merging Citavi projects and mapping existing datasets.">
<title>{% block title %}Citavi Mapper :: {{ title }}{% endblock %}</title>
<title>{% block title %}Citavi Mapper :: {{title}}{% endblock %}</title>
<!-- Bootstrap core CSS with overrides. -->
{% compressed_css 'bootstrap' %}
{% compressed_js 'bootstrap' %}
</head>
<body>
<h1>{{ headline }}</h1>
<div id="content">
{% block content %}{{ content }}{% endblock %}t
<div>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span> <span
class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">sasas</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
navabfbisaofboisa
</div>
</div>
</nav>
<div class="hsh-page-header">
<div id="header" class="container">
<img src="{% static 'images/logo.png' %}" class="hidden-sm hidden-xs">
<h1>{{page.title}}</h1>
<p>{{page.lead}}</p>
</div>
</div>
<div id="content" class="container">
{% block content %}{% endblock %}
</div>
<div id="footer">
afsfooooter
</div>
</body>
</html>

View File

@ -2,3 +2,6 @@ psycopg2
django
django-crispy-forms
django-pipeline
django-bootstrap-breadcrumbs
django-bootstrap3-datetimepicker