From bb4bce6fb159b6e765be93b77d0515d3674e42bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Aguirre?= Date: Thu, 6 Jan 2011 00:58:28 -0200 Subject: [PATCH] Common templates directory --- example/settings.py | 52 ++++++------------------ example/templates/base.html | 79 ++++++++----------------------------- 2 files changed, 28 insertions(+), 103 deletions(-) diff --git a/example/settings.py b/example/settings.py index efb2b2c..84716d2 100644 --- a/example/settings.py +++ b/example/settings.py @@ -1,68 +1,42 @@ +import sys +import random +import os +from os.path import abspath, dirname, basename, join + DEBUG = True TEMPLATE_DEBUG = DEBUG +ROOT_PATH = abspath(dirname(__file__)) +PROJECT_NAME = basename(ROOT_PATH) + ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) - MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'test.db', # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '', # Set to empty string for default. Not used with sqlite3. + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'test.db', } } -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# On Unix systems, a value of None will cause Django to use the same -# timezone as the operating system. -# If running in a Windows environment this must be set to the same as your -# system time zone. TIME_ZONE = 'America/Chicago' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' - SITE_ID = 1 -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale USE_L10N = True -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" +ADMIN_MEDIA_PREFIX = '/admin-media/' MEDIA_URL = '' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/' - -# Make this unique, and don't share it with anybody. SECRET_KEY = 't2eo^kd%k+-##ml3@_x__$j0(ps4p0q6eg*c4ttp9d2n(t!iol' -# List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( @@ -76,9 +50,7 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'example.urls' TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. + join(ROOT_PATH, 'templates') ) INSTALLED_APPS = ( diff --git a/example/templates/base.html b/example/templates/base.html index ab5162d..8ac75a3 100644 --- a/example/templates/base.html +++ b/example/templates/base.html @@ -2,68 +2,21 @@ Social authentication | {% block title %}{% endblock %} @@ -71,6 +24,6 @@
{% block content %}{% endblock %}
- Fork me on GitHub + Fork me on GitHub -- 2.39.5