Skip to content

Instantly share code, notes, and snippets.

@chr0nu5
Created June 11, 2014 13:45
Show Gist options
  • Save chr0nu5/990404f74222c2239523 to your computer and use it in GitHub Desktop.
Save chr0nu5/990404f74222c2239523 to your computer and use it in GitHub Desktop.
Configuração Atual de Data
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Django settings for kikoautos project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
gettext = lambda s: s
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '(^-9oq5gh!91&15qg0t+b57gzkkfui*njbc-9xt1smapz(d%b2'
# Import socket to read host name
import socket
HOST = socket.gethostname()
LIVEHOST = True
if HOST.startswith('lucid64') or HOST.startswith('kikoautos'):
LIVEHOST = False
# SECURITY WARNING: don't run with debug turned on in production!
if LIVEHOST:
DEBUG = False
TEMPLATE_DEBUG = False
else:
DEBUG = True
TEMPLATE_DEBUG = True
#DEBUG = True
#TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
LANGUAGE_CODE = 'pt-br'
LANGUAGES = (
('en', gettext('English')),
('zh_CN', gettext('Chinese')),
('pt-br', u'Português'),
)
SITE_ID = 1
#DEBUG = False
#ALLOWED_HOSTS = ['127.0.0.1']
# Application definition
INSTALLED_APPS = (
#'django_admin_bootstrapped.bootstrap3',
#'django_admin_bootstrapped',
#'grappelli',
#'djangocms_admin_style'
'django.contrib.humanize',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
#'ajax_changelist',
'sorl.thumbnail',
'topnotchdev.files_widget',
'ckeditor',
'xadmin',
'crispy_forms',
'manager',
)
CKEDITOR_UPLOAD_PATH = 'uploads/'
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
'toolbar_Basic': [
['Source', '-', 'Bold', 'Italic']
],
'toolbar_Full': [
['Styles', 'Format', 'Bold', 'Italic', 'Underline', 'Strike', 'SpellChecker', 'Undo', 'Redo'],
['Link', 'Image', 'Flash', 'Table', 'HorizontalRule'],
['TextColor', 'BGColor'],
['Smiley', 'SpecialChar'], ['Source'],
],
'toolbar': 'Full',
'height': 291,
'width': 835,
'filebrowserWindowWidth': 940,
'filebrowserWindowHeight': 725,
},
}
FILES_WIDGET_TEMP_DIR = 'temp/files_widget/'
FILES_WIDGET_FILES_DIR = 'uploads/files_widget/'
THUMBNAIL_DEBUG = True
MIDDLEWARE_CLASSES = (
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'kikoautos.urls'
WSGI_APPLICATION = 'kikoautos.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'kikoautos',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = False
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
)
PROJECTNAME = os.path.dirname(__file__)
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
MEDIA_ROOT = os.path.join(PROJECTNAME, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECTNAME, 'static')
STATIC_URL = '/static/'
ADMIN_MEDIA_ROOT = os.path.join(PROJECTNAME, 'static', 'admin')
ADMIN_MEDIA_PREFIX = '/static/admin/'
UPLOAD_ROOT = os.path.join(MEDIA_ROOT, 'manager/img/temp/')
UPLOAD_URL = MEDIA_URL + 'manager/img/temp'
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.request',
)
# 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 when DEBUG=False.
# 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,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
# 'django.db.backends': {
# 'handlers': ['console'],
# 'level': 'DEBUG',
# }
}
}
DATE_FORMAT = 'd/m/Y'
#DATE_INPUT_FORMATS = (
# '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%d-%m-%Y', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
#)
# form error message override
from django.forms import Field
from django.utils.translation import ugettext_lazy
Field.default_error_messages = {
'required': ugettext_lazy("Este campo é obrigatório."),
'invalid': ugettext_lazy("Por favor, verifique os dados inseridos."),
}
#email configuration
EMAIL_HOST = "smtp.kikoautos.com"
EMAIL_PORT = 587
EMAIL_HOST_USER = "sendmail@kikoautos.com"
EMAIL_HOST_PASSWORD = "ph0cu5x3r3t@"
EMAIL_USE_TLS = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment