Skip to content

Commit da85339

Browse files
author
deepin
committed
CRM&Website初始版
1 parent aa78473 commit da85339

File tree

558 files changed

+80755
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+80755
-133
lines changed

DoSites/__init__.py

Whitespace-only changes.

DoSites/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for DoSites project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DoSites.settings')
15+
16+
application = get_asgi_application()

DoSites/settings.py

+232
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
"""
2+
Django settings for DoSites project.
3+
4+
Generated by 'django-admin startproject' using Django 4.0.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/4.0/ref/settings/
11+
"""
12+
import os.path
13+
from pathlib import Path
14+
import time
15+
16+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
17+
BASE_DIR = Path(__file__).resolve().parent.parent
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'django-insecure-#^sp!k4c7g^xy-%or23j#=q++4p)ucfgz=p43!c1g=s&agzg6q'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
# Application definition
31+
32+
INSTALLED_APPS = [
33+
# simpleui样式的后台页面
34+
'simpleui',
35+
36+
'django.contrib.admin',
37+
'django.contrib.auth',
38+
'django.contrib.contenttypes',
39+
'django.contrib.sessions',
40+
'django.contrib.messages',
41+
'django.contrib.staticfiles',
42+
43+
# 门户网站的app模块
44+
'home', # 首页
45+
'about', # 简介
46+
'contact', # 欢迎咨询
47+
'news', # 新闻动态
48+
'products', # 产品中心
49+
'service', # 服务支持
50+
'science', # 科研基地
51+
52+
# CRM系统的app模块
53+
'institution', # 机构管理
54+
'customer', # 客户管理
55+
'speaker', # 讲者管理
56+
'jurisdiction', # 辖区管理
57+
'supplier', # 供应商管理
58+
'meeting', # 会议管理
59+
'approve', # 审批中心
60+
'system', # 系统管理
61+
'forms', # 报表中心
62+
63+
# 其他插件
64+
'DjangoUeditor', # 富文本编辑器
65+
'widget_tweaks', # 添加模型表单定制化渲染
66+
]
67+
68+
MIDDLEWARE = [
69+
'django.middleware.security.SecurityMiddleware',
70+
'django.contrib.sessions.middleware.SessionMiddleware',
71+
'django.middleware.common.CommonMiddleware',
72+
'django.middleware.csrf.CsrfViewMiddleware',
73+
'django.contrib.auth.middleware.AuthenticationMiddleware',
74+
'django.contrib.messages.middleware.MessageMiddleware',
75+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
76+
]
77+
78+
ROOT_URLCONF = 'DoSites.urls'
79+
80+
TEMPLATES = [
81+
{
82+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
83+
'DIRS': [os.path.join(BASE_DIR, 'templates')], # 对于用了templates的,这个一定要设置,不然会报错TemplateDoesNotExist
84+
'APP_DIRS': True,
85+
'OPTIONS': {
86+
'context_processors': [
87+
'django.template.context_processors.debug',
88+
'django.template.context_processors.request',
89+
'django.contrib.auth.context_processors.auth',
90+
'django.contrib.messages.context_processors.messages',
91+
],
92+
},
93+
},
94+
]
95+
96+
WSGI_APPLICATION = 'DoSites.wsgi.application'
97+
98+
# Database
99+
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
100+
101+
DATABASES = {
102+
'default': {
103+
'ENGINE': 'django.db.backends.mysql',
104+
'NAME': 'dy_sites_dev',
105+
'HOST': 'localhost',
106+
'POST': '3306',
107+
'USER': 'root',
108+
'PASSWORD': 'Imaioscoder123.'
109+
}
110+
}
111+
112+
# Password validation
113+
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
114+
115+
AUTH_PASSWORD_VALIDATORS = [
116+
{
117+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
118+
},
119+
{
120+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
121+
},
122+
{
123+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
124+
},
125+
{
126+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
127+
},
128+
]
129+
130+
# Internationalization
131+
# https://docs.djangoproject.com/en/4.0/topics/i18n/
132+
133+
LANGUAGE_CODE = 'zh-Hans'
134+
135+
TIME_ZONE = 'Asia/Shanghai'
136+
137+
USE_I18N = True
138+
139+
USE_TZ = True
140+
141+
# Static files (CSS, JavaScript, Images)
142+
# https://docs.djangoproject.com/en/4.0/howto/static-files/
143+
144+
STATIC_URL = 'static/'
145+
STATICFILES_DIRS = (
146+
os.path.join(BASE_DIR, "static"),
147+
)
148+
# STATIC_ROOT = os.path.join(BASE_DIR, 'static') # 如果克隆报错提示找不到静态目录,请先在settings.py指定静态目录, clone成功后,注释掉,因为以上面STATICFILES_DIRS冲突,导致css不起效,影响显示
149+
150+
# Default primary key field type
151+
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
152+
153+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
154+
155+
# 对图片的路径进行存储
156+
MEDIA_URL = 'media/'
157+
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
158+
159+
# 指定simpleui默认的主题,指定一个文件名,相对路径就从simpleui的theme目录读取
160+
SIMPLEUI_DEFAULT_THEME = 'Green.css'
161+
SIMPLEUI_DEFAULT_ICON = False
162+
SIMPLEUI_LOGO = 'https://avatars2.githubusercontent.com/u/13655483?s=60&v=4'
163+
SIMPLEUI_HOME_INFO = False
164+
SIMPLEUI_HOME_QUICK = False
165+
SIMPLEUI_HOME_ACTION = False
166+
SIMPLEUI_ANALYSIS = False
167+
SIMPLEUI_LOGIN_PARTICLES = False
168+
SIMPLEUI_ICON = {
169+
'公司简介': 'fas fa-building',
170+
'荣誉资质': 'fas fa-trophy',
171+
'新闻动态': 'fas fa-newspaper',
172+
'人才招聘': 'fas fa-place-of-worship',
173+
'招聘信息': 'fab fa-ubuntu',
174+
'简历信息': 'fas fa-file',
175+
'联系我们': 'fas fa-network-wired',
176+
'产品中心': 'fab fa-product-hunt',
177+
'产品列表': 'fas fa-list-ol',
178+
'服务支持': 'fab fa-servicestack',
179+
'文件资料': 'far fa-folder-open',
180+
}
181+
SIMPLEUI_CONFIG = {
182+
'system_keep': True,
183+
# 'menu_display': ['Simpleui', '测试', '权限认证', '动态菜单测试'], # 开启排序和过滤功能, 不填此字段为默认排序和全部显示, 空列表[] 为全部不显示.
184+
'dynamic': True, # 设置是否开启动态菜单, 默认为False. 如果开启, 则会在每次用户登陆时动态展示菜单内容
185+
'menus': [{
186+
'name': 'Simpleui',
187+
'icon': 'fas fa-code',
188+
'url': 'https://gitee.com/tompeppa/simpleui'
189+
}, {
190+
'app': 'auth',
191+
'name': '权限认证',
192+
'icon': 'fas fa-user-shield',
193+
'models': [{
194+
'name': '用户',
195+
'icon': 'fa fa-user',
196+
'url': 'auth/user/'
197+
}]
198+
}, {
199+
# 自2021.02.01+ 支持多级菜单,models 为子菜单名
200+
'name': '多级菜单测试',
201+
'icon': 'fa fa-file',
202+
# 二级菜单
203+
'models': [{
204+
'name': 'Baidu',
205+
'icon': 'far fa-surprise',
206+
# 第三级菜单 ,
207+
'models': [
208+
{
209+
'name': '爱奇艺',
210+
'url': 'https://www.iqiyi.com/dianshiju/'
211+
# 第四级就不支持了,element只支持了3级
212+
}, {
213+
'name': '百度问答',
214+
'icon': 'far fa-surprise',
215+
'url': 'https://zhidao.baidu.com/'
216+
}
217+
]
218+
}, {
219+
'name': '内网穿透',
220+
'url': 'https://www.wezoz.com',
221+
'icon': 'fab fa-github'
222+
}]
223+
}, {
224+
'name': '动态菜单测试' ,
225+
'icon': 'fa fa-desktop',
226+
'models': [{
227+
'name': time.time(),
228+
'url': 'http://baidu.com',
229+
'icon': 'far fa-surprise'
230+
}]
231+
}]
232+
}

