Commit 709dd610 authored by gaoming's avatar gaoming

nodebug

parent dddd51cf
/*
Navicat Premium Data Transfer
Source Server : channels
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : channels
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 05/06/2019 14:56:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for auth_group
-- ----------------------------
DROP TABLE IF EXISTS `auth_group`;
CREATE TABLE `auth_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_group_permissions
-- ----------------------------
DROP TABLE IF EXISTS `auth_group_permissions`;
CREATE TABLE `auth_group_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`),
CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_permission
-- ----------------------------
DROP TABLE IF EXISTS `auth_permission`;
CREATE TABLE `auth_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`content_type_id` int(11) NOT NULL,
`codename` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`),
CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_user
-- ----------------------------
DROP TABLE IF EXISTS `auth_user`;
CREATE TABLE `auth_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(128) NOT NULL,
`last_login` datetime(6) DEFAULT NULL,
`is_superuser` tinyint(1) NOT NULL,
`username` varchar(150) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(150) NOT NULL,
`email` varchar(254) NOT NULL,
`is_staff` tinyint(1) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`date_joined` datetime(6) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_user_groups
-- ----------------------------
DROP TABLE IF EXISTS `auth_user_groups`;
CREATE TABLE `auth_user_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_user_groups_user_id_group_id_94350c0c_uniq` (`user_id`,`group_id`),
KEY `auth_user_groups_group_id_97559544_fk_auth_group_id` (`group_id`),
CONSTRAINT `auth_user_groups_group_id_97559544_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`),
CONSTRAINT `auth_user_groups_user_id_6a12ed8b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_user_user_permissions
-- ----------------------------
DROP TABLE IF EXISTS `auth_user_user_permissions`;
CREATE TABLE `auth_user_user_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_user_user_permissions_user_id_permission_id_14a6b632_uniq` (`user_id`,`permission_id`),
KEY `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` (`permission_id`),
CONSTRAINT `auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
CONSTRAINT `auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for django_admin_log
-- ----------------------------
DROP TABLE IF EXISTS `django_admin_log`;
CREATE TABLE `django_admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action_time` datetime(6) NOT NULL,
`object_id` longtext,
`object_repr` varchar(200) NOT NULL,
`action_flag` smallint(5) unsigned NOT NULL,
`change_message` longtext NOT NULL,
`content_type_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `django_admin_log_content_type_id_c4bce8eb_fk_django_co` (`content_type_id`),
KEY `django_admin_log_user_id_c564eba6_fk_auth_user_id` (`user_id`),
CONSTRAINT `django_admin_log_content_type_id_c4bce8eb_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`),
CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for django_content_type
-- ----------------------------
DROP TABLE IF EXISTS `django_content_type`;
CREATE TABLE `django_content_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_label` varchar(100) NOT NULL,
`model` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for django_migrations
-- ----------------------------
DROP TABLE IF EXISTS `django_migrations`;
CREATE TABLE `django_migrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for django_session
-- ----------------------------
DROP TABLE IF EXISTS `django_session`;
CREATE TABLE `django_session` (
`session_key` varchar(40) NOT NULL,
`session_data` longtext NOT NULL,
`expire_date` datetime(6) NOT NULL,
PRIMARY KEY (`session_key`),
KEY `django_session_expire_date_a5c62663` (`expire_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for like_promotion_channel
-- ----------------------------
DROP TABLE IF EXISTS `like_promotion_channel`;
CREATE TABLE `like_promotion_channel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_name` varchar(64) NOT NULL,
`appid` varchar(64) NOT NULL,
`device_id` varchar(64) NOT NULL,
`idfa` varchar(64) NOT NULL,
`idfv` varchar(64) NOT NULL,
`udid` varchar(64) NOT NULL,
`uuid` varchar(64) NOT NULL,
`imei` varchar(64) NOT NULL,
`mac` varchar(100) DEFAULT NULL,
`platform` varchar(100) NOT NULL,
`model` varchar(40) DEFAULT NULL,
`client_type` int(11) NOT NULL,
`callback_type` varchar(2) NOT NULL,
`callback` varchar(1024) NOT NULL,
`request` longtext NOT NULL,
`response` longtext NOT NULL,
`active_key` varchar(1024) NOT NULL,
`record_from` varchar(128) NOT NULL,
`version` varchar(10) DEFAULT NULL,
`os_version` varchar(20) DEFAULT NULL,
`screen` varchar(40) DEFAULT NULL,
`create_time` datetime(6) NOT NULL,
`active_time` datetime(6) DEFAULT NULL,
`last_activity` datetime(6) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `like_promotion_channel_device_id_appid_idfa_idf_7240e26c_uniq` (`device_id`,`appid`,`idfa`,`idfv`,`imei`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;
......@@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'b-56^v12@eex@zzf0$v1lopdbu9#@_khe7^3q_-mcz*(!^1n$)'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ['*']
......@@ -82,10 +82,22 @@ WSGI_APPLICATION = 'channels.wsgi.application'
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
'ENGINE': 'django.db.backends.mysql', # 设置为mysql数据库
'NAME': 'channels',
'USER': 'root',
'PASSWORD': 'root_bad_123',
'HOST': 'localhost',
'PORT': '',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4", # 为了支持emoji表情
},
},
}
......
File deleted
# Generated by Django 2.2.1 on 2019-06-05 06:11
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='PromotionChannel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('app_name', models.CharField(default='0', max_length=64, verbose_name='app名字')),
('appid', models.CharField(max_length=64, verbose_name='渠道id')),
('device_id', models.CharField(max_length=64, verbose_name='设备id')),
('idfa', models.CharField(max_length=64, verbose_name='idfa')),
('idfv', models.CharField(max_length=64, verbose_name='idfv')),
('udid', models.CharField(max_length=64, verbose_name='udid')),
('uuid', models.CharField(max_length=64, verbose_name='uuid')),
('imei', models.CharField(max_length=64, verbose_name='imei')),
('mac', models.CharField(default='', max_length=100, null=True, verbose_name='iOS设备的idfv或Android设备的mac')),
('platform', models.CharField(default=0, max_length=100, verbose_name='IOS或安卓类型')),
('model', models.CharField(max_length=40, null=True, verbose_name='Model')),
('client_type', models.IntegerField(default=0, verbose_name='客户端类型')),
('callback_type', models.CharField(default='0', max_length=2)),
('callback', models.CharField(blank=True, default='', max_length=1024, verbose_name='渠道回调')),
('request', models.TextField(blank=True, default='', verbose_name='点击上报请求的json')),
('response', models.TextField(blank=True, default='', verbose_name='回调响应的json')),
('active_key', models.CharField(default='', max_length=1024, verbose_name='激活回调需要的额外签名')),
('record_from', models.CharField(blank=True, default='', max_length=128, verbose_name='数据的来源')),
('version', models.CharField(max_length=10, null=True, verbose_name='APP版本')),
('os_version', models.CharField(max_length=20, null=True, verbose_name='系统版本')),
('screen', models.CharField(max_length=40, null=True, verbose_name='屏幕分辨率')),
('channel', models.CharField(default=0, max_length=40, null=True, verbose_name='渠道')),
('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='创建时间')),
('active_time', models.DateTimeField(blank=True, null=True, verbose_name='激活时间')),
('last_activity', models.DateTimeField(auto_now=True, verbose_name='最后活跃时间')),
],
options={
'db_table': 'like_promotion_channel',
'verbose_name': '渠道推广记录',
'unique_together': {('device_id', 'appid', 'idfa', 'idfv', 'imei')},
},
),
]
# Generated by Django 2.2.1 on 2019-06-05 06:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('like', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='promotionchannel',
name='channel',
),
]
......@@ -55,7 +55,6 @@ class PromotionChannel(models.Model):
# Android Only
screen = models.CharField(verbose_name=u'屏幕分辨率', null=True, max_length=40)
channel = models.CharField(verbose_name=u'渠道', null=True, max_length=40,default=CLIENT_TYPE.USER.value[0])
# time
create_time = models.DateTimeField(default=timezone.now, verbose_name=u'创建时间')
......
/*
Navicat Premium Data Transfer
Source Server : channel本地
Source Server Type : SQLite
Source Server Version : 3012001
Source Schema : main
Target Server Type : SQLite
Target Server Version : 3012001
File Encoding : 65001
Date: 04/06/2019 10:05:06
*/
PRAGMA foreign_keys = false;
-- ----------------------------
-- Table structure for like_promotion_channel
-- ----------------------------
DROP TABLE IF EXISTS "like_promotion_channel";
CREATE TABLE "like_promotion_channel" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "app_name" varchar(64) NOT NULL, "appid" varchar(64) NOT NULL, "model" varchar(40) NULL, "client_type" integer NOT NULL, "callback_type" varchar(2) NOT NULL, "callback" varchar(1024) NOT NULL, "request" text NOT NULL, "response" text NOT NULL, "active_key" varchar(1024) NOT NULL, "record_from" varchar(128) NOT NULL, "platform" integer NOT NULL, "version" varchar(10) NULL, "os_version" varchar(20) NULL, "screen" varchar(40) NULL, "channel" varchar(40) NULL, "create_time" datetime NOT NULL, "active_time" datetime NULL, "last_activity" datetime NOT NULL, "mac" varchar(100) NOT NULL, "device_id" varchar(64) NOT NULL);
-- ----------------------------
-- Auto increment value for like_promotion_channel
-- ----------------------------
UPDATE "main"."sqlite_sequence" SET seq = 1 WHERE name = 'like_promotion_channel';
-- ----------------------------
-- Indexes structure for table like_promotion_channel
-- ----------------------------
CREATE UNIQUE INDEX "main"."like_promotion_channel_device_id_appid_a7b04688_uniq"
ON "like_promotion_channel" (
"device_id" ASC,
"appid" ASC
);
PRAGMA foreign_keys = true;
amqp==2.5.0
appnope==0.1.0
Babel==2.7.0
backcall==0.1.0
billiard==3.6.0.0
celery==4.3.0
certifi==2019.3.9
chardet==3.0.4
Click==7.0
decorator==4.4.0
Django==2.2.1
flower==0.9.3
idna==2.8
ipython==7.5.0
ipython-genutils==0.2.0
jedi==0.13.3
kombu==4.6.0
mysql==0.0.2
mysqlclient==1.4.2.post1
parso==0.4.0
pexpect==4.7.0
pickleshare==0.7.5
prompt-toolkit==2.0.9
ptyprocess==0.6.0
Pygments==2.4.2
pytz==2019.1
redis==3.2.1
requests==2.22.0
six==1.12.0
sqlparse==0.3.0
tornado==5.1.1
traitlets==4.3.2
urllib3==1.25.3
vine==1.3.0
wcwidth==0.1.7
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment