settings.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. """
  2. Django settings for swyzxwb_photovote project.
  3. For more information on this file, see
  4. https://docs.djangoproject.com/en/1.6/topics/settings/
  5. For the full list of settings and their values, see
  6. https://docs.djangoproject.com/en/1.6/ref/settings/
  7. """
  8. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  9. import os
  10. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  11. # Quick-start development settings - unsuitable for production
  12. # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
  13. # SECURITY WARNING: keep the secret key used in production secret!
  14. SECRET_KEY = '3er162(x&!cye3vmul-ynw+9+!353@lz0e7n-5gmixm5=n)man'
  15. # SECURITY WARNING: don't run with debug turned on in production!
  16. DEBUG = True
  17. TEMPLATE_DEBUG = True
  18. ALLOWED_HOSTS = []
  19. # Application definition
  20. INSTALLED_APPS = (
  21. #'django.contrib.admin',
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. 'django.contrib.staticfiles',
  27. 'south',
  28. 'bootstrap3',
  29. 'UserManage',
  30. 'vote',
  31. )
  32. MIDDLEWARE_CLASSES = (
  33. 'django.contrib.sessions.middleware.SessionMiddleware',
  34. 'django.middleware.common.CommonMiddleware',
  35. 'django.middleware.csrf.CsrfViewMiddleware',
  36. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  37. 'django.contrib.messages.middleware.MessageMiddleware',
  38. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  39. )
  40. ROOT_URLCONF = 'swyzxwb_photovote.urls'
  41. WSGI_APPLICATION = 'swyzxwb_photovote.wsgi.application'
  42. # Database
  43. # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
  44. DATABASES = {
  45. 'default': {
  46. 'ENGINE': 'django.db.backends.mysql',
  47. 'NAME': 'xwbphotovote',
  48. 'USER': 'swyzxwb',
  49. 'PASSWORD': 'swyzxwb-Photo666~',
  50. 'HOST': '127.0.0.1',
  51. 'PORT': '3306',
  52. }
  53. }
  54. # Internationalization
  55. # https://docs.djangoproject.com/en/1.6/topics/i18n/
  56. LANGUAGE_CODE = 'zh-hans'
  57. TIME_ZONE = 'Asia/Shanghai'
  58. USE_I18N = False
  59. USE_L10N = False
  60. USE_TZ = False
  61. AUTH_USER_MODEL = 'UserManage.User'
  62. # Static files (CSS, JavaScript, Images)
  63. # https://docs.djangoproject.com/en/1.6/howto/static-files/
  64. STATIC_URL = '/static/'
  65. STATICFILES_DIRS = (
  66. os.path.join(BASE_DIR,'static'),
  67. )
  68. PHOTO_DIR_URL = 'http://swzry-file.zry.iego.net/swyzxwb/photovote/001/'
  69. THUMB_ARGS = '?imageView2/1/w/300/h/300'
  70. MEDIA_ROOT = os.path.join(STATICFILES_DIRS[0],'uploads')
  71. MEDIA_URL = '/static/uploads/'
  72. PHOTO_SIZE_LIMIT = 307200
  73. PHOTO_SUFFIX_LIMIT = ['.jpg','.jpeg','.png','.gif','.bmp','.svg','.wmf']
  74. #set TEMPLATE_DIRS
  75. TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
  76. #TEMPLATE zh_CN
  77. FILE_CHARSET='utf-8'
  78. DEFAULT_CHARSET='utf-8'