DoSites/urls.py

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""DoSites URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/4.0/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
from django.contrib import admin
17+
from django.urls import path, include
18+
from home import views
19+
from django.views.static import serve
20+
from DoSites import settings
21+
22+
urlpatterns = [
23+
path('admin/', admin.site.urls),
24+
path('', views.home, name='home'),
25+
path('about/', include('about.urls')), # 公司简介
26+
path('news/', include('news.urls')), # 新闻动态
27+
path('products/', include('products.urls')), # 产品中心
28+
path('service/', include('service.urls')), # 服务支持
29+
path('science/', include('science.urls')), # 科研基地
30+
path('contact/', include('contact.urls')), # 人才招聘
31+
# path('ueditor/', include('DjangoUeditor.urls')), # 编辑
32+
# path('search/', include('haystack.urls')), # 添加haystack搜索的路径
33+
]
34+
35+
36+
# urlpatterns = [
37+
# path('admin/', admin.site.urls),
38+
# path('', views.home, name='home'),
39+
# path('science/', include('science.urls')),
40+
# path('about/', include('about.urls')), # , namespace='about'
41+
# ] + serve(r'^/(?P<path>.*)$', settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

DoSites/wsgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for DoSites project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DoSites.settings')
15+
16+
application = get_wsgi_application()

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# DoPython
2-
python learning collections
1+
# DoPy

about/__init__.py

Whitespace-only changes.

about/admin.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from django.contrib import admin
2+
from about.models import Award
3+
4+
5+
class AwardAdmin(admin.ModelAdmin):
6+
list_display = ('id', 'description', 'photo')
7+
fields = ('description', 'photo')
8+
9+
10+
admin.site.register(Award, AwardAdmin)
11+
admin.site.site_header = '苍玄天管理'
12+
admin.site.site_title = '苍玄天_管理系统'
13+
admin.site.index_title = '苍玄天_索引'

about/apps.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AboutConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'about'
7+
verbose_name = '公司简介'

about/migrations/0001_initial.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.0 on 2021-12-28 03:14
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Award',
16+
fields=[
17+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('description', models.TextField(blank=True, max_length=500, null=True)),
19+
('photo', models.ImageField(blank=True, upload_to='Award/')),
20+
],
21+
options={
22+
'verbose_name': '荣誉资质',
23+
'verbose_name_plural': '荣誉资质',
24+
'db_table': 'Award',
25+
},
26+
),
27+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.0 on 2021-12-28 06:03
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('about', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='award',
15+
name='photo',
16+
field=models.ImageField(blank=True, upload_to='award/'),
17+
),
18+
migrations.AlterModelTable(
19+
name='award',
20+
table='do_award',
21+
),
22+
]

0 commit comments

Comments
 (0)