[TASK] Add private_settings.py, move some settings there.

This commit is contained in:
Jan Philipp Timme 2014-07-26 13:00:21 +02:00
parent 229ffb9939
commit 06fd6da45f
15 changed files with 88 additions and 51 deletions

1
.gitignore vendored
View File

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

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'SECRET'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'citavi_mapper',
'USER': 'citavi_mapper',
'PASSWORD': 'SECRET',
'HOST': 'localhost',
'PORT': '5432'
}
}

View File

@ -18,9 +18,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '$0$7v0&fg0yh*77_bre9_+1clj1b_g8flt=)c&5d^je9yvissh'
# 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
@ -38,8 +35,9 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'pipeline',
'crispy_forms', 'crispy_forms',
'hello', 'frontend',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
@ -55,23 +53,36 @@ ROOT_URLCONF = 'citavi_mapper.urls'
WSGI_APPLICATION = 'citavi_mapper.wsgi.application' WSGI_APPLICATION = 'citavi_mapper.wsgi.application'
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
CRISPY_TEMPLATE_PACK = 'bootstrap3' PIPELINE_CSS = {
'colors': {
'source_filenames': (
'css/core.css',
'css/colors/*.css',
'css/layers.css'
),
'output_filename': 'css/colors.css',
'extra_context': {
'media': 'screen,projection',
},
},
}
# Database PIPELINE_JS = {
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases 'stats': {
'source_filenames': (
DATABASES = { 'js/jquery.js',
'default': { 'js/d3.js',
'ENGINE': 'django.db.backends.postgresql_psycopg2', 'js/collections/*.js',
'NAME': 'citavi_mapper', 'js/application.js',
'USER': 'citavi_mapper', ),
'PASSWORD': 'foobar2000', 'output_filename': 'js/stats.js',
'HOST': 'pgdb.it.hs-hannover.de',
'PORT': '5432'
} }
} }
CRISPY_TEMPLATE_PACK = 'bootstrap3'
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/ # https://docs.djangoproject.com/en/1.6/topics/i18n/
@ -90,3 +101,8 @@ USE_TZ = True
# https://docs.djangoproject.com/en/1.6/howto/static-files/ # https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
# import the private settings last to allow override
from private_settings import *

View File

@ -5,10 +5,12 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin from django.contrib import admin
admin.autodiscover() admin.autodiscover()
from frontend.views import MainSite
urlpatterns = patterns('', urlpatterns = patterns('',
# Examples: # Examples:
# url(r'^$', 'citavi_mapper.views.home', name='home'), # url(r'^$', 'citavi_mapper.views.home', name='home'),
# url(r'^blog/', include('blog.urls')), # url(r'^blog/', include('blog.urls')),
url(r'^hello/', include('hello.urls')), url(r'^$', MainSite.as_view(), name='frontend-index'),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
) )

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<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>
</head>
<body>
<h1>{{ headline }}</h1>
<div id="content">
{% block content %}{{ content }}{% endblock %}t
<div>
</body>
</html>

17
frontend/views.py Normal file
View File

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from django.views.generic import TemplateView
class MainSite(TemplateView):
template_name = "base.html"
def get(self, request, **kwargs):
self._request = request
return super(MainSite, self).get(request, **kwargs)
def get_context_data(self, **kwargs):
context = super(MainSite, self).get_context_data(**kwargs)
context['title'] = 'Titeltest'
context['content'] = 'Foobar!'
context['headline'] = 'Yo!'
return context

View File

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-

View File

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from hello import views
urlpatterns = patterns('',
url(r'^$', views.Hello.as_view(), name='hello'),
url(r'^formtest/$', views.FormTest.as_view(), name='formtest')
)

View File

@ -1,11 +0,0 @@
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.views.generic import TemplateView
from django.views.generic import FormView
class Hello(TemplateView):
template_name = "hello.html"
class FormTest(FormView):
pass

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{% block title %}Citavi Mapper{% endblock %}</title>
</head>
<body>
<h1>{% block headline %}{% endblock %}</h1>
{% block content %}{% endblock %}
</body>
</html>

View File

@ -1,3 +1,4 @@
psycopg2 psycopg2
django django
django-crispy-forms django-crispy-forms
django-pipeline