123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- """
- Django settings for meib project.
- Generated by 'django-admin startproject' using Django 1.11.11.
- For more information on this file, see
- https://docs.djangoproject.com/en/1.11/topics/settings/
- For the full list of settings and their values, see
- https://docs.djangoproject.com/en/1.11/ref/settings/
- """
- import os
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- SECRET_KEY = '=&u2a!cp6*4i=$140mw^m_+2%ko82r+o*camh&=12mg2s+m%y0'
- DEBUG = True
- ALLOWED_HOSTS = ['*']
- import sys
- sys.path.insert(1,os.path.join(BASE_DIR,'apps'))
- sys.path.insert(0,os.path.join(BASE_DIR,'apps'))
- sys.path.insert(1,BASE_DIR)
- print(sys.path)
- INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'erp.apps.ErpConfig',
- 'users.apps.UsersConfig',
- 'tx.apps.TxConfig',
- ]
- MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.common.CommonMiddleware',
-
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
-
- ]
- ROOT_URLCONF = 'meib.urls'
- TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR,'templates')],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
- },
- ]
- WSGI_APPLICATION = 'meib.wsgi.application'
- DATABASES = {
- 'default': {
- 'ENGINE': 'sql_server.pyodbc',
- 'NAME': 'DB_18MB',
- 'USER': 'sa',
- 'PASSWORD': '123456',
- 'HOST': '127.0.0.1',
- 'PORT': '1433',
- 'OPTIONS': {
- 'driver': 'SQL Server Native Client 10.0',
- },
- },
- }
- DATABASE_CONNECTION_POOLING = True
- AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
- ]
- LANGUAGE_CODE = 'en-us'
- TIME_ZONE = 'UTC'
- USE_I18N = True
- USE_L10N = True
- USE_TZ = True
- STATIC_URL = '/static/'
- STATICFILES_DIRS = [os.path.join(BASE_DIR,'static')]
- LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'verbose': {
- 'format': '%(levelname)s %(asctime)s %(module)s %(lineno)d %(message)s'
- },
- 'simple': {
- 'format': '%(levelname)s %(module)s %(lineno)d %(message)s'
- },
- },
- 'filters': {
- 'require_debug_true': {
- '()': 'django.utils.log.RequireDebugTrue',
- },
- },
- 'handlers': {
- 'console': {
- 'level': 'INFO',
- 'filters': ['require_debug_true'],
- 'class': 'logging.StreamHandler',
- 'formatter': 'simple'
- },
- 'file': {
- 'level': 'INFO',
- 'class': 'logging.handlers.RotatingFileHandler',
- 'filename': os.path.join(os.path.dirname(BASE_DIR), 'logs/hwj.log'),
- 'maxBytes': 100 * 1024 * 1024,
- 'backupCount': 10,
- 'formatter': 'verbose'
- },
- },
- 'loggers': {
- 'django': {
- 'handlers': ['console', 'file'],
- 'propagate': True,
- 'level': 'INFO',
- },
- }
- }
- STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
- PAGE_SIZE = 100
- PAGE_SIZE_IE = 100
- AUTH_USER_MODEL = 'users.User'
|