span rel="">
+django-json-response==1.1.5
+django-logit==1.0.6
+django-multidomain==1.1.4
+django-paginator2==1.0.3
+django-rlog==1.0.7
+django-shortuuidfield==0.1.3
+django-six==1.0.4
+djangorestframework==3.7.3
+furl==1.0.1
+hiredis==0.2.0
+isoweek==1.3.3
+jsonfield==2.0.2
+mock==2.0.0
+pysnippets==1.0.4
+pywe-miniapp==1.0.0
+pywe-oauth==1.0.5
+pywe-response==1.0.1
+qiniu==7.1.9
+redis==2.10.6
+redis-extensions==1.1.5
+requests==2.18.4
+rlog==0.3
+shortuuid==0.5.0
+uWSGI==2.0.15
+versions==0.10.0
@@ -0,0 +1,14 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+from djadmin import ExportExcelModelAdmin, ReadonlyModelAdmin |
|
| 4 |
+from django.contrib import admin |
|
| 5 |
+ |
|
| 6 |
+from tamron.models import TamronSliderInfo |
|
| 7 |
+ |
|
| 8 |
+ |
|
| 9 |
+class TamronSliderInfoAdmin(admin.ModelAdmin): |
|
| 10 |
+ list_display = ('fid', 'pic', 'url', 'px')
|
|
| 11 |
+ list_filter = ('fid', )
|
|
| 12 |
+ |
|
| 13 |
+ |
|
| 14 |
+admin.site.register(TamronSliderInfo, TamronSliderInfoAdmin) |
@@ -0,0 +1,8 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+from __future__ import unicode_literals |
|
| 3 |
+ |
|
| 4 |
+from django.apps import AppConfig |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+class TamronConfig(AppConfig): |
|
| 8 |
+ name = 'tamron' |
@@ -0,0 +1,28 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+from django.db import models |
|
| 4 |
+from django.utils.translation import ugettext_lazy as _ |
|
| 5 |
+from models_ext import upload_path |
|
| 6 |
+ |
|
| 7 |
+ |
|
| 8 |
+class TamronSliderInfo(models.Model): |
|
| 9 |
+ HOME = 1 |
|
| 10 |
+ PGIST = 2 |
|
| 11 |
+ |
|
| 12 |
+ SLIEDER_TYPE_TUPLE = ( |
|
| 13 |
+ (HOME, u'首页轮播图'), |
|
| 14 |
+ (PGIST, u'产品注册页轮播图'), |
|
| 15 |
+ ) |
|
| 16 |
+ |
|
| 17 |
+ fid = models.IntegerField(_(u'fid'), choices=SLIEDER_TYPE_TUPLE, default=HOME, help_text=u'轮播图类型') |
|
| 18 |
+ pic = models.FileField(_(u'pic'), upload_to=upload_path, blank=True, null=True, help_text=u'轮播图图片') |
|
| 19 |
+ url = models.CharField(_(u'url'), max_length=255, blank=True, null=True, help_text=u'轮播图链接') |
|
| 20 |
+ px = models.IntegerField(_(u'px'), default=1, help_text=u'???') |
|
| 21 |
+ |
|
| 22 |
+ class Meta: |
|
| 23 |
+ verbose_name = _(u'轮播图') |
|
| 24 |
+ verbose_name_plural = _(u'轮播图') |
|
| 25 |
+ db_table = 'shidu_banner' |
|
| 26 |
+ |
|
| 27 |
+ def __unicode__(self): |
|
| 28 |
+ return unicode(self.pk) |
@@ -0,0 +1,7 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+from __future__ import unicode_literals |
|
| 3 |
+ |
|
| 4 |
+from django.test import TestCase |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+# Create your tests here. |
@@ -0,0 +1,7 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+from __future__ import unicode_literals |
|
| 3 |
+ |
|
| 4 |
+from django.shortcuts import render |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+# Create your views here. |
@@ -0,0 +1,149 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+""" |
|
| 4 |
+Django settings for tamrondb project. |
|
| 5 |
+ |
|
| 6 |
+Generated by 'django-admin startproject' using Django 1.11.3. |
|
| 7 |
+ |
|
| 8 |
+For more information on this file, see |
|
| 9 |
+https://docs.djangoproject.com/en/1.11/topics/settings/ |
|
| 10 |
+ |
|
| 11 |
+For the full list of settings and their values, see |
|
| 12 |
+https://docs.djangoproject.com/en/1.11/ref/settings/ |
|
| 13 |
+""" |
|
| 14 |
+ |
|
| 15 |
+import os |
|
| 16 |
+ |
|
| 17 |
+ |
|
| 18 |
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
| 19 |
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
| 20 |
+PROJ_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) |
|
| 21 |
+ |
|
| 22 |
+ |
|
| 23 |
+# Quick-start development settings - unsuitable for production |
|
| 24 |
+# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ |
|
| 25 |
+ |
|
| 26 |
+# SECURITY WARNING: keep the secret key used in production secret! |
|
| 27 |
+SECRET_KEY = '70^&x-7y*t1^osbm8c4-oy3vje+2&ph$j)n&)_q)j%7r%-fjy)' |
|
| 28 |
+ |
|
| 29 |
+# SECURITY WARNING: don't run with debug turned on in production! |
|
| 30 |
+DEBUG = True |
|
| 31 |
+ |
|
| 32 |
+ALLOWED_HOSTS = [] |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+# Application definition |
|
| 36 |
+ |
|
| 37 |
+INSTALLED_APPS = [ |
|
| 38 |
+ 'django.contrib.admin', |
|
| 39 |
+ 'django.contrib.auth', |
|
| 40 |
+ 'django.contrib.contenttypes', |
|
| 41 |
+ 'django.contrib.sessions', |
|
| 42 |
+ 'django.contrib.messages', |
|
| 43 |
+ 'django.contrib.staticfiles', |
|
| 44 |
+ 'tamron', |
|
| 45 |
+] |
|
| 46 |
+ |
|
| 47 |
+MIDDLEWARE = [ |
|
| 48 |
+ 'django.middleware.security.SecurityMiddleware', |
|
| 49 |
+ 'django.contrib.sessions.middleware.SessionMiddleware', |
|
| 50 |
+ 'django.middleware.common.CommonMiddleware', |
|
| 51 |
+ 'django.middleware.csrf.CsrfViewMiddleware', |
|
| 52 |
+ 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
| 53 |
+ 'django.contrib.messages.middleware.MessageMiddleware', |
|
| 54 |
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
| 55 |
+] |
|
| 56 |
+ |
|
| 57 |
+ROOT_URLCONF = 'tamrondb.urls' |
|
| 58 |
+ |
|
| 59 |
+TEMPLATES = [ |
|
| 60 |
+ {
|
|
| 61 |
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|
| 62 |
+ 'DIRS': [], |
|
| 63 |
+ 'APP_DIRS': True, |
|
| 64 |
+ 'OPTIONS': {
|
|
| 65 |
+ 'context_processors': [ |
|
| 66 |
+ 'django.template.context_processors.debug', |
|
| 67 |
+ 'django.template.context_processors.request', |
|
| 68 |
+ 'django.contrib.auth.context_processors.auth', |
|
| 69 |
+ 'django.contrib.messages.context_processors.messages', |
|
| 70 |
+ ], |
|
| 71 |
+ }, |
|
| 72 |
+ }, |
|
| 73 |
+] |
|
| 74 |
+ |
|
| 75 |
+WSGI_APPLICATION = 'tamrondb.wsgi.application' |
|
| 76 |
+ |
|
| 77 |
+ |
|
| 78 |
+# Database |
|
| 79 |
+# https://docs.djangoproject.com/en/1.11/ref/settings/#databases |
|
| 80 |
+ |
|
| 81 |
+DATABASES = {
|
|
| 82 |
+ 'default': {
|
|
| 83 |
+ 'ENGINE': 'django.db.backends.mysql', |
|
| 84 |
+ 'NAME': 'tenglong', |
|
| 85 |
+ 'USER': 'root', |
|
| 86 |
+ 'PASSWORD': '', |
|
| 87 |
+ 'HOST': '127.0.0.1', |
|
| 88 |
+ 'PORT': 3306, |
|
| 89 |
+ 'CONN_MAX_AGE': 600, |
|
| 90 |
+ 'OPTIONS': {
|
|
| 91 |
+ 'charset': 'utf8mb4', |
|
| 92 |
+ }, |
|
| 93 |
+ } |
|
| 94 |
+} |
|
| 95 |
+ |
|
| 96 |
+ |
|
| 97 |
+# Password validation |
|
| 98 |
+# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators |
|
| 99 |
+ |
|
| 100 |
+AUTH_PASSWORD_VALIDATORS = [ |
|
| 101 |
+ {
|
|
| 102 |
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
|
| 103 |
+ }, |
|
| 104 |
+ {
|
|
| 105 |
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
|
| 106 |
+ }, |
|
| 107 |
+ {
|
|
| 108 |
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
|
| 109 |
+ }, |
|
| 110 |
+ {
|
|
| 111 |
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
|
| 112 |
+ }, |
|
| 113 |
+] |
|
| 114 |
+ |
|
| 115 |
+ |
|
| 116 |
+# Internationalization |
|
| 117 |
+# https://docs.djangoproject.com/en/1.11/topics/i18n/ |
|
| 118 |
+ |
|
| 119 |
+LANGUAGE_CODE = 'zh-Hans' |
|
| 120 |
+ |
|
| 121 |
+TIME_ZONE = 'Asia/Shanghai' |
|
| 122 |
+ |
|
| 123 |
+USE_I18N = True |
|
| 124 |
+ |
|
| 125 |
+USE_L10N = True |
|
| 126 |
+ |
|
| 127 |
+USE_TZ = True |
|
| 128 |
+ |
|
| 129 |
+ |
|
| 130 |
+# Static files (CSS, JavaScript, Images) |
|
| 131 |
+# https://docs.djangoproject.com/en/1.11/howto/static-files/ |
|
| 132 |
+ |
|
| 133 |
+STATICFILES_DIRS = ( |
|
| 134 |
+ os.path.join(PROJ_DIR, 'static').replace('\\', '/'),
|
|
| 135 |
+) |
|
| 136 |
+ |
|
| 137 |
+STATIC_ROOT = os.path.join(BASE_DIR, 'collect_static').replace('\\', '/')
|
|
| 138 |
+ |
|
| 139 |
+STATIC_URL = '/static/' |
|
| 140 |
+ |
|
| 141 |
+STATICFILES_FINDERS = ( |
|
| 142 |
+ 'django.contrib.staticfiles.finders.FileSystemFinder', |
|
| 143 |
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
| 144 |
+ # 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
|
| 145 |
+) |
|
| 146 |
+ |
|
| 147 |
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace('\\', '/')
|
|
| 148 |
+ |
|
| 149 |
+MEDIA_URL = '/media/' |
@@ -0,0 +1,22 @@ |
||
| 1 |
+"""tamrondb URL Configuration |
|
| 2 |
+ |
|
| 3 |
+The `urlpatterns` list routes URLs to views. For more information please see: |
|
| 4 |
+ https://docs.djangoproject.com/en/1.11/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: url(r'^$', 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: url(r'^$', Home.as_view(), name='home') |
|
| 12 |
+Including another URLconf |
|
| 13 |
+ 1. Import the include() function: from django.conf.urls import url, include |
|
| 14 |
+ 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
|
| 15 |
+""" |
|
| 16 |
+from django.conf.urls import url |
|
| 17 |
+from django.contrib import admin |
|
| 18 |
+ |
|
| 19 |
+ |
|
| 20 |
+urlpatterns = [ |
|
| 21 |
+ url(r'^admin/', admin.site.urls), |
|
| 22 |
+] |
@@ -0,0 +1,17 @@ |
||
| 1 |
+""" |
|
| 2 |
+WSGI config for tamrondb 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/1.11/howto/deployment/wsgi/ |
|
| 8 |
+""" |
|
| 9 |
+ |
|
| 10 |
+import os |
|
| 11 |
+ |
|
| 12 |
+from django.core.wsgi import get_wsgi_application |
|
| 13 |
+ |
|
| 14 |
+ |
|
| 15 |
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tamrondb.settings")
|
|
| 16 |
+ |
|
| 17 |
+application = get_wsgi_application() |