diff options
-rwxr-xr-x | lib/filebrowser/settings.py | 128 | ||||
-rw-r--r-- | lib/grappelli/settings.py | 10 | ||||
-rw-r--r-- | settings.py | 160 |
3 files changed, 298 insertions, 0 deletions
diff --git a/lib/filebrowser/settings.py b/lib/filebrowser/settings.py new file mode 100755 index 0000000..79f2fbf --- /dev/null +++ b/lib/filebrowser/settings.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +# imports +import os + +# django imports +from django.conf import settings +from django.utils.translation import ugettext_lazy as _ + +# settings for django-tinymce +try: + import tinymce.settings + DEFAULT_URL_TINYMCE = tinymce.settings.JS_BASE_URL + '/' + DEFAULT_PATH_TINYMCE = tinymce.settings.JS_ROOT + '/' +except ImportError: + DEFAULT_URL_TINYMCE = settings.ADMIN_MEDIA_PREFIX + "tinymce/jscripts/tiny_mce/" + DEFAULT_PATH_TINYMCE = os.path.join(settings.MEDIA_ROOT, 'admin/tinymce/jscripts/tiny_mce/') + +# Set to True in order to see the FileObject when Browsing. +DEBUG = getattr(settings, "FILEBROWSER_DEBUG", False) + +# Main Media Settings +MEDIA_ROOT = getattr(settings, "FILEBROWSER_MEDIA_ROOT", settings.MEDIA_ROOT) +MEDIA_URL = getattr(settings, "FILEBROWSER_MEDIA_URL", settings.MEDIA_URL) + +# Main FileBrowser Directory. This has to be a directory within MEDIA_ROOT. +# Leave empty in order to browse all files under MEDIA_ROOT. +# DO NOT USE A SLASH AT THE BEGINNING, DO NOT FORGET THE TRAILING SLASH AT THE END. +DIRECTORY = getattr(settings, "FILEBROWSER_DIRECTORY", 'uploads/') + +# The URL/PATH to your filebrowser media-files. +URL_FILEBROWSER_MEDIA = getattr(settings, "FILEBROWSER_URL_FILEBROWSER_MEDIA", "/media/filebrowser/") +PATH_FILEBROWSER_MEDIA = getattr(settings, "FILEBROWSER_PATH_FILEBROWSER_MEDIA", os.path.join(settings.MEDIA_ROOT, 'filebrowser/')) + +# The URL/PATH to your TinyMCE Installation. +URL_TINYMCE = getattr(settings, "FILEBROWSER_URL_TINYMCE", DEFAULT_URL_TINYMCE) +PATH_TINYMCE = getattr(settings, "FILEBROWSER_PATH_TINYMCE", DEFAULT_PATH_TINYMCE) + +# Allowed Extensions for File Upload. Lower case is important. +# Please be aware that there are Icons for the default extension settings. +# Therefore, if you add a category (e.g. "Misc"), you won't get an icon. +EXTENSIONS = getattr(settings, "FILEBROWSER_EXTENSIONS", { + 'Folder': [''], + 'Image': ['.jpg','.jpeg','.gif','.png','.tif','.tiff'], + 'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'], + 'Document': ['.pdf','.doc','.rtf','.txt','.xls','.csv'], + 'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p'], + 'Code': ['.html','.py','.js','.css'] +}) + +# Define different formats for allowed selections. +# This has to be a subset of EXTENSIONS. +SELECT_FORMATS = getattr(settings, "FILEBROWSER_SELECT_FORMATS", { + 'File': ['Folder','Document',], + 'Image': ['Image'], + 'Media': ['Video','Sound'], + 'Document': ['Document'], + # for TinyMCE we can also define lower-case items + 'image': ['Image'], + 'file': ['Folder','Image','Document',], + 'media': ['Video','Sound'], +}) + +# Directory to Save Image Versions (and Thumbnails). Relative to MEDIA_ROOT. +# If no directory is given, versions are stored within the Image directory. +# VERSION URL: VERSIONS_BASEDIR/original_path/originalfilename_versionsuffix.extension +VERSIONS_BASEDIR = getattr(settings, 'FILEBROWSER_VERSIONS_BASEDIR', '') +# Versions Format. Available Attributes: verbose_name, width, height, opts +VERSIONS = getattr(settings, "FILEBROWSER_VERSIONS", { + 'fb_thumb': {'verbose_name': 'Admin Thumbnail', 'width': 60, 'height': 60, 'opts': 'crop upscale'}, + 'thumbnail': {'verbose_name': 'Thumbnail (140px)', 'width': 140, 'height': '', 'opts': ''}, + 'small': {'verbose_name': 'Small (300px)', 'width': 300, 'height': '', 'opts': ''}, + 'medium': {'verbose_name': 'Medium (460px)', 'width': 460, 'height': '', 'opts': ''}, + 'big': {'verbose_name': 'Big (620px)', 'width': 620, 'height': '', 'opts': ''}, + 'cropped': {'verbose_name': 'Cropped (60x60px)', 'width': 60, 'height': 60, 'opts': 'crop'}, + 'croppedthumbnail': {'verbose_name': 'Cropped Thumbnail (140x140px)', 'width': 140, 'height': 140, 'opts': 'crop'}, +}) +# Quality of saved versions +VERSION_QUALITY = getattr(settings, 'FILEBROWSER_VERSION_QUALITY', 90) +# Versions available within the Admin-Interface. +ADMIN_VERSIONS = getattr(settings, 'FILEBROWSER_ADMIN_VERSIONS', ['thumbnail','small', 'medium','big']) +# Which Version should be used as Admin-thumbnail. +ADMIN_THUMBNAIL = getattr(settings, 'FILEBROWSER_ADMIN_THUMBNAIL', 'fb_thumb') +# Preview Version +PREVIEW_VERSION = getattr(settings, 'FILEBROWSER_PREVIEW_VERSION', 'small') + +# EXTRA SETTINGS +# True to save the URL including MEDIA_URL to your model fields +# or False (default) to save path relative to MEDIA_URL. +# Note: Full URL does not necessarily means absolute URL. +SAVE_FULL_URL = getattr(settings, "FILEBROWSER_SAVE_FULL_URL", True) +# If set to True, the FileBrowser will not try to import a mis-installed PIL. +STRICT_PIL = getattr(settings, 'FILEBROWSER_STRICT_PIL', False) +# PIL's Error "Suspension not allowed here" work around: +# s. http://mail.python.org/pipermail/image-sig/1999-August/000816.html +IMAGE_MAXBLOCK = getattr(settings, 'FILEBROWSER_IMAGE_MAXBLOCK', 1024*1024) +# Exclude files matching any of the following regular expressions +# Default is to exclude 'thumbnail' style naming of image-thumbnails. +EXTENSION_LIST = [] +for exts in EXTENSIONS.values(): + EXTENSION_LIST += exts +EXCLUDE = getattr(settings, 'FILEBROWSER_EXCLUDE', (r'_(%(exts)s)_.*_q\d{1,3}\.(%(exts)s)' % {'exts': ('|'.join(EXTENSION_LIST))},)) +# Max. Upload Size in Bytes. +MAX_UPLOAD_SIZE = getattr(settings, "FILEBROWSER_MAX_UPLOAD_SIZE", 10485760) +# Convert Filename (replace spaces and convert to lowercase) +CONVERT_FILENAME = getattr(settings, "FILEBROWSER_CONVERT_FILENAME", True) +# Max. Entries per Page +# Loading a Sever-Directory with lots of files might take a while +# Use this setting to limit the items shown +LIST_PER_PAGE = getattr(settings, "FILEBROWSER_LIST_PER_PAGE", 50) +# Default Sorting +# Options: date, filesize, filename_lower, filetype_checked +DEFAULT_SORTING_BY = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_BY", "date") +# Sorting Order: asc, desc +DEFAULT_SORTING_ORDER = getattr(settings, "FILEBROWSER_DEFAULT_SORTING_ORDER", "desc") +# regex to clean dir names before creation +FOLDER_REGEX = getattr(settings, "FILEBROWSER_FOLDER_REGEX", r'^[\w._/-]+$') + +# EXTRA TRANSLATION STRINGS +# The following strings are not availabe within views or templates +_('Folder') +_('Image') +_('Video') +_('Document') +_('Audio') +_('Code') + + diff --git a/lib/grappelli/settings.py b/lib/grappelli/settings.py new file mode 100644 index 0000000..697d213 --- /dev/null +++ b/lib/grappelli/settings.py @@ -0,0 +1,10 @@ +# coding: utf-8 + +from django.conf import settings + +# Admin Site Title +ADMIN_HEADLINE = getattr(settings, "GRAPPELLI_ADMIN_HEADLINE", 'Grappelli') +ADMIN_TITLE = getattr(settings, "GRAPPELLI_ADMIN_TITLE", 'Grappelli') + +# Link to your Main Admin Site (no slashes at start and end) +ADMIN_URL = getattr(settings, "GRAPPELLI_ADMIN_URL", '/admin/')
\ No newline at end of file diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..e80d5b6 --- /dev/null +++ b/settings.py @@ -0,0 +1,160 @@ +# Django settings for luxagraf. +from os.path import dirname, abspath + +PROJ_ROOT = abspath(dirname(__file__))+'/' + + +DEBUG = False +TEMPLATE_DEBUG = DEBUG +DEVELOPMENT = False +ADMINS = ( + ('sng', 'luxagraf@gmail.com'), +) +CONTACT = ( + ('sng', 'sng@luxagraf.net'), +) +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'NAME': 'luxagraf', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'USER': 'luxagrafe', + 'PASSWORD': 'translinguis#', + 'HOST': 'web62.webfaction.com', + } +} + +#Email Setting for Webfaction +EMAIL_HOST = 'mail2.webfaction.com' +EMAIL_HOST_USER = 'luxagraf' +EMAIL_HOST_PASSWORD = 'translinguis#' +DEFAULT_FROM_EMAIL = 'sng@luxagraf.net' +SEND_BROKEN_LINK_EMAILS = True +SERVER_EMAIL = 'sng@luxagraf.net' +EMAIL_PORT = 25 + +SITE_NAME = 'luxagraf' + +GRAPPELLI_ADMIN_TITLE = 'Luxagraf Admin' + + + +#API key for Google Maps in Admin +MAP_API = "google" +GOOGLE_MAPS_API_KEY = MAP_API_KEY = 'ABQIAAAAEZ0Oz7LFDmdS1OBHm6HLgRQT5Lr-mnFT_29u-YVgAYs_K_u6-BQ627CkPKq44oaHpmSt2497hDj_LQ' +SITE_NAME = 'Luxagraf' +# API key for askimet spam filter +AKISMET_API_KEY = '23decc99e9ed' +# API key for Flickr imports +FLICKR_API_KEY = '7b9d978a440c6ab65a545adc0aa0d693' +FLICKR_USER_ID = '85322932@N00' + +DELICIOUS_USER = 'luxagraf' +DELICIOUS_PASS = 'translinguis#' +TUMBLR_URL = 'luxagraf.tumblr.com' +TUMBLR_PASSWORD = 'translinguis' +TUMBLR_USER ='luxagraf@gmail.com' +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 + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = PROJ_ROOT+'media/' +IMAGES_ROOT = PROJ_ROOT+'media/images/' + +# URL that handles the media served from MEDIA_ROOT. +# Example: "http://media.lawrence.com" +MEDIA_URL = 'http://media.luxagraf.net/' +IMAGES_URL = 'http://images.luxagraf.net/' +# 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/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '-kzv5^z9@j%cvk6u#lcf&nuga4oiy_-6q^-+#iybt44t_ii-1o' + +#CACHE_BACKEND = 'memcached://174.133.21.78:32348/' +#CACHE_MIDDLEWARE_SECONDS = 3600 +#CACHE_MIDDLEWARE_KEY_PREFIX = 'luxagraf_net' + + +MIDDLEWARE_CLASSES = ( + 'django.middleware.gzip.GZipMiddleware', + #'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.common.CommonMiddleware', + # 'django.middleware.cache.FetchFromCacheMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'pagination.middleware.PaginationMiddleware', + 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', + 'fdigg.middleware.FckDiggMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', +) +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.request', + 'django.core.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.media', + "grappelli.context_processors.admin_template_path", +) +ROOT_URLCONF = 'base_urls' +INTERNAL_IPS = ( + '67.15.64.48', + '63.251.179.56', + '127.0.0.1' +) + +TEMPLATE_DIRS = ( + PROJ_ROOT+'templates', + PROJ_ROOT+'lib/templates', + PROJ_ROOT+'lib/grappelli/templates', + #PROJ_ROOT+'lib/debug_toolbar/templates', + # 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. +) +TEMPLATE_LOADERS = ( + ('django.template.loaders.cached.Loader', ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + )), +) +INSTALLED_APPS = ( + 'grappelli', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.flatpages', + 'django.contrib.sitemaps', + 'django.contrib.gis', + 'filebrowser', + 'locations', + 'blog', + 'photos', + 'tagging', + 'chunks', + 'links', + 'pagination', + 'templatetags', + 'contact_form', + 'projects' + +) +try: + from settings_local import * +except: + pass |