/src/danseku/settings.py

https://bitbucket.org/danseku/danseku · Python · 133 lines · 84 code · 27 blank · 22 comment · 0 complexity · 5c203e3904bb913a9eb54c8dc0e0e52b MD5 · raw file

  1. # Django settings for danseku project.
  2. import os.path
  3. DEBUG = True
  4. TEMPLATE_DEBUG = DEBUG
  5. ADMINS = (
  6. ('Jonas Myrlund', 'myrlund@gmail.com'),
  7. )
  8. MANAGERS = ADMINS
  9. DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  10. DATABASE_NAME = os.path.join(os.path.dirname(__file__), 'danseku.db').replace('\\','/') # Or path to database file if using sqlite3.
  11. DATABASE_USER = 'danseku2' # Not used with sqlite3.
  12. DATABASE_PASSWORD = 'eLZqsxHNCGuj2qYS' # Not used with sqlite3.
  13. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
  14. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
  15. make_path = lambda p: os.path.join(os.path.dirname(__file__), p).replace('\\','/')
  16. PATH_FILES = make_path('files')
  17. make_relpath = lambda p: os.path.join(PATH_FILES, p).replace('\\','/')
  18. PATH_STATIC = make_relpath('static')
  19. PATH_RESOURCES = make_relpath('resources')
  20. # Latex-options
  21. LATEX_URL = "static/latex/"
  22. LATEX_PATH = make_relpath(LATEX_URL)
  23. LATEX_URL = "/" + LATEX_URL
  24. LATEX_PREFIX = "eqn-"
  25. LATEX_SIZE = 1.3
  26. AUTH_PROFILE_MODULE = "user_profile.userprofile"
  27. MAIN_MENU = [
  28. {"title": "Hjem", "url": "/"},
  29. {"title": "Nyheter", "url": "/news/"},
  30. {"title": "Fagoversikt", "url": "/courses/"},
  31. ]
  32. KEYS = {
  33. "new": "ny",
  34. "edit": "rediger",
  35. "upload": "last_opp",
  36. "add_class": "legg_til_klasse",
  37. "favorite": "favorize",
  38. }
  39. LOGIN_URL = "/user/login/"
  40. DATE_FORMAT = "d.m.Y"
  41. DATETIME_FORMAT = DATE_FORMAT+" H:i"
  42. # Local time zone for this installation. Choices can be found here:
  43. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  44. # although not all choices may be available on all operating systems.
  45. # If running in a Windows environment this must be set to the same as your
  46. # system time zone.
  47. TIME_ZONE = 'Europe/Oslo'
  48. # Language code for this installation. All choices can be found here:
  49. # http://www.i18nguy.com/unicode/language-identifiers.html
  50. LANGUAGE_CODE = 'no-nb'
  51. SITE_ID = 1
  52. SITE_NAME = "danseku.no"
  53. # If you set this to False, Django will make some optimizations so as not
  54. # to load the internationalization machinery.
  55. USE_I18N = True
  56. # Absolute path to the directory that holds media.
  57. # Example: "/home/media/media.lawrence.com/"
  58. MEDIA_ROOT = PATH_FILES
  59. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  60. # trailing slash if there is a path component (optional in other cases).
  61. # Examples: "http://media.lawrence.com", "http://example.com/media/"
  62. MEDIA_URL = ''
  63. # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  64. # trailing slash.
  65. # Examples: "http://foo.com/media/", "/media/".
  66. ADMIN_MEDIA_PREFIX = '/media/'
  67. # Make this unique, and don't share it with anybody.
  68. SECRET_KEY = 'nkk5udh1x(qv(tc8c&c%v!okms(394+7&jmbfxq&@arm9!++te'
  69. # List of callables that know how to import templates from various sources.
  70. TEMPLATE_LOADERS = (
  71. 'django.template.loaders.filesystem.load_template_source',
  72. 'django.template.loaders.app_directories.load_template_source',
  73. # 'django.template.loaders.eggs.load_template_source',
  74. )
  75. MIDDLEWARE_CLASSES = (
  76. 'django.middleware.common.CommonMiddleware',
  77. 'django.middleware.csrf.CsrfViewMiddleware',
  78. 'django.contrib.sessions.middleware.SessionMiddleware',
  79. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  80. )
  81. ROOT_URLCONF = 'danseku.urls'
  82. TEMPLATE_DIRS = (
  83. os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'),
  84. )
  85. TEMPLATE_CONTEXT_PROCESSORS = (
  86. 'django.core.context_processors.auth',
  87. 'django.core.context_processors.debug',
  88. 'django.core.context_processors.i18n',
  89. 'django.core.context_processors.media',
  90. 'django.core.context_processors.request',
  91. 'danseku.context_processors.get_mainmenu',
  92. 'danseku.context_processors.generic_settings',
  93. )
  94. INSTALLED_APPS = (
  95. 'django.contrib.auth',
  96. 'django.contrib.contenttypes',
  97. 'django.contrib.sessions',
  98. 'django.contrib.sites',
  99. 'django.contrib.admin',
  100. 'django.contrib.comments',
  101. 'django.contrib.markup',
  102. 'danseku.resources',
  103. 'danseku.user_profile',
  104. 'danseku.news',
  105. 'danseku.core',
  106. )