Source

berlotto.net / settings.py

# -*- coding: utf-8 -*-
# Django settings for berlottonet project.
import os
#import django
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

DEBUG = False
TEMPLATE_DEBUG = DEBUG

ROOT_URL='http://localhost:8000/'

ADMINS = (
     ('Sergio Berlotto', 'sergio@berlotto.net'),
)

#DJANGO_ROOT=os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT=os.path.dirname(os.path.realpath(__file__))

MANAGERS = ADMINS

DATABASES = {
    'default':{
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'berlotto_homologacao',                      # Or path to database file if using sqlite3.
        'USER': 'berlotto_homolog',                      # Not used with sqlite3.
        'PASSWORD': 'ESvuLktP0UHs',                  # Not used with sqlite3.
        'HOST': 'berlotto.net',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

FILE_UPLOAD_MAX_MEMORY_SIZE=10240 #10mb
#FILE_UPLOAD_TEMP_DIR=/tmp #default system temp /tmp
#FILE_UPLOAD_PERMISSIONS=0644 #default 0644

# 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/Sao_Paulo'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'pt-BR'

SITE_ID = 1

#CACHE_BACKEND = 'file:///tmp/django_cache?timeout=10800&max_entries=1000'
#CACHE_BACKEND = 'file:///home/berlo352/djangocache/berlottonet'
CACHE_BACKEND = 'locmem://'
#CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
#CACHE_BACKEND = 'dummy://'

#CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False

# 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 = os.path.join(SITE_ROOT,'static_files')
STATIC_ROOT = 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/"
MEDIA_URL = '/static/'
STATIC_URL = 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 = '/admin_grappelli/'
#ADMIN_MEDIA_PREFIX = '/admin_media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '@1nj%tto-cgf6zmuu#%_serg6y@1!*@qimux!-bpk=frt$inkl'

# 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 = (
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)
ROOT_URLCONF = 'berlottonet.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.
    os.path.join(SITE_ROOT,'templates'),
    os.path.join(SITE_ROOT,'django_yaba/templates')
)

#TEMPLATE_CONTEXT_PROCESSORS += ( "django.core.context_processors.request", )
TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.contrib.messages.context_processors.messages",
    "django.core.context_processors.request",
    "berlottonet.template_processors.user",
)

###############################################
# django-yaba specific settings below         #
###############################################
# GitHub UserName for sidebar GitHub List - Leave blank if you don't want to use it
GITHUB_USERNAME = ''
BITBUCKET_USERNAME='berlotto'   #PRevisto... nao funciona ainda

# Twitter UserName for sidebar Twitter List and Automatic Tweets
TWITTER_USERNAME = 'berlottocdd'
TWITTER_PASSWORD = "j8716u71"

FLICKR_API_KEY = '57cea56064891f6d58219f6505710454'
FLICKR_USERNAME = 'berlotto'
FLICKR_USER_ID = '51882400@N00'

# Blog Name
BLOG_NAME = 'berlotto.net'

# Blog URL
ROOT_BLOG_URL = ROOT_URL
BLOG_POSTS_PER_PAGE = 5
BLOG_LATEST_POSTS_MAX = 7

# Root system path
PROJECT_DIR = os.path.dirname(__file__)

GRAPPELLI_ADMIN_TITLE='Administra&ccedil;&atilde;o : <a href="/">berlotto.net</a>'


#FILEBROWSER_DIRECTORY = 'media_fb/'
#FILEBROWSER_MEDIA_ROOT = SITE_ROOT
#FILEBROWSER_MEDIA_URL = '/media_fb/'

FILEBROWSER_DIRECTORY = 'uploads/'
FILEBROWSER_MEDIA_ROOT = os.path.join(MEDIA_ROOT,'filebrowser/')
FILEBROWSER_MEDIA_URL = '/static/filebrowser/'

#print '# FILEBROWSER_MEDIA_ROOT ########## %s' % FILEBROWSER_MEDIA_ROOT
#print '# MEDIA_ROOT + DIRECTORY ########## %s' % os.path.join(FILEBROWSER_MEDIA_ROOT,FILEBROWSER_DIRECTORY)
#print os.path.exists(os.path.join(FILEBROWSER_MEDIA_ROOT,FILEBROWSER_DIRECTORY))

FILEBROWSER_URL_FILEBROWSER_MEDIA = MEDIA_URL + "filebrowser/"
FILEBROWSER_PATH_FILEBROWSER_MEDIA = os.path.join(MEDIA_ROOT, 'filebrowser/')

#print '# FILEBROWSER_PATH_FILEBROWSER_MEDIA ########## %s' % FILEBROWSER_PATH_FILEBROWSER_MEDIA

FILEBROWSER_URL_TINYMCE = "/static/tiny_mce/"
FILEBROWSER_PATH_TINYMCE = os.path.join(MEDIA_ROOT, 'static_files/tiny_mce/')


# Disqus Settings
DISQUS_API_KEY = "7vhPpSAoCv6wSqQu9HKnTUZSviPPohuwXruu7awVBhoODZXRQIs1CKEWmWhccBWR"
DISQUS_WEBSITE_SHORTNAME = "blogmingus"

DPASTE_HOMEPAGE_TITLE='PasteBin'
DPASTE_HOMEPAGE_DESCRIPTION='PasteBin publico de Berlotto.net'
MAX_SNIPPETS_PER_USER=200

# If you want to use contrib.comments set the following to True
DJANGO_COMMENTS = False
################################################


INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.comments',
    'django.contrib.flatpages',
    'django.contrib.sitemaps',
    'tagging',
    'disqus',
    'django_yaba',

    'dpaste',
    'mptt',
    
    'grappelli',
    'filebrowser',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    'encurtador', #Meu encurtador de URL
    'website',    #O site propriamente dito
    'imagens',    #Share de imagens
)


try:
    from local_settings import *
except:
    pass