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.

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