2009-08-16 14:23:29 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
2010-11-28 17:31:53 +01:00
|
|
|
# Django settings for pan.do/ra project defaults,
|
|
|
|
# create local_settings.py to overwrite
|
2009-08-16 14:23:29 +02:00
|
|
|
import os
|
2010-11-15 20:15:52 +01:00
|
|
|
from os.path import join, normpath
|
2009-08-16 14:23:29 +02:00
|
|
|
|
2010-11-06 17:14:40 +01:00
|
|
|
SITENAME = 'Pan.do/ra'
|
|
|
|
SITEID = 'pandora'
|
|
|
|
URL = 'pan.do/ra'
|
2010-02-08 15:56:25 +05:30
|
|
|
|
2009-09-07 17:39:51 +02:00
|
|
|
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
DEBUG = True
|
|
|
|
TEMPLATE_DEBUG = DEBUG
|
2010-06-26 16:28:25 +02:00
|
|
|
JSON_DEBUG = True
|
2009-06-08 18:08:59 +02:00
|
|
|
|
2010-09-08 13:56:58 +02:00
|
|
|
#with apache x-sendfile or lighttpd set this to True
|
2010-02-16 18:11:57 +05:30
|
|
|
XSENDFILE = False
|
|
|
|
|
2010-09-17 22:23:03 +02:00
|
|
|
#with nginx X-Accel-Redirect set this to True
|
2010-09-08 13:56:58 +02:00
|
|
|
XACCELREDIRECT = False
|
|
|
|
|
2009-06-08 18:08:59 +02:00
|
|
|
ADMINS = (
|
2010-09-12 16:23:23 +02:00
|
|
|
#('admin', 'admin@example.com'),
|
2009-06-08 18:08:59 +02:00
|
|
|
)
|
|
|
|
|
2010-09-12 16:23:23 +02:00
|
|
|
DEFAULT_FROM_EMAIL='admin@' + URL.split('/')[0]
|
|
|
|
#DEFAULT_FROM_EMAIL='admin@example.com'
|
2011-04-06 20:57:25 +02:00
|
|
|
SERVER_EMAIL=DEFAULT_FROM_EMAIL
|
2010-02-06 13:54:39 +05:30
|
|
|
|
2009-06-08 18:08:59 +02:00
|
|
|
MANAGERS = ADMINS
|
|
|
|
|
2011-03-24 11:39:35 +01:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'NAME': 'pandora',
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'USER': 'pandora',
|
|
|
|
'PASSWORD': ''
|
|
|
|
}
|
|
|
|
}
|
2009-10-07 21:43:46 +02:00
|
|
|
|
2010-02-08 18:46:45 +05:30
|
|
|
#rabbitmq connection settings
|
2010-06-25 13:53:57 +02:00
|
|
|
CELERY_RESULT_BACKEND = "database"
|
2010-02-08 18:46:45 +05:30
|
|
|
BROKER_HOST = "127.0.0.1"
|
|
|
|
BROKER_PORT = 5672
|
2010-02-16 15:52:34 +05:30
|
|
|
BROKER_USER = "pandora"
|
|
|
|
BROKER_PASSWORD = "box"
|
|
|
|
BROKER_VHOST = "/pandora"
|
2010-12-22 13:15:37 +05:30
|
|
|
SEND_CELERY_ERROR_EMAILS=False
|
2010-02-08 18:46:45 +05:30
|
|
|
|
2010-07-06 10:51:50 +02:00
|
|
|
|
2009-06-08 18:08:59 +02:00
|
|
|
# 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.
|
|
|
|
# If running in a Windows environment this must be set to the same as your
|
|
|
|
# system time zone.
|
2009-08-16 14:23:29 +02:00
|
|
|
TIME_ZONE = 'Europe/Berlin'
|
2010-06-26 16:28:25 +02:00
|
|
|
#TIME_ZONE = 'Asia/Kolkata'
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
# 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
|
2010-02-03 17:29:11 +05:30
|
|
|
APPEND_SLASH = False
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
# Absolute path to the directory that holds media.
|
|
|
|
# Example: "/home/media/media.lawrence.com/"
|
2010-11-15 20:15:52 +01:00
|
|
|
MEDIA_ROOT = normpath(join(PROJECT_ROOT, '..', 'data'))
|
|
|
|
STATIC_ROOT = normpath(join(PROJECT_ROOT, '..', 'static'))
|
2009-10-05 00:00:08 +02:00
|
|
|
TESTS_ROOT = join(PROJECT_ROOT, 'tests')
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
# 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/"
|
2010-11-06 17:14:40 +01:00
|
|
|
MEDIA_URL = '/data/'
|
2009-06-08 18:08:59 +02:00
|
|
|
|
2009-12-31 16:04:32 +01:00
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
2009-06-08 18:08:59 +02:00
|
|
|
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
|
|
|
# trailing slash.
|
|
|
|
# Examples: "http://foo.com/media/", "/media/".
|
2009-08-16 14:23:29 +02:00
|
|
|
ADMIN_MEDIA_PREFIX = '/admin/media/'
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
# List of callables that know how to import templates from various sources.
|
|
|
|
TEMPLATE_LOADERS = (
|
2011-04-07 17:26:02 +02:00
|
|
|
'django.template.loaders.filesystem.Loader',
|
|
|
|
'django.template.loaders.app_directories.Loader',
|
|
|
|
'django.template.loaders.eggs.Loader',
|
2009-06-08 18:08:59 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = (
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
2010-11-23 10:53:12 +01:00
|
|
|
'ox.django.middleware.ExceptionMiddleware',
|
|
|
|
'ox.django.middleware.ChromeFrameMiddleware',
|
2009-06-08 18:08:59 +02:00
|
|
|
)
|
|
|
|
|
2010-02-16 15:52:34 +05:30
|
|
|
ROOT_URLCONF = 'pandora.urls'
|
2009-06-08 18:08:59 +02:00
|
|
|
|
|
|
|
TEMPLATE_DIRS = (
|
2009-09-07 17:39:51 +02:00
|
|
|
join(PROJECT_ROOT, 'templates'),
|
2009-06-08 18:08:59 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.sites',
|
2009-08-16 14:23:29 +02:00
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.humanize',
|
2010-11-25 16:21:23 +01:00
|
|
|
|
2010-01-26 18:41:57 +05:30
|
|
|
'django_extensions',
|
2010-02-10 17:34:13 +05:30
|
|
|
'devserver',
|
2010-11-26 16:07:24 +01:00
|
|
|
# 'south',
|
2010-06-25 13:53:57 +02:00
|
|
|
'djcelery',
|
2009-08-16 14:23:29 +02:00
|
|
|
|
2011-01-26 18:55:26 +05:30
|
|
|
'annotation',
|
2010-02-10 18:40:14 +05:30
|
|
|
'app',
|
2010-07-12 16:56:14 +02:00
|
|
|
'archive',
|
2011-05-28 13:35:57 +02:00
|
|
|
'event',
|
2010-11-26 16:07:24 +01:00
|
|
|
'item',
|
|
|
|
'itemlist',
|
|
|
|
'person',
|
|
|
|
'place',
|
2010-11-23 11:30:03 +01:00
|
|
|
'text',
|
2010-06-24 15:11:34 +02:00
|
|
|
'torrent',
|
2011-01-01 17:19:14 +05:30
|
|
|
'timeline',
|
2010-11-26 16:07:24 +01:00
|
|
|
'user',
|
2010-12-22 13:15:37 +05:30
|
|
|
'api',
|
2011-01-28 14:18:38 +05:30
|
|
|
'urlalias',
|
2009-06-08 18:08:59 +02:00
|
|
|
)
|
2009-08-16 14:23:29 +02:00
|
|
|
|
2011-04-07 17:26:02 +02:00
|
|
|
# A sample logging configuration. The only tangible logging
|
|
|
|
# performed by this configuration is to send an email to
|
|
|
|
# the site admins on every HTTP 500 error.
|
|
|
|
# See http://docs.djangoproject.com/en/dev/topics/logging for
|
|
|
|
# more details on how to customize your logging configuration.
|
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
|
|
|
'disable_existing_loggers': False,
|
|
|
|
'handlers': {
|
|
|
|
'mail_admins': {
|
|
|
|
'level': 'ERROR',
|
|
|
|
'class': 'django.utils.log.AdminEmailHandler'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'loggers': {
|
|
|
|
'django.request': {
|
|
|
|
'handlers': ['mail_admins'],
|
|
|
|
'level': 'ERROR',
|
|
|
|
'propagate': True,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-16 13:58:57 +02:00
|
|
|
AUTH_PROFILE_MODULE = 'user.UserProfile'
|
2010-02-03 17:29:11 +05:30
|
|
|
|
2010-02-06 13:54:39 +05:30
|
|
|
#Video encoding settings
|
2011-02-06 18:20:21 +05:30
|
|
|
#available profiles: 96p, 240p, 360p, 480p, 720p, 1080p
|
2010-08-24 19:16:33 +02:00
|
|
|
|
2011-01-24 15:08:46 +05:30
|
|
|
SITE_CONFIG = join(PROJECT_ROOT, '0xdb.json')
|
2010-11-26 16:07:24 +01:00
|
|
|
DEFAULT_SORT = [{"key": "director", "operator": ""}]
|
|
|
|
DEFAULT_THEME = "classic"
|
|
|
|
|
2011-02-06 18:20:21 +05:30
|
|
|
|
2011-07-03 18:21:27 +02:00
|
|
|
TRACKER_URL="http://url2torrent.net:6970/announce"
|
|
|
|
|
2010-11-06 17:14:40 +01:00
|
|
|
TRANSMISSON_HOST = 'localhost'
|
|
|
|
TRANSMISSON_PORT = 9091
|
|
|
|
TRANSMISSON_USER = 'transmission'
|
|
|
|
TRANSMISSON_PASSWORD = 'transmission'
|
2010-06-24 15:11:34 +02:00
|
|
|
|
2010-08-11 00:11:09 +02:00
|
|
|
|
2010-12-22 20:47:38 +05:30
|
|
|
#Movie related settings
|
|
|
|
REVIEW_WHITELIST = {
|
2011-08-05 17:50:18 +02:00
|
|
|
u'.filmcritic.com': u'Filmcritic',
|
2010-12-22 20:47:38 +05:30
|
|
|
u'metacritic.com': u'Metacritic',
|
|
|
|
u'nytimes.com': u'New York Times',
|
|
|
|
u'rottentomatoes.com': u'Rotten Tomatoes',
|
|
|
|
u'salon.com': u'Salon.com',
|
|
|
|
u'sensesofcinema.com': u'Senses of Cinema',
|
|
|
|
u'villagevoice.com': u'Village Voice'
|
|
|
|
}
|
|
|
|
|
2010-08-11 00:11:09 +02:00
|
|
|
#list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice
|
2010-11-06 17:14:40 +01:00
|
|
|
POSTER_SERVICES = []
|
|
|
|
POSTER_PRECEDENCE = (
|
|
|
|
'local',
|
|
|
|
'criterion.com',
|
|
|
|
'wikipedia.org',
|
|
|
|
'impawards.com',
|
|
|
|
'movieposterdb.com',
|
|
|
|
'imdb.com',
|
|
|
|
'allmovie.com',
|
|
|
|
'other'
|
|
|
|
)
|
2010-08-11 00:11:09 +02:00
|
|
|
|
2011-01-11 15:48:18 +05:30
|
|
|
DEFAULT_LISTS = [
|
|
|
|
{"name": "Favorites"},
|
|
|
|
{"name": "1960s", "query": {
|
|
|
|
"conditions": [{"key": "year", "value": "196", "operator": "^"}],
|
|
|
|
"operator": ""}
|
|
|
|
}
|
|
|
|
]
|
2010-09-12 16:23:23 +02:00
|
|
|
#0xdb.org
|
2011-01-16 18:58:57 +05:30
|
|
|
USE_IMDB = True
|
2011-02-02 16:06:04 +05:30
|
|
|
#this should idealy go away, one folder per item
|
|
|
|
USE_FOLDER = True
|
2011-01-16 18:58:57 +05:30
|
|
|
|
2010-09-12 16:23:23 +02:00
|
|
|
#POSTER_SERVICES=['http://data.0xdb.org/poster/']
|
|
|
|
|
2010-10-16 13:58:57 +02:00
|
|
|
#copy scripts and adjust to customize
|
2010-10-16 13:49:45 +02:00
|
|
|
ITEM_POSTER = join('scripts', 'oxdb_poster')
|
2010-10-16 13:58:57 +02:00
|
|
|
#ITEM_POSTER = join('scripts', 'padma_poster')
|
2010-10-16 13:49:45 +02:00
|
|
|
ITEM_ICON = join('scripts', 'item_icon')
|
|
|
|
LIST_ICON = join('scripts', 'list_icon')
|
|
|
|
|
2009-09-07 17:39:51 +02:00
|
|
|
#overwrite default settings with local settings
|
2009-08-16 14:23:29 +02:00
|
|
|
try:
|
2009-09-07 17:39:51 +02:00
|
|
|
from local_settings import *
|
|
|
|
except ImportError:
|
|
|
|
pass
|
2009-08-16 14:23:29 +02:00
|
|
|
|
2009-09-07 17:39:51 +02:00
|
|
|
# Make this unique, creates random key first at first time.
|
|
|
|
try:
|
|
|
|
SECRET_KEY
|
|
|
|
except NameError:
|
|
|
|
SECRET_FILE = os.path.join(PROJECT_ROOT, 'secret.txt')
|
|
|
|
try:
|
|
|
|
SECRET_KEY = open(SECRET_FILE).read().strip()
|
|
|
|
except IOError:
|
|
|
|
try:
|
|
|
|
from random import choice
|
|
|
|
SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
|
|
|
|
secret = file(SECRET_FILE, 'w')
|
|
|
|
secret.write(SECRET_KEY)
|
|
|
|
secret.close()
|
|
|
|
except IOError:
|
|
|
|
Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)
|
2009-08-16 14:23:29 +02:00
|
|
|
|