utils f9ee4d9164 Initial 8 anos atrás .editorconfig f9ee4d9164 Initial 8 anos atrás .gitignore f9ee4d9164 Initial 8 anos atrás .isort.cfg f9ee4d9164 Initial 8 anos atrás check.sh f9ee4d9164 Initial 8 anos atrás isort.sh f9ee4d9164 Initial 8 anos atrás manage.py f9ee4d9164 Initial 8 anos atrás pep8.sh bb745d9ee8 Add ios11_test page 7 anos atrás requirements.txt 03823bcc2e Codes Insert & Generate 7 anos atrás course - Gogs: Go Git Service

兰海课程

settings.py 7.7KB

    # -*- coding: utf-8 -*- """ Django settings for course project. Generated by 'django-admin startproject' using Django 1.11.3. 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 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJ_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'b*_bo@vg6jv1!7lhfci-)7^155c+%83y69zgf6)@s^9=_32edi' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_uniapi', 'django_we', 'account', 'api', 'codes', 'courses', 'page', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', # 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'detect.middleware.UserAgentDetectionMiddleware', ] ROOT_URLCONF = 'course.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', ], 'loaders': [ ('django.template.loaders.cached.Loader', [ 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ]), ], }, }, ] WSGI_APPLICATION = 'course.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'course', 'USER': 'root', 'PASSWORD': '', 'CONN_MAX_AGE': 600, 'OPTIONS': { # Utf8mb4 for Emoji # # Nickname # # account.WechatInfo ==> nickname # ALTER TABLE account_wechatinfo MODIFY COLUMN nickname VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 'charset': 'utf8mb4', }, } } # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 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', }, ] # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ LANGUAGE_CODE = 'zh-Hans' TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATICFILES_DIRS = ( os.path.join(PROJ_DIR, 'static').replace('\\', '/'), ) STATIC_ROOT = os.path.join(BASE_DIR, 'collect_static').replace('\\', '/') STATIC_URL = '/static/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace('\\', '/') MEDIA_URL = '/media/' # File 设置 FILE_UPLOAD_MAX_MEMORY_SIZE = 104857600 # InMemoryUploadedFile 文件最大值,设置为 100 MB FILE_UPLOAD_PERMISSIONS = 0o644 # TemporaryUploadedFile 文件权限设置 # DOMAIN DOMAIN = 'http://a.com' # Redis 设置 REDIS = { 'default': { 'HOST': '127.0.0.1', 'PORT': 6379, 'USER': '', 'PASSWORD': '', 'db': 0, } } # 微信设置 WECHAT = { 'JSAPI': { 'token': '5201314', 'appID': '', 'appsecret': '', 'mchID': '', 'apiKey': '', 'mch_cert': '', 'mch_key': '', 'redpack': { } }, } # 微信唯一标识 # Choices: 'unionid' or 'openid' # # models.py # 'unique_identifier': self.unionid if settings.WECHAT_UNIQUE_IDENTIFICATION == 'unionid' else self.openid, # views.py # unique_identifier = request.POST.get(settings.WECHAT_UNIQUE_IDENTIFICATION, '') # profile = Profile.objects.get(**{settings.WECHAT_UNIQUE_IDENTIFICATION: unique_identifier}) WECHAT_UNIQUE_IDENTIFICATION = 'unionid' # Token 错误重授权设置 TOKEN_CHECK_KEY = 'user_id' WECHAT_OAUTH2_REDIRECT_ENTRY = '' WECHAT_OAUTH2_REDIRECT_URL = 'http://pai.ai/we/o?redirect_url=http://course.xfoto.com.cn/api/3rd/or' # 错误信息邮件设置 # Email address that error messages come from. SERVER_EMAIL = 'kimi@pai.ai' # The email backend to use. For possible shortcuts see django.core.mail. # The default is to use the SMTP backend. # Third-party backends can be specified by providing a Python path # to a module that defines an EmailBackend class. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # Host for sending email. EMAIL_HOST = 'smtp.exmail.qq.com' # Port for sending email. EMAIL_PORT = 25 # Optional SMTP authentication information for EMAIL_HOST. EMAIL_HOST_USER = 'kimi@pai.ai' EMAIL_HOST_PASSWORD = '<^_^>pwd<^_^>' EMAIL_USE_TLS = False EMAIL_USE_SSL = False EMAIL_SSL_CERTFILE = None EMAIL_SSL_KEYFILE = None EMAIL_TIMEOUT = None # Default email address to use for various automated correspondence from # the site managers. DEFAULT_FROM_EMAIL = 'Kimi <kimi@pai.ai>' # People who get code error notifications. # In the format [('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com')] ADMINS = [('Kimi', 'kimi@pai.ai')] # Not-necessarily-technical managers of the site. They get broken link # notifications and other various emails. MANAGERS = ADMINS # Subject-line prefix for email messages send with django.core.mail.mail_admins # or ...mail_managers. Make sure to include the trailing space. EMAIL_SUBJECT_PREFIX = u'[Course] ' # Admin Settings DISABLE_ACTION = False # iOS11 Video Test TENCENT_VIDEO_URL = '' COURSE_VIDEO_URL = '' try: from local_settings import * except ImportError: pass # 依赖 local_settings 中的配置 # 微信授权设置 WECHAT_OAUTH2_REDIRECT_URI = '{0}/we/oauth2?scope={{0}}redirect_url={{1}}'.format(DOMAIN) WECHAT_BASE_REDIRECT_URI = '{0}/we/base_redirect'.format(DOMAIN) WECHAT_USERINFO_REDIRECT_URI = '{0}/we/userinfo_redirect'.format(DOMAIN) WECHAT_DIRECT_BASE_REDIRECT_URI = '{0}/we/direct_base_redirect'.format(DOMAIN) WECHAT_DIRECT_USERINFO_REDIRECT_URI = '{0}/we/direct_userinfo_redirect'.format(DOMAIN) try: from func_settings import redis_connect REDIS_CACHE = redis_connect(REDIS.get('default', {})) except ImportError: REDIS_CACHE = None
