settings.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. )
  31. MIDDLEWARE_CLASSES = (
  32. 'django.contrib.sessions.middleware.SessionMiddleware',
  33. 'django.middleware.common.CommonMiddleware',
  34. 'django.middleware.csrf.CsrfViewMiddleware',
  35. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  36. 'django.contrib.messages.middleware.MessageMiddleware',
  37. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  38. )
  39. ROOT_URLCONF = 'swyzxwb_photovote.urls'
  40. WSGI_APPLICATION = 'swyzxwb_photovote.wsgi.application'
  41. # Database
  42. # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
  43. DATABASES = {
  44. 'default': {
  45. 'ENGINE': 'django.db.backends.mysql',
  46. 'NAME': 'xwbphotovote',
  47. 'USER': 'swzry',
  48. 'PASSWORD': 'ZPCZRY789987/.,',
  49. 'HOST': '127.0.0.1',
  50. 'PORT': '3306',
  51. }
  52. }
  53. # Internationalization
  54. # https://docs.djangoproject.com/en/1.6/topics/i18n/
  55. LANGUAGE_CODE = 'zh-hans'
  56. TIME_ZONE = 'Asia/Shanghai'
  57. USE_I18N = False
  58. USE_L10N = False
  59. USE_TZ = False
  60. AUTH_USER_MODEL = 'UserManage.User'
  61. # Static files (CSS, JavaScript, Images)
  62. # https://docs.djangoproject.com/en/1.6/howto/static-files/
  63. STATIC_URL = '/static/'
  64. STATICFILES_DIRS = (
  65. os.path.join(BASE_DIR,'static'),
  66. )
  67. MEDIA_ROOT = os.path.join(STATICFILES_DIRS[0],'uploads')
  68. MEDIA_URL = '/static/uploads/'
  69. PHOTO_SIZE_LIMIT = 307200
  70. PHOTO_SUFFIX_LIMIT = ['.jpg','.jpeg','.png','.gif','.bmp','.svg','.wmf']
  71. #set TEMPLATE_DIRS
  72. TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
  73. #TEMPLATE zh_CN
  74. FILE_CHARSET='utf-8'
  75. DEFAULT_CHARSET='utf-8'