"""
Django settings for ip_is_bad project.

Generated by 'django-admin startproject' using Django 1.8.6.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'sws$g$nu2gbvf4s$dx_1ao6f7afrwfi!-w%p+xy3i$_gn#wmvu'

# 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',
    'ip',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'ip_is_bad.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',
            ],
        },
    },
]

WSGI_APPLICATION = 'ip_is_bad.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'ip_is_bad',
        'USER': 'root',
        'PASSWORD': '123456',
        'HOST': '127.0.0.1',
        'PORT': 3306
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/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.8/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static').replace('\\', '/')
STATICFILES_DIRS = (
    ('css', os.path.join(STATIC_ROOT, 'css').replace('\\', '/')),
    ('js', os.path.join(STATIC_ROOT, 'js').replace('\\', '/')),
    ('case', os.path.join(STATIC_ROOT, 'case')),
    ('fonts', os.path.join(STATIC_ROOT, 'fonts')),
    ('download', os.path.join(STATIC_ROOT, 'download')),
)

MEDIA_URL = '/ip/'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'case')

TOOLS = (
    # ("url", "显示名称", "帮助页面地址", <权限 Query，可省>)
    ("新工具", (
        ("/admin/db_manager/", "翻译&认知词", "#"),
        ("/cyberin/dm_test/", "数据挖掘测试", "http://doc.mxspider.top/pages/viewpage.action?pageId=4948414"),
        ("/cyberin/entry_rank/", "数据导出", "#"),
        ("/might/export/", "另一个数据导出", "#"),
        # ("/might/process-management/", "流程管理工具", "#"),
        ("/might/pm/", "流程管理工具", "#"),
    )),
    ("cyberin相关", (
        ("/cyberin/update_hotword/", "更新cyberin热词", "#"),
        ("/cyberin/feed_index/", "feeding", "#"),
        ("/cyberin/add_spider_task/", "新增爬虫临时任务", "#"),
        ("/cyberin/export_philip/", "导出菲利普报告", "#"),
        ("/cyberin/reload_adidas/", "重置阿迪达斯图片", "#"),
        ("/cyberin/updata_to_cyberin/", "手动上传数据至cyberin平台", "#"),
        ("/cyberin/weibo_hudong/", "新平台微博互动数更新", "#"),
        ("/cyberin/deal_is_origin/", "计算原创和转载", "#"),
        ("http://61.179.50.150:26001/upload_url/up_page", 'Cyberin平台主动提交URL抓取-补数据', "#"),
        ("http://61.179.50.150:26001/data/show_detail", '平台数据抓取时间查询', "#"),
        ("/cyberin/get_sourcetype_domain/", "获取平台分类及域名", "#"),
        ("/cyberin/similar-agg/", "文章聚类", "#"),
        ("/medialibary/download_mode/", "媒体库", "#"),
    )),
    ("社群相关", (
        ("/cyberin/sync_dashboard/", "同步品牌透视", "#"),
        ("/community/brand_index/", "品牌维护", "#"),
        ("/community/ip_index/", "IP维护", "#"),
        ("/community/tags/", "站点标签管理", "#"),
        ("/kol/kol_price/", "kol价格管理", "#"),
        ("/kol/upload_kol_price/", "kol价格上传", "#"),
        ("/kol/add_kol/", "添加KOL", "#"),
        ("/kol/kol_alias/", "kol别名", "#"),
    )),
    ("微博接口相关", (
        ("/weibo_api/index/", "微博接口-回溯&订阅", "#"),
        ("/weibo_api/apis/", "微博接口-工具集", "#")
    )),
    ("微博人群库", (
        ("/weibo/filter-account/", "微博人群库", "#"),
        ("/weibo/filter-post/", "微博内容库", "#"),
        ("/weibo/edit_tag/", "微博标签人工标注", "#"),
        ("/weibo/dewatered/", "微博KOL去水", "#")
    )),
    ("抓取相关", (
        ("/kol/crawl_user/", "抓取用户管理", "#"),
        ("/cyberin/keyword_search/", "抓取关键词管理", "http://doc.mxspider.top/pages/viewpage.action?pageId=853089"),
        ("/cyberin/get_kafka_data/", "kafka消费进度查询", "#"),
        ("/community/brand_recall", "品牌回溯工具", "#"),
        ("/pageclean/", "Pageclean 工具", "#"),
        ("http://node-front.mxspider.top/api/weight/web", "web端站点排行", "#"),
        ("http://node-front.mxspider.top/spiders/status", "爬虫数据查询", "#"),
        ("http://node-front.mxspider.top/spiders/trend", "爬虫数据变化量查询", "#"),
    )),
    ("旧工具链接", (
        ("http://pr.maixunbytes.com/tools/index.php", "工具集", "#"),
        ("http://platform.maixunbytes.com/tools/index", "新产品工具", "#"),
        ("http://www.mxspider.top/data_stat/index", "数据监控", "#"),
        ("http://www.mxspider.top/data_stat/weibo.html", "微博数据监控", "#"),
    )),
    ("定制报告", (
        ("/cyberin/update_dom_site_wordscount/", "更新域名、版位、文章字数", "#"),
        ("/cyberin/news_deplay/", "新闻展示页", "#"),
    )),
    ("其它", (
        ("http://zentao.mxspider.top/", "禅道", "#"),
        ("http://cem.maixunbytes.com/piwik/index.php", "piwik", "#"),
        ("https://maixunproducts.quip.com/", "quip", "#"),
        ("http://112.253.2.61:10020/index", "数据挖掘工具集", "#"),
    )),
)