course - Gogs: Go Git Service
chengzhenyu/ptp - Gogs: Go Git Service

4 Commits (ae64d3d0ebb5dc6024dbc44e06ccf04aec8c7c3d)

Autor SHA1 Mensagem Data
  chengzhenyu ae64d3d0eb 获取设备信息成功 6 anos atrás
  chengzhenyu 07110eeac0 替换调试界面 6 anos atrás
  chengzhenyu 7956b77167 包可见性调整 6 anos atrás
  chengzhenyu 3f1df99b82 init 6 anos atrás
course - Gogs: Go Git Service

兰海课程

course_info.html 4.8KB

    {% load staticfiles %} <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="format-detection" content="telephone=no,email=no,address=no"> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <title>课程详情</title> <link href="//res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css" rel="stylesheet" type="text/css" /> <link href="{% static 'page/css/weui.ext.css' %}?v=1" rel="stylesheet" type="text/css" /> <style> .container { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #efefef; } .video_wrapper, .video_select { width: 100%; background: #fff; margin-bottom: 10px; box-sizing: border-box; } .video_text, .video_select { padding: 15px; } .course_video_name, .video_select_text { font-size: 18px; font-weight: bold; color: #020001; padding-bottom: 10px; } .course_video_desc { font-size: 12px; color: #999; } .video_select_item { width: 100%; text-align: center; height: 40px; line-height: 40px; color: #020001; border: 1px solid #e1e1e1; border-radius: 5px; margin-bottom: 15px; } .video_selected { color: #ce8f8a !important; border: 1px solid #ce8f8a; } </style> </head> <body> <div class="container" > <div class="video_wrapper"> <video id="video" width="100%" height="100%" autoplay controls x-webkit-airplay="true" webkit-playsinline="" playsinline="true" preload="none" poster="" src="{{ video_default.course_video_url }}" data-cursrc="1"></video> <div class="video_text"> <div class="course_video_name">{{ video_default.course_video_name }}</div> <div class="course_video_desc">{{ video_default.course_video_desc }}</div> </div> </div> <div class="video_select"> <div class="video_select_text">选择视频</div> {% for video in videos %} <div id="video{{ forloop.counter }}" class="video_select_item {% ifequal forloop.counter 1 %}video_selected{% endifequal %}" data-src="{{ video.course_video_url }}">{{ video.course_video_type }}</div> {% endfor %} </div> </div> <script src="//cdn.bootcss.com/zepto/1.1.6/zepto.min.js"></script> <script src="//cdn.bootcss.com/video.js/6.2.8/video.min.js"></script> <script> $(function() { var video_count = {{ video_count }}; $('.video_select_item').click(function () { $this = $(this); $('.video_select_item').removeClass('video_selected'); $this.addClass('video_selected'); $('#video').attr('src', $this.attr('data-src')); }) $('#video')[0].onended = function() { var curscr = $(this).attr('data-cursrc'); if (curscr >= video_count) { return } var next_video = $('#video' + (parseInt(curscr) + 1)); $('#video').attr('src', next_video.attr('data-src')); $('.video_select_item').removeClass('video_selected'); next_video.addClass('video_selected'); }; }); </script> <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script type="text/javascript" src="{% static 'course/js/jswe-0.0.1.js' %}"></script> <script> V.initWxData({ imgUrl: 'http://pai.ai/static/pai2/img/paiai_96_96.png', link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://tamron.xfoto.com.cn/page/clerk', desc: '店员授权', title: '店员授权', timeLine: '' }, true); V.hideOptionMenu(); $('#scan').click(function () { V.scanQRCode({ needResult: 1 }); }); V.wxScanQRCodeSuccess = function (res) { $('#code').val(V.parseScanQRCodeResultStr(res.resultStr)); } </script> </body> </html>
course - Gogs: Go Git Service

兰海课程

Brightcells: e3871377b6 Change to use wechat_only of django_we 7 years ago
..
deploy.bak f9ee4d9164 Initial 8 years ago
static 4c41847160 course_position 8 years ago
__init__.py f9ee4d9164 Initial 8 years ago
basemodels.py f9ee4d9164 Initial 8 years ago
decorators.py e3871377b6 Change to use wechat_only of django_we 7 years ago
func_settings.py f9ee4d9164 Initial 8 years ago
local_settings_bak.py f9ee4d9164 Initial 8 years ago
oauth_settings.py f9ee4d9164 Initial 8 years ago
settings.py 03823bcc2e Codes Insert & Generate 7 years ago
urls.py f9ee4d9164 Initial 8 years ago
wsgi.py f9ee4d9164 Initial 8 years ago
course - Gogs: Go Git Service

兰海课程

Brightcells: f9ee4d9164 Initial 8 lat temu
..
course.ini f9ee4d9164 Initial 8 lat temu
course_nginx.conf f9ee4d9164 Initial 8 lat temu
course_supervisor.ini f9ee4d9164 Initial 8 lat temu
uwsgi_params f9ee4d9164 Initial 8 lat temu
Kodo/kodo - Gogs: Go Git Service

1 Commits (c3fb2e7bb6a5dc2fb25ec9b44fa93372e2a39ea5)

Author SHA1 Nachricht Datum
  Brightcells 7467a3e68a add api group_update/group_remove vor 9 Jahren