/settings.py

https://bitbucket.org/bconstantin/django_polymorphic/ · Python · 97 lines · 50 code · 19 blank · 28 comment · 5 complexity · ef16f0a1f30cdacf05c4e136b63b5795 MD5 · raw file

  1. # Django settings for polymorphic_demo project.
  2. DEBUG = True
  3. TEMPLATE_DEBUG = DEBUG
  4. ADMINS = (
  5. # ('Your Name', 'your_email@domain.com'),
  6. )
  7. MANAGERS = ADMINS
  8. import django
  9. import os
  10. if os.path.ismount('/ram'):
  11. SQLITE_DB_PATH = '/ram/django-polymorphic-test-db.sqlite3'
  12. else:
  13. SQLITE_DB_PATH = '/var/tmp/django-polymorphic-test-db.sqlite3'
  14. if django.VERSION[:2][0]>=1 and django.VERSION[:2][1]>=3:
  15. DATABASES = {
  16. 'default': {
  17. 'ENGINE': 'django.db.backends.sqlite3',
  18. 'NAME': SQLITE_DB_PATH
  19. }
  20. }
  21. else:
  22. DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  23. DATABASE_NAME = SQLITE_DB_PATH # Or path to database file if using sqlite3.
  24. DATABASE_USER = '' # Not used with sqlite3.
  25. DATABASE_PASSWORD = '' # Not used with sqlite3.
  26. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
  27. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
  28. # Local time zone for this installation. Choices can be found here:
  29. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  30. # although not all choices may be available on all operating systems.
  31. # If running in a Windows environment this must be set to the same as your
  32. # system time zone.
  33. TIME_ZONE = 'America/Chicago'
  34. # Language code for this installation. All choices can be found here:
  35. # http://www.i18nguy.com/unicode/language-identifiers.html
  36. LANGUAGE_CODE = 'en-us'
  37. SITE_ID = 1
  38. # If you set this to False, Django will make some optimizations so as not
  39. # to load the internationalization machinery.
  40. USE_I18N = True
  41. # Absolute path to the directory that holds media.
  42. # Example: "/home/media/media.lawrence.com/"
  43. MEDIA_ROOT = ''
  44. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  45. # trailing slash if there is a path component (optional in other cases).
  46. # Examples: "http://media.lawrence.com", "http://example.com/media/"
  47. MEDIA_URL = ''
  48. # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  49. # trailing slash.
  50. # Examples: "http://foo.com/media/", "/media/".
  51. ADMIN_MEDIA_PREFIX = '/media/'
  52. # Make this unique, and don't share it with anybody.
  53. SECRET_KEY = 'nk=c&k+c&#+)8557)%&0auysdd3g^sfq6@rw8_x1k8)-p@y)!('
  54. # List of callables that know how to import templates from various sources.
  55. TEMPLATE_LOADERS = (
  56. 'django.template.loaders.filesystem.load_template_source',
  57. 'django.template.loaders.app_directories.load_template_source',
  58. # 'django.template.loaders.eggs.load_template_source',
  59. )
  60. MIDDLEWARE_CLASSES = (
  61. 'django.middleware.common.CommonMiddleware',
  62. 'django.contrib.sessions.middleware.SessionMiddleware',
  63. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  64. )
  65. ROOT_URLCONF = ''
  66. TEMPLATE_DIRS = (
  67. # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  68. # Always use forward slashes, even on Windows.
  69. # Don't forget to use absolute paths, not relative paths.
  70. )
  71. INSTALLED_APPS = (
  72. #'django.contrib.auth',
  73. 'django.contrib.contenttypes',
  74. #'django.contrib.sessions',
  75. #'django.contrib.sites',
  76. 'polymorphic', # only needed if you want to use polymorphic_dumpdata
  77. 'pexp', # this Django app is for testing and experimentation; not needed otherwise
  78. )