<commit_before># Secure the News

## Getting Started with the Development Environment

Make sure you have Vagrant (>=2.0) and Ansible (>=1.9.4) installed. A
Makefile is provided to automate the setup of the development
environment. Run:

    $ make dev
    $ vagrant ssh
    # in the VM
    $ cd /vagrant/securethenews
    $ gulp # Leave this running to live reload changes to js/css files
    $ python3 manage.py runserver 0.0.0.0:8000

### Loading the development fixtures

I have generated fixtures using the sites from `prototype_data/domains.csv` and
a single scan run generated with `python3 manage.py scan`. The fixtures are
stored in the repository and can be quickly loaded into your database so you
have something to work with during development.

To load the fixtures:

    # in the VM
    $ cd /vagrant/securethenews
    $ python3 manage.py loaddata scans/fixtures/0001_20160803T235828.json

### Notes

* Port 8000 is forwarded from the guest to the host. By default, `runserver`
  runs on `127.0.0.1`, so you need to specify `0.0.0.0` for the port forwarding
  to work.
* We are working with Python 3, but Python 2 is the default Python on Ubuntu
  14.04, which is the platform we are using for the development VM for now.
  Therefore, you will need to specify `python3 manage.py` instead of
  `./manage.py` which you may be used to.<commit_msg>Add note about separate session.<commit_after># Secure the News

## Getting Started with the Development Environment

Make sure you have Vagrant (>=2.0) and Ansible (>=1.9.4) installed. A
Makefile is provided to automate the setup of the development
environment. Run:

    $ make dev
    $ vagrant ssh
    # in the VM
    $ cd /vagrant/securethenews
    $ gulp # Run this in a separate session to live reload js/css files
    $ python3 manage.py runserver 0.0.0.0:8000

### Loading the development fixtures

I have generated fixtures using the sites from `prototype_data/domains.csv` and
a single scan run generated with `python3 manage.py scan`. The fixtures are
stored in the repository and can be quickly loaded into your database so you
have something to work with during development.

To load the fixtures:

    # in the VM
    $ cd /vagrant/securethenews
    $ python3 manage.py loaddata scans/fixtures/0001_20160803T235828.json

### Notes

* Port 8000 is forwarded from the guest to the host. By default, `runserver`
  runs on `127.0.0.1`, so you need to specify `0.0.0.0` for the port forwarding
  to work.
* We are working with Python 3, but Python 2 is the default Python on Ubuntu
  14.04, which is the platform we are using for the development VM for now.
  Therefore, you will need to specify `python3 manage.py` instead of
  `./manage.py` which you may be used to.
{'fraction_non_alphanumeric': 0.06761695906432749, 'fraction_numerical': 0.0402046783625731, 'mean_word_length': 3.5239669421487605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6356132', 'n_tokens_mistral': 871, 'n_tokens_neox': 782, 'n_words': 388}