Django项目:CRM(客户关系管理系统)--06--03PerfectCRM创建基本数据01
os.path.join(BASE_DIR, 'DBadd/DBadd_templates'),
1 """ 2 Django settings for PerfectCRM project. 3 4 Generated by 'django-admin startproject' using Django 2.0.3. 5 6 For more information on this file, see 7 https://docs.djangoproject.com/en/2.0/topics/settings/ 8 9 For the full list of settings and their values, see 10 https://docs.djangoproject.com/en/2.0/ref/settings/ 11 """ 12 13 import os 14 15 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 18 19 # Quick-start development settings - unsuitable for production 20 # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ 21 22 # SECURITY WARNING: keep the secret key used in production secret! 23 SECRET_KEY = 'atkhzsd7emv4_okn@ynhji)p)qbpuvhq+a7@yx5=chaa0$l_br' 24 25 # SECURITY WARNING: don't run with debug turned on in production! 26 DEBUG = True 27 28 ALLOWED_HOSTS = [] 29 30 31 # Application definition 32 33 INSTALLED_APPS = [ 34 'django.contrib.admin', 35 'django.contrib.auth', 36 'django.contrib.contenttypes', 37 'django.contrib.sessions', 38 'django.contrib.messages', 39 'django.contrib.staticfiles', 40 'crm.apps.CrmConfig', 41 'king_admin', 42 ] 43 44 MIDDLEWARE = [ 45 'django.middleware.security.SecurityMiddleware', 46 'django.contrib.sessions.middleware.SessionMiddleware', 47 'django.middleware.common.CommonMiddleware', 48 'django.middleware.csrf.CsrfViewMiddleware', 49 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 'django.contrib.messages.middleware.MessageMiddleware', 51 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 ] 53 54 ROOT_URLCONF = 'PerfectCRM.urls' 55 56 TEMPLATES = [ 57 { 58 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 60 # 'DIRS': [os.path.join(BASE_DIR, 'templates')] 61 # , 62 63 'DIRS': [os.path.join(BASE_DIR, 'templates'), 64 os.path.join(BASE_DIR, 'king_admin/king_templates'), 65 os.path.join(BASE_DIR, 'DBadd/DBadd_templates'), ] 66 67 , 68 69 'APP_DIRS': True, 70 'OPTIONS': { 71 'context_processors': [ 72 'django.template.context_processors.debug', 73 'django.template.context_processors.request', 74 'django.contrib.auth.context_processors.auth', 75 'django.contrib.messages.context_processors.messages', 76 ], 77 }, 78 }, 79 ] 80 81 WSGI_APPLICATION = 'PerfectCRM.wsgi.application' 82 83 84 # Database 85 # https://docs.djangoproject.com/en/2.0/ref/settings/#databases 86 87 DATABASES = { 88 'default': { 89 'ENGINE': 'django.db.backends.sqlite3', 90 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 91 } 92 } 93 94 95 # Password validation 96 # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators 97 98 AUTH_PASSWORD_VALIDATORS = [ 99 { 100 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 101 }, 102 { 103 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 104 }, 105 { 106 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 107 }, 108 { 109 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 110 }, 111 ] 112 113 114 # Internationalization 115 # https://docs.djangoproject.com/en/2.0/topics/i18n/ 116 117 #LANGUAGE_CODE = 'en-us' 118 119 #英文转中文方法 120 LANGUAGE_CODE = 'zh-Hans' 121 122 TIME_ZONE = 'UTC' 123 124 USE_I18N = True 125 126 USE_L10N = True 127 128 USE_TZ = True 129 130 131 # Static files (CSS, JavaScript, Images) 132 # https://docs.djangoproject.com/en/2.0/howto/static-files/ 133 134 STATIC_URL = '/static/' 135 136 STATICFILES_DIRS = [os.path.join(BASE_DIR,'king_admin/static'),]
url(r'^DBadd/', include("DBadd.DBadd_urls")), # 添加随机数据
1 from django.contrib import admin 2 from django.urls import path 3 4 from django.conf.urls import url # URL 5 from django.conf.urls import include # 分发URL 6 7 urlpatterns = [ 8 path('admin/', admin.site.urls), 9 url(r'^king_admin/', include("king_admin.king_urls")),#自定义admin 10 url(r'^DBadd/', include("DBadd.DBadd_urls")), # 添加随机数据 11 ]
您的资助是我最大的动力!
金额随意,欢迎来赏!
如果,您希望更容易地发现我的新博客,不妨点击一下绿色通道的
因为,我的写作热情也离不开您的肯定支持,感谢您的阅读,我是【颜言】!