前言
看到了Fresco的弱网测试框架,尝试一下。github地址
安装python virtualenv
1sudo apt-get install python-virtualenv创建一个python 2.7的虚拟环境
1
virtualenv python2.7 --python=python2.7
切换到虚拟环境
1source python2.7/bin.activate安装django,版本必须1.10
1sudo pip install django==1.10安装ATC相关东西
1sudo pip install atc_thrift atcd django-atc-api django-atc-demo-ui django-atc-profile-storage初始化一个django项目
12django-admin startproject atcuicd atcui123456789101112INSTALLED_APPS = (...# Django ATC API'rest_framework','atc_api',# Django ATC Demo UI'bootstrap_themes','django_static_jquery','atc_demo_ui',# Django ATC Profile Storage'atc_profile_storage',)123456789101112131415from django.views.generic.base import RedirectViewfrom django.conf.urls import include,urlurlpatterns = [...# Django ATC APIurl(r'^api/v1/', include('atc_api.urls')),# Django ATC Demo UIurl(r'^atc_demo_ui/', include('atc_demo_ui.urls')),# Django ATC profile storageurl(r'^api/v1/profiles/', include('atc_profile_storage.urls')),url(r'^$', RedirectView.as_view(url='/atc_demo_ui/', permanent=False)),]
1
python manage.py migrate
启动atcd
注意,启动的时候得指定wan和lan,通过ifconfig查看,第一个为wan,最后一个为lan
1234567891011cd python2.7/bin/sudo ./atcd --atcd-wan wan名称 --atcd-lan lan名称```8. 启动django```python manage.py runserver 0.0.0.0:8000测试
本机链接localhost:8000
手机链接IP