windows10 installation HttpRunnerManager

   This year there is the fire of the open source platform, followed by practice site to learn a bit about the record on the installation of windows

 

table of Contents

1, the basic environment ready

2, Configuration

3, installation

 

1, the basic environment ready

    The software platform installation are mysql5.7, python3.6, Erlang, RabbitMQ

The first step: installing to create the database, it is recommended 5.7+

After installation libraries, database connectivity tools using the new platform to be used

 

 Step 2: Install Python3.6

 

 The third step: install erlang10.4, Download http://www.erlang.org/downloads , because the installation rabbitmq need to install erlang

 

 

Add environment variables, input erl, proved successful installation

ERLANG_HOME D:\Program Files\erl10.4

path %RABBITMQ_SERVER%\sbin;

 

 Step Four: Installation Rabbitmq

Download: http://www.rabbitmq.com/download.html  After downloading double-click to install

Enter D: \ Program Files \ RabbitMQ Server \ rabbitmq_server-3.7.16 \ sbin directory, enter rabbitmq-plugins.bat enable rabbitmq_management open plug-in

 

 

After activating the plugin, the default is to start, you can manually shut down and re-start

 

 安装完成并启动后,可以测试下是否可正常访问

测试地址 http://localhost:15672/ 

默认的用户名:guest 

默认的密码为:guest

 

2、配置

第一步:下载项目https://github.com/HttpRunner/HttpRunnerManager,放到D盘,重命名为HttpRunnerManager

第二步:配置数据库,打开HttpRunnerManager项目的setting.py文件,进行如下配置

if DEBUG:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'HttpRunnerManager',  # 新建数据库名
            'USER': 'root',  # 数据库登录名
            'PASSWORD': '',  # 数据库登录密码
            'HOST': '127.0.0.1',  # 数据库所在服务器ip地址
            'PORT': '3306',  # 监听端口 默认3306即可
        }
    }
    STATICFILES_DIRS = (
        os.path.join(BASE_DIR, 'static'),  # 静态文件额外目录
    )
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'HttpRunnerManager',  # 新建数据库名
            'USER': 'root',  # 数据库登录名
            'PASSWORD': '',  # 数据库登录密码
            'HOST': '127.0.0.1',  # 数据库所在服务器ip地址
            'PORT': '3306',  # 监听端口 默认3306即可
        }
    }
    STATIC_ROOT = os.path.join(BASE_DIR, 'static')

  

第三步:配置work配置

djcelery.setup_loader()

CELERY_ENABLE_UTC = True

CELERY_TIMEZONE = 'Asia/Shanghai'

BROKER_URL = 'amqp://guest:[email protected]:5672//' if DEBUG else 'amqp://guest:[email protected]:5672//'

CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'

CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'

CELERY_ACCEPT_CONTENT = ['application/json']

CELERY_TASK_SERIALIZER = 'json'

CELERY_RESULT_SERIALIZER = 'json'

 

CELERY_TASK_RESULT_EXPIRES = 7200 # celery任务执行结果的超时时间,

CELERYD_CONCURRENCY = 1 if DEBUG else 10 # celery worker的并发数 也是命令行-c指定的数目 根据服务器配置实际更改 一般25即可

CELERYD_MAX_TASKS_PER_CHILD = 100 # 每个worker执行了多少任务就会死掉,我建议数量可以大一些,比如200

 

 

EMAIL_SEND_USERNAME = '[email protected]' # 定时任务报告发送邮箱,支持163,qq,sina,企业qq邮箱等,注意需要开通smtp服务

EMAIL_SEND_PASSWORD = 'XXX' # 邮箱密码

 

第四步:安装依赖库

切换到HttpRunnerManager目录,然后执行下面命令,自动安装需要的依赖库文件

pip  install -r requirements.txt -i  https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn

 

 

第五步:迁移数据库

python manage.py makemigrations ApiManager #生成数据迁移脚本

python manage.py migrate #应用到db生成数据表

 

 

 

 第六步:创建超级用户,用户后台管理数据库,并按提示输入相应用户名,密码,邮箱。

python manage.py createsuperuser

 

 

密码:admin admin123

启动服务python manage.py runserver

 

 

3、安装

 第一步:先在平台注册

 

第二步:登录

http://127.0.0.1:8000/api/login/

其他:1、后台数据库系统http://127.0.0.1:8000/admin/        2、如果是用manage.py runserver 0.0.0.0:8000启动,则任意ip都能打开

 

 

Guess you like

Origin www.cnblogs.com/weizhideweilai/p/12110818.html