]> git.parisson.com Git - django-social-auth.git/commitdiff
Common templates directory
authorMatías Aguirre <matiasaguirre@gmail.com>
Thu, 6 Jan 2011 02:58:28 +0000 (00:58 -0200)
committerMatías Aguirre <matiasaguirre@gmail.com>
Thu, 6 Jan 2011 02:58:28 +0000 (00:58 -0200)
example/settings.py
example/templates/base.html

index efb2b2cdb3006b3837ec5a276b95742ba7ef43c6..84716d204c38f281c50a8de286e2bd3ccad5664b 100644 (file)
@@ -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 = (
index ab5162d23a10da98ddda40c8093edb717fe64457..8ac75a3431683ea590dba1868e2edccddbeb47e3 100644 (file)
@@ -2,68 +2,21 @@
   <head>
     <title>Social authentication | {% block title %}{% endblock %}</title>
     <style>
-      body {
-        background-color: #eee;
-        padding: 10px 20px;
-        font-family: sans-serif;
-        color: #333;
-      }
-      h1 {
-        font-size: 1.5em;
-        border-bottom: 1px solid #ddd;
-        width: 95%;
-      }
-      h2 {
-        font-size: 1.2em;
-      }
-      a, a:visited {
-        color: #459FDA;
-        text-decoration: none;
-      }
-      a:hover {
-        text-decoration: underline;
-      }
-      input[type="text"] {
-        border: 1px solid #ccc;
-        padding: 3px;
-        width: 300px;
-      }
-      input[type="submit"] {
-        padding: 2px 20px;
-        margin-left: -5px;
-      }
-      label {
-        display: block;
-      }
-      th {
-        text-align: left;
-        padding-right: 25px;
-        font-weight: normal;
-      }
-      th, td {
-          padding: 5px 15px;
-      }
-      tr.even {
-        background-color: #ddd;
-      }
-      #content {
-        padding: 5px 20px;
-      }
-      .helptext {
-        font-size: 0.9em;
-        color: #aaa;
-        margin: 0;
-        padding: 0;
-      }
-      a.logout, .associated, .error {
-        color: #c00;
-      }
-      #forkme {
-        position: absolute;
-        top: 0;
-        right: 0;
-        border: 0;
-      }
+      body {background-color: #eee; padding: 10px 20px; font-family: sans-serif; color: #333;}
+      h1 {font-size: 1.5em; border-bottom: 1px solid #ddd; width: 95%;}
+      h2 {font-size: 1.2em;}
+      a, a:visited {color: #459FDA; text-decoration: none;}
+      a:hover {text-decoration: underline;}
+      input[type="text"] {border: 1px solid #ccc; padding: 3px; width: 300px;}
+      input[type="submit"] {padding: 2px 20px; margin-left: -5px;}
+      label {display: block;}
+      th {text-align: left; padding-right: 25px; font-weight: normal;}
+      th, td {padding: 5px 15px;}
+      tr.even {background-color: #ddd;}
+      #content {padding: 5px 20px;}
+      .helptext {font-size: 0.9em; color: #aaa; margin: 0; padding: 0;}
+      a.logout, .associated, .error {color: #c00;}
+      #forkme {position: absolute; top: 0; right: 0; border: 0;}
     </style>
   </head>
   <body>
@@ -71,6 +24,6 @@
     <div id="content">
       {% block content %}{% endblock %}
     </div>
-    <a id="forkme" href="http://github.com/omab/django-social-auth"><img src="https://assets2.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_right_red_aa0000.png&path=" alt="Fork me on GitHub"></a>
+    <a id="forkme" href="http://github.com/omab/django-social-auth"><img src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
   </body>
 </html>