Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴升宇
physical
Commits
dcf5ad0b
Commit
dcf5ad0b
authored
Feb 20, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
5265e429
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
25 deletions
+14
-25
views.py
injection/data_sync/views.py
+0
-5
settings.py
physical/settings.py
+14
-20
No files found.
injection/data_sync/views.py
View file @
dcf5ad0b
...
@@ -5,8 +5,3 @@ from django.shortcuts import render
...
@@ -5,8 +5,3 @@ from django.shortcuts import render
from
injection.data_sync
import
tasks
from
injection.data_sync
import
tasks
from
django.http
import
JsonResponse
from
django.http
import
JsonResponse
def
index
(
request
,
*
args
,
**
kwargs
):
res
=
tasks
.
add
.
delay
(
1
,
3
)
#任务逻辑
return
JsonResponse
({
'status'
:
'successful'
,
'task_id'
:
res
.
task_id
})
physical/settings.py
View file @
dcf5ad0b
...
@@ -18,7 +18,6 @@ from celery.schedules import crontab
...
@@ -18,7 +18,6 @@ from celery.schedules import crontab
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
# Quick-start development settings - unsuitable for production
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
...
@@ -30,17 +29,17 @@ DEBUG = False
...
@@ -30,17 +29,17 @@ DEBUG = False
ALLOWED_HOSTS
=
[]
ALLOWED_HOSTS
=
[]
# Application definition
# Application definition
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
# CELERY_SEND_EVENTS = True
# CELERY_SEND_EVENTS = True
# CELERY_SEND_TASK_SENT_EVENT = True
# CELERY_SEND_TASK_SENT_EVENT = True
#
#
# CELERY_DEFAULT_EXCHANGE = 'celery'
CELERY_DEFAULT_EXCHANGE
=
'celery'
# CELERY_DEFAULT_EXCHANGE_TYPE = 'direct'
CELERY_DEFAULT_EXCHANGE_TYPE
=
'direct'
# CELERY_DEFAULT_ROUTING_KEY = 'celery'
CELERY_DEFAULT_ROUTING_KEY
=
'celery'
CELERY_IMPORTS
=
(
'injection.data_sync.tasks'
,
)
#
#
# CELERY_QUEUES = {
# CELERY_QUEUES = {
# 'celery': {
# 'celery': {
...
@@ -56,12 +55,7 @@ BROKER_URL = "redis://127.0.0.1:6379/8"
...
@@ -56,12 +55,7 @@ BROKER_URL = "redis://127.0.0.1:6379/8"
CELERY_BROKER_URL
=
"redis://127.0.0.1:6379/8"
CELERY_BROKER_URL
=
"redis://127.0.0.1:6379/8"
CELERY_TIMEZONE
=
'Asia/Shanghai'
CELERY_TIMEZONE
=
'Asia/Shanghai'
CELERY_ROUTES
=
[
'physical.celery_task_router.CeleryTaskRouter'
]
CELERY_ROUTES
=
[
'physical.celery_task_router.CeleryTaskRouter'
]
CELERY_RESULT_SERIALIZER
=
'json'
# 结果序列化方案
CELERY_RESULT_SERIALIZER
=
'json'
# 结果序列化方案
CELERY_RESULT_BACKEND
=
'redis://10.1.210.69:6379/0'
# BACKEND配置,这里使用redis
INSTALLED_APPS
=
(
INSTALLED_APPS
=
(
'django.contrib.admin'
,
'django.contrib.admin'
,
...
@@ -70,8 +64,8 @@ INSTALLED_APPS = (
...
@@ -70,8 +64,8 @@ INSTALLED_APPS = (
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'trans2es'
,
'trans2es'
,
'search'
,
'search'
,
'injection.data_sync'
,
'injection.data_sync'
,
)
)
...
@@ -151,7 +145,7 @@ DATABASES = {
...
@@ -151,7 +145,7 @@ DATABASES = {
'PASSWORD'
:
'Gengmei123'
,
'PASSWORD'
:
'Gengmei123'
,
'HOST'
:
'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com'
,
'HOST'
:
'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com'
,
'PORT'
:
'3306'
,
'PORT'
:
'3306'
,
#'CONN_MAX_AGE': None,
#
'CONN_MAX_AGE': None,
'OPTIONS'
:
{
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
"charset"
:
"utf8mb4"
,
...
@@ -160,13 +154,13 @@ DATABASES = {
...
@@ -160,13 +154,13 @@ DATABASES = {
}
}
ES_INFO_LIST
=
[
ES_INFO_LIST
=
[
{
{
"host"
:
"10.29.130.141"
,
"host"
:
"10.29.130.141"
,
"port"
:
9200
"port"
:
9200
}
}
]
]
ES_INDEX_PREFIX
=
"gm-dbmw"
ES_INDEX_PREFIX
=
"gm-dbmw"
MIDDLEWARE_CLASSES
=
(
MIDDLEWARE_CLASSES
=
(
'gm_tracer.middleware.TracerMiddleware'
,
'gm_tracer.middleware.TracerMiddleware'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment