settings.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #coding:utf-8
  2. import os
  3. DEBUG = True
  4. TEMPLATE_DEBUG = DEBUG
  5. ADMINS = (
  6. # ('Your Name', 'your_email@example.com'),
  7. )
  8. MANAGERS = ADMINS
  9. #项目文件夹
  10. PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
  11. DATABASES = {
  12. 'default': {
  13. 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  14. 'NAME': PROJECT_PATH+'/test.db', # Or path to database file if using sqlite3.
  15. 'USER': '', # Not used with sqlite3.
  16. 'PASSWORD': '', # Not used with sqlite3.
  17. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
  18. 'PORT': '', # Set to empty string for default. Not used with sqlite3.
  19. }
  20. }
  21. # Local time zone for this installation. Choices can be found here:
  22. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  23. # although not all choices may be available on all operating systems.
  24. # On Unix systems, a value of None will cause Django to use the same
  25. # timezone as the operating system.
  26. # If running in a Windows environment this must be set to the same as your
  27. # system time zone.
  28. TIME_ZONE = 'Asia/Shanghai'
  29. # Language code for this installation. All choices can be found here:
  30. # http://www.i18nguy.com/unicode/language-identifiers.html
  31. LANGUAGE_CODE = 'zh-cn'
  32. SITE_ID = 1
  33. # If you set this to False, Django will make some optimizations so as not
  34. # to load the internationalization machinery.
  35. USE_I18N = True
  36. # If you set this to False, Django will not format dates, numbers and
  37. # calendars according to the current locale.
  38. USE_L10N = True
  39. # If you set this to False, Django will not use timezone-aware datetimes.
  40. USE_TZ = True
  41. # Absolute filesystem path to the directory that will hold user-uploaded files.
  42. # Example: "/home/media/media.lawrence.com/media/"
  43. MEDIA_ROOT = os.path.join(PROJECT_PATH,'data/').replace('\\','/')
  44. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  45. # trailing slash.
  46. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  47. MEDIA_URL = '/media/'
  48. # Absolute path to the directory static files should be collected to.
  49. # Don't put anything in this directory yourself; store your static files
  50. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  51. # Example: "/home/media/media.lawrence.com/static/"
  52. STATIC_ROOT =os.path.join(PROJECT_PATH,'www/').replace('\\','/')
  53. # URL prefix for static files.
  54. # Example: "http://media.lawrence.com/static/"
  55. STATIC_URL = '/static/'
  56. # Additional locations of static files
  57. STATICFILES_DIRS = (
  58. # Put strings here, like "/home/html/static" or "C:/www/django/static".
  59. # Always use forward slashes, even on Windows.
  60. # Don't forget to use absolute paths, not relative paths.
  61. )
  62. # List of finder classes that know how to find static files in
  63. # various locations.
  64. STATICFILES_FINDERS = (
  65. 'django.contrib.staticfiles.finders.FileSystemFinder',
  66. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  67. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  68. )
  69. # Make this unique, and don't share it with anybody.
  70. SECRET_KEY = '3x@74z(@w2io4=w3-8f0k3g7mo!2fw4^=(^diih$yx*zxjqrs8'
  71. # List of callables that know how to import templates from various sources.
  72. TEMPLATE_LOADERS = (
  73. 'django.template.loaders.filesystem.Loader',
  74. 'django.template.loaders.app_directories.Loader',
  75. # 'django.template.loaders.eggs.Loader',
  76. )
  77. MIDDLEWARE_CLASSES = (
  78. 'django.middleware.common.CommonMiddleware',
  79. 'django.contrib.sessions.middleware.SessionMiddleware',
  80. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  81. 'django.contrib.messages.middleware.MessageMiddleware',
  82. # Uncomment the next line for simple clickjacking protection:
  83. # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  84. )
  85. ROOT_URLCONF = 'DUSite.urls'
  86. # Python dotted path to the WSGI application used by Django's runserver.
  87. WSGI_APPLICATION = 'DUSite.wsgi.application'
  88. TEMPLATE_DIRS = (os.path.join(PROJECT_PATH,'templates/'),)
  89. INSTALLED_APPS = (
  90. 'django.contrib.auth',
  91. 'django.contrib.contenttypes',
  92. 'django.contrib.sessions',
  93. 'django.contrib.sites',
  94. 'django.contrib.messages',
  95. 'django.contrib.staticfiles',
  96. # Uncomment the next line to enable the admin:
  97. 'django.contrib.admin',
  98. # Uncomment the next line to enable admin documentation:
  99. # 'django.contrib.admindocs',
  100. 'DjangoUeditor',
  101. "TestApp",
  102. )
  103. # A sample logging configuration. The only tangible logging
  104. # performed by this configuration is to send an email to
  105. # the site admins on every HTTP 500 error when DEBUG=False.
  106. # See http://docs.djangoproject.com/en/dev/topics/logging for
  107. # more details on how to customize your logging configuration.
  108. LOGGING = {
  109. 'version': 1,
  110. 'disable_existing_loggers': False,
  111. 'filters': {
  112. 'require_debug_false': {
  113. '()': 'django.utils.log.RequireDebugFalse'
  114. }
  115. },
  116. 'handlers': {
  117. 'mail_admins': {
  118. 'level': 'ERROR',
  119. 'filters': ['require_debug_false'],
  120. 'class': 'django.utils.log.AdminEmailHandler'
  121. }
  122. },
  123. 'loggers': {
  124. 'django.request': {
  125. 'handlers': ['mail_admins'],
  126. 'level': 'ERROR',
  127. 'propagate': True,
  128. },
  129. }
  130. }
  131. UEDITOR_SETTINGS = {
  132. 'toolbars':{"testa":[['fullscreen', 'source', '|', 'undo', 'redo', '|','bold', 'italic', 'underline']],
  133. "testb":[[ 'source', '|','bold', 'italic', 'underline']]
  134. },
  135. 'images_upload':{
  136. 'max_size':0
  137. }
  138. }