settings.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # -*- coding: utf-8 -*-
  2. """
  3. Django settings for record project.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.6/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.6/ref/settings/
  8. """
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. import os
  11. from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
  12. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = ')-s&c_)jnmzoslf=9rnav9qqadd#l$46jt+m51ppu!lril3g89'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. TEMPLATE_DEBUG = True
  20. ALLOWED_HOSTS = []
  21. # Application definition
  22. INSTALLED_APPS = (
  23. 'django.contrib.admin',
  24. 'django.contrib.auth',
  25. 'django.contrib.contenttypes',
  26. 'django.contrib.sessions',
  27. 'django.contrib.messages',
  28. 'django.contrib.staticfiles',
  29. 'inplaceeditform',
  30. 'django_tables2',
  31. 'sorl.thumbnail',
  32. 'asuzr',
  33. )
  34. MIDDLEWARE_CLASSES = (
  35. 'django.contrib.sessions.middleware.SessionMiddleware',
  36. 'django.middleware.common.CommonMiddleware',
  37. 'django.middleware.csrf.CsrfViewMiddleware',
  38. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  39. 'django.contrib.messages.middleware.MessageMiddleware',
  40. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  41. 'gadjo.requestprovider.middleware.RequestProvider',
  42. )
  43. ROOT_URLCONF = 'record.urls'
  44. WSGI_APPLICATION = 'record.wsgi.application'
  45. # Database
  46. # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
  47. DATABASES = {
  48. 'default': {
  49. 'ENGINE': 'django.db.backends.sqlite3',
  50. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  51. }
  52. }
  53. # Internationalization
  54. # https://docs.djangoproject.com/en/1.6/topics/i18n/
  55. LANGUAGE_CODE = 'ru-RU'
  56. TIME_ZONE = 'Asia/Yekaterinburg'
  57. USE_I18N = True
  58. USE_L10N = False
  59. USE_TZ = True
  60. DATE_FORMAT = 'd.m.Y'
  61. DATETIME_FORMAT = 'd.m.Y H:i:s'
  62. DATE_INPUT_FORMATS = ('%d.%m.%Y',)
  63. DATETIME_INPUT_FORMATS = ('%d.%m.%Y %H:%M:%S',)
  64. FIRST_DAY_OF_WEEK = 1
  65. # Static files (CSS, JavaScript, Images)
  66. # https://docs.djangoproject.com/en/1.6/howto/static-files/
  67. STATIC_URL = '/static/'
  68. ADMIN_MEDIA_PREFIX = '/static/admin/'
  69. TEMPLATE_DIRS = ('templates/',)
  70. TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.request',
  71. 'django.core.context_processors.csrf',
  72. )
  73. MEDIA_ROOT = 'media/'
  74. MEDIA_URL = 'http://127.0.0.1:8000/media/'
  75. THUMBNAIL_ENGINE = 'sorl.thumbnail.engines.convert_engine.Engine'
  76. INPLACEEDIT_EVENT = 'click'
  77. INPLACEEDIT_SUCCESS_TEXT = u'Сохранено'
  78. from django.utils.safestring import mark_safe
  79. INPLACEEDIT_EDIT_EMPTY_VALUE = mark_safe(u'<div class="gray">Редактировать</div>')
  80. ADAPTOR_INPLACEEDIT_EDIT = 'inplaceeditform.perms.AdminDjangoPermEditInline'