[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 .pydevproject
*.pyc *.pyc
citavi_mapper/private_settings.py citavi_mapper/private_settings.py
static

7
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "public/static/contrib/bootstrap"] [submodule "static/contrib/bootstrap"]
path = public/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 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! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
#PIPELINE_ENABLED = False
TEMPLATE_DEBUG = True TEMPLATE_DEBUG = True
ALLOWED_HOSTS = [] ALLOWED_HOSTS = []
# Application definition # Application definition
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
@ -37,6 +36,8 @@ INSTALLED_APPS = (
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'pipeline', 'pipeline',
'crispy_forms', 'crispy_forms',
'bootstrap3_datetime',
'django_bootstrap_breadcrumbs',
'frontend', 'frontend',
) )
@ -53,16 +54,24 @@ ROOT_URLCONF = 'citavi_mapper.urls'
WSGI_APPLICATION = 'citavi_mapper.wsgi.application' 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_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'contrib'),)
PIPELINE_COMPILERS = (
'pipeline.compilers.less.LessCompiler',
)
PIPELINE_CSS = { PIPELINE_CSS = {
'colors': { 'bootstrap': {
'source_filenames': ( 'source_filenames': (
'css/core.css', 'bootstrap/less/bootstrap.less',
'css/colors/*.css',
'css/layers.css'
), ),
'output_filename': 'css/colors.css', 'output_filename': 'css/b.css',
'extra_context': { 'extra_context': {
'media': 'screen,projection', 'media': 'screen,projection',
}, },
@ -70,17 +79,25 @@ PIPELINE_CSS = {
} }
PIPELINE_JS = { PIPELINE_JS = {
'stats': { 'bootstrap': {
'source_filenames': ( 'source_filenames': (
'js/jquery.js', 'bootstrap/js/transition.js',
'js/d3.js', 'bootstrap/js/modal.js',
'js/collections/*.js', 'bootstrap/js/dropdown.js',
'js/application.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' CRISPY_TEMPLATE_PACK = 'bootstrap3'
# Internationalization # Internationalization
@ -96,13 +113,5 @@ USE_L10N = True
USE_TZ = 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 # import the private settings last to allow override
from private_settings import * from private_settings import *

View File

@ -1,3 +1,4 @@
{% load staticfiles compressed %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -5,12 +6,40 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Merging Citavi projects and mapping existing datasets."> <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> </head>
<body> <body>
<h1>{{ headline }}</h1> <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div id="content"> <div class="container">
{% block content %}{{ content }}{% endblock %}t <div class="navbar-header">
<div> <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> </body>
</html> </html>

View File

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