-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from tikazyq/develop
Develop
- Loading branch information
Showing
21 changed files
with
401 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# encoding: utf-8 | ||
|
||
import os | ||
|
||
run_env = os.environ.get("RUNENV", "local") | ||
|
||
if run_env == "local": # 加载本地配置 | ||
from config.config_local import * | ||
else: | ||
from config.config import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,55 @@ | ||
# project variables | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
# 爬虫源码路径 | ||
PROJECT_SOURCE_FILE_FOLDER = '../spiders' | ||
PROJECT_SOURCE_FILE_FOLDER = os.path.join(BASE_DIR, "spiders") | ||
|
||
# 配置python虚拟环境的路径 | ||
PYTHON_ENV_PATH = '/Users/chennan/Desktop/2019/env/bin/python' | ||
|
||
# 爬虫部署路径 | ||
PROJECT_DEPLOY_FILE_FOLDER = '../deployfile' | ||
# PROJECT_DEPLOY_FILE_FOLDER = '../deployfile' | ||
PROJECT_DEPLOY_FILE_FOLDER = '/var/crawlab' | ||
|
||
# 爬虫日志路径 | ||
PROJECT_LOGS_FOLDER = '../deployfile/logs' | ||
|
||
# 打包临时文件夹 | ||
PROJECT_TMP_FOLDER = '/tmp' | ||
|
||
# celery variables | ||
# Celery中间者URL | ||
BROKER_URL = 'redis://127.0.0.1:6379/0' | ||
|
||
# Celery后台URL | ||
CELERY_RESULT_BACKEND = 'mongodb://127.0.0.1:27017/' | ||
|
||
# Celery MongoDB设置 | ||
CELERY_MONGODB_BACKEND_SETTINGS = { | ||
'database': 'crawlab_test', | ||
'taskmeta_collection': 'tasks_celery', | ||
} | ||
|
||
# Celery时区 | ||
CELERY_TIMEZONE = 'Asia/Shanghai' | ||
|
||
# 是否启用UTC | ||
CELERY_ENABLE_UTC = True | ||
|
||
# Celery Scheduler Redis URL | ||
CELERY_BEAT_SCHEDULER = 'utils.redisbeat.RedisScheduler' | ||
CELERY_REDIS_SCHEDULER_URL = 'redis://localhost:6379' | ||
CELERY_REDIS_SCHEDULER_KEY = 'celery:beat:order_tasks' | ||
|
||
# flower variables | ||
FLOWER_API_ENDPOINT = 'http://localhost:5555/api' | ||
|
||
# database variables | ||
# MongoDB 变量 | ||
MONGO_HOST = '127.0.0.1' | ||
MONGO_PORT = 27017 | ||
MONGO_DB = 'crawlab_test' | ||
|
||
# flask variables | ||
# Flask 变量 | ||
DEBUG = True | ||
FLASK_HOST = '127.0.0.1' | ||
FLASK_PORT = 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
|
||
# 爬虫源码路径 | ||
PROJECT_SOURCE_FILE_FOLDER = os.path.join(BASE_DIR, "spiders") | ||
|
||
# 配置python虚拟环境的路径 | ||
PYTHON_ENV_PATH = '/Users/chennan/Desktop/2019/env/bin/python' | ||
|
||
# 爬虫部署路径 | ||
# PROJECT_DEPLOY_FILE_FOLDER = '../deployfile' | ||
PROJECT_DEPLOY_FILE_FOLDER = '/var/crawlab' | ||
|
||
# 爬虫日志路径 | ||
PROJECT_LOGS_FOLDER = '../deployfile/logs' | ||
|
||
# 打包临时文件夹 | ||
PROJECT_TMP_FOLDER = '/tmp' | ||
|
||
# Celery中间者URL | ||
BROKER_URL = 'redis://127.0.0.1:6379/0' | ||
|
||
# Celery后台URL | ||
CELERY_RESULT_BACKEND = 'mongodb://127.0.0.1:27017/' | ||
|
||
# Celery MongoDB设置 | ||
CELERY_MONGODB_BACKEND_SETTINGS = { | ||
'database': 'crawlab_test', | ||
'taskmeta_collection': 'tasks_celery', | ||
} | ||
|
||
# Celery时区 | ||
CELERY_TIMEZONE = 'Asia/Shanghai' | ||
|
||
# 是否启用UTC | ||
CELERY_ENABLE_UTC = True | ||
|
||
# Celery Scheduler Redis URL | ||
CELERY_BEAT_SCHEDULER = 'utils.redisbeat.RedisScheduler' | ||
CELERY_REDIS_SCHEDULER_URL = 'redis://localhost:6379' | ||
CELERY_REDIS_SCHEDULER_KEY = 'celery:beat:order_tasks' | ||
|
||
# flower variables | ||
FLOWER_API_ENDPOINT = 'http://localhost:5555/api' | ||
|
||
# MongoDB 变量 | ||
MONGO_HOST = '127.0.0.1' | ||
MONGO_PORT = 27017 | ||
MONGO_DB = 'crawlab_test' | ||
|
||
# Flask 变量 | ||
DEBUG = True | ||
FLASK_HOST = '127.0.0.1' | ||
FLASK_PORT = 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.