Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
8.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # Django settings for mumble_django project.
  3. """
  4. * Copyright © 2009-2010, Michael "Svedrin" Ziegler <diese-addy@funzt-halt.net>
  5. *
  6. * Mumble-Django is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This package is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. """
  16. #################################################################
  17. #################################################################
  18. ## ##
  19. ## The slice to use for communication over ZeroC Ice. ##
  20. ## This must be set to the path to the Murmur.ice file that ##
  21. ## resides in your Murmur directory. ##
  22. SLICE = '/usr/share/slice/Murmur.ice' ##
  23. ## ##
  24. #################################################################
  25. ## ##
  26. ## The path inside the VirtualHost that M-D lives in: ##
  27. ## ##
  28. MUMBLE_DJANGO_URL = '/' ##
  29. #MUMBLE_DJANGO_URL = '/mumble-django/' ##
  30. ## ##
  31. ## Make sure you use a trailing slash! ##
  32. ## ##
  33. #################################################################
  34. ## ##
  35. ## Mumble-Django will try to auto-detect this value if it ##
  36. ## isn't set, which is the default. However, if this should ##
  37. ## not work as expected, set this to the path where you ##
  38. ## extracted Mumble-Django. ##
  39. ## ##
  40. ## Default: Auto Detection ##
  41. MUMBLE_DJANGO_ROOT = None ##
  42. ## Examples: ##
  43. #MUMBLE_DJANGO_ROOT = '/srv/mumble-django' ##
  44. #MUMBLE_DJANGO_ROOT = 'c:/web/mumble-django' ##
  45. ## ##
  46. #################################################################
  47. ## ##
  48. ## For a basic installation, this is all you need to edit in ##
  49. ## this file, the rest will be handled automatically! ##
  50. ## ##
  51. #################################################################
  52. #################################################################
  53. from os.path import join, dirname, abspath, exists
  54. if not MUMBLE_DJANGO_ROOT or not exists( MUMBLE_DJANGO_ROOT ):
  55. MUMBLE_DJANGO_ROOT = dirname(dirname(abspath(__file__)));
  56. # The default connection string to set for newly created instances.
  57. # ICE:
  58. DEFAULT_CONN = 'Meta:tcp -h 127.0.0.1 -p 6502'
  59. # DBus:
  60. #DEFAULT_CONN = 'net.sourceforge.mumble.murmur'
  61. # Default email address to send mails from.
  62. DEFAULT_FROM_EMAIL = "webmaster@localhost"
  63. # Length of the account activation period, in days.
  64. ACCOUNT_ACTIVATION_DAYS = 30
  65. # Default mumble port. If your server runs under this port, it will not be included in the links in the Channel Viewer.
  66. MUMBLE_DEFAULT_PORT = 64738
  67. # Should subchannels be shown, even if there are no players in them?
  68. SHOW_EMPTY_SUBCHANS = False
  69. # Protect the registration form for private servers?
  70. # If set to True, people will need to enter the server password in order to create accounts,
  71. # and will not be able to link existing accounts.
  72. PROTECTED_MODE = False
  73. # Account linking allows users who registered their accounts through Mumble instead of using
  74. # Mumble-Django, to tell MD that this account belongs to them. Then they can use MD to change
  75. # their passwords.
  76. # This will of course require them to enter the password that belongs to the Murmur account,
  77. # and the accounts will only be linked if the password is correct.
  78. # By default, this is enabled only for non-admin accounts, because if an admin account gets
  79. # stolen they could easily take over the server. (So make sure the password can't be easily
  80. # guessed, use at least over 9000 letters, blah blah.)
  81. # This feature is only available if PROTECTED_MODE is not active.
  82. ALLOW_ACCOUNT_LINKING = True # Allow linking in general?
  83. ALLOW_ACCOUNT_LINKING_ADMINS = False # Allow linking for Admin accounts?
  84. # Database settings for Mumble-Django's database. These do NOT need to point to Murmur's database,
  85. # Mumble-Django should use its own!
  86. DATABASE_ENGINE = 'sqlite3'
  87. DATABASE_NAME = join( MUMBLE_DJANGO_ROOT, 'mumble-django.db3' )
  88. DATABASE_USER = ''
  89. DATABASE_PASSWORD = ''
  90. DATABASE_HOST = ''
  91. DATABASE_PORT = ''
  92. # Show debug information on errors?
  93. DEBUG = True
  94. TEMPLATE_DEBUG = DEBUG
  95. ADMINS = (
  96. # ('Your Name', 'your_email@domain.com'),
  97. )
  98. MANAGERS = ADMINS
  99. # Local time zone for this installation. Choices can be found here:
  100. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  101. # although not all choices may be available on all operating systems.
  102. # If running in a Windows environment this must be set to the same as your
  103. # system time zone.
  104. TIME_ZONE = 'Europe/Berlin'
  105. # Language code for this installation. All choices can be found here:
  106. # http://www.i18nguy.com/unicode/language-identifiers.html
  107. LANGUAGE_CODE = 'en-us'
  108. SITE_ID = 1
  109. # If you set this to False, Django will make some optimizations so as not
  110. # to load the internationalization machinery.
  111. USE_I18N = True
  112. # Absolute path to the directory that holds media.
  113. MEDIA_ROOT = join( MUMBLE_DJANGO_ROOT, 'htdocs' )
  114. # URL that handles the media served from MEDIA_ROOT.
  115. MEDIA_URL = MUMBLE_DJANGO_URL+'static/'
  116. # URL prefix for admin media -- CSS, JavaScript and images.
  117. ADMIN_MEDIA_PREFIX = MUMBLE_DJANGO_URL+'media/'
  118. # URL to the login view
  119. LOGIN_URL = MUMBLE_DJANGO_URL + 'accounts/login';
  120. LOGIN_REDIRECT_URL = MUMBLE_DJANGO_URL + 'accounts/profile';
  121. # Make this unique, and don't share it with anybody.
  122. SECRET_KEY = 'u-mp185msk#z4%s(do2^5405)y5d!9adbn92)apu_p^qvqh10v'
  123. # List of callables that know how to import templates from various sources.
  124. TEMPLATE_LOADERS = (
  125. 'django.template.loaders.filesystem.load_template_source',
  126. 'django.template.loaders.app_directories.load_template_source',
  127. )
  128. MIDDLEWARE_CLASSES = (
  129. 'django.middleware.common.CommonMiddleware',
  130. 'django.contrib.sessions.middleware.SessionMiddleware',
  131. 'django.middleware.locale.LocaleMiddleware',
  132. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  133. )
  134. ROOT_URLCONF = 'pyweb.urls'
  135. TEMPLATE_DIRS = (
  136. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  137. # Always use forward slashes, even on Windows.
  138. # Don't forget to use absolute paths, not relative paths.
  139. join( MUMBLE_DJANGO_ROOT, 'pyweb', 'templates' ),
  140. )
  141. TEMPLATE_CONTEXT_PROCESSORS = (
  142. "django.core.context_processors.auth",
  143. "django.core.context_processors.debug",
  144. "django.core.context_processors.i18n",
  145. "django.core.context_processors.media",
  146. 'processors.installed_apps',
  147. )
  148. TEST_RUNNER = 'mumble.testrunner.run_tests'
  149. TEST_MURMUR_LAB_DIR = join( dirname(MUMBLE_DJANGO_ROOT), 'murmur' );
  150. TEST_MURMUR_FILES_DIR = join( MUMBLE_DJANGO_ROOT, 'testdata' );
  151. INSTALLED_APPS = (
  152. 'django.contrib.auth',
  153. 'django.contrib.admin',
  154. 'django.contrib.contenttypes',
  155. 'django.contrib.sessions',
  156. 'django.contrib.sites',
  157. 'registration',
  158. 'mumble',
  159. )
  160. def modprobe( name ):
  161. """ Try to import the named module, and if that works add it to INSTALLED_APPS. """
  162. global INSTALLED_APPS
  163. try:
  164. __import__( name )
  165. except ImportError:
  166. pass
  167. else:
  168. INSTALLED_APPS += ( name, )
  169. # Check if rosetta is available.
  170. # http://code.google.com/p/django-rosetta
  171. modprobe( "rosetta" )
  172. # Check if django_extensions is available.
  173. modprobe( "django_extensions" )