# Install Virtual Environment
$ sudo pip install virtualenv
$ mkdir -p ~/dev/atc
$ virtualenv ~/dev/atc/venv
$ source ~/dev/atc/venv/bin/activate
# Package installation
$ pip install atc_thrift atcd django-atc-api django-atc-demo-ui django-atc-profile-storage
# Configuration
$ cd ~/dev/atc
$ django-admin startproject atcui
$ cd atcui/
atcui/settings.py
and adding the following apps to INSTALLED_APPS
:$ vim atcui/settings.py
INSTALLED_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',
)
atcui/urls.py
and adding the routes to urlpatterns
:$ vim atcui/urls.py
...
from django.conf.urls import include
from django.views.generic.base import RedirectView
urlpatterns = [
...
# Django ATC API
url(r'^api/v1/', include('atc_api.urls')),
# Django ATC Demo UI
url(r'^atc_demo_ui/', include('atc_demo_ui.urls')),
# Django ATC profile storage
url(r'^api/v1/profiles/', include('atc_profile_storage.urls')),
url(r'^$', RedirectView.as_view(url='/atc_demo_ui/', permanent=False)),
]
$ python manage.py migrate
atcd
service and run the UI.$ test -z $VIRTUAL_ENV && source ~/dev/atc/venv/bin/activate
$ sudo atcd
$ test -z $VIRTUAL_ENV && source ~/dev/atc/venv/bin/activate
$ cd ~/dev/atc/atcui
$ python manage.py runserver 0.0.0.0:8000
NOTE! If you are using Django 1.9 then might me you face stylesheet issue.
Refer: Dirty Fix
$ cd ~/dev/atc/
$ git clone https://github.com/facebook/augmented-traffic-control.git
$ cd augmented-traffic-control/utils/
$ bash restore-profiles.sh localhost:8000
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/2G-DevelopingRural.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/2G-DevelopingUrban.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/3G-Average.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/3G-Good.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/Cable.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/DSL.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/Edge-Average.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/Edge-Good.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/Edge-Lossy.json
Added profile ~/dev/atc/augmented-traffic-control/utils/profiles/NoConnectivity.json
Authentication
and add your device ip address and access token, click on Authorize
buttonProfiles
and select your testing network profile.Update Shaping
button click on it.