App to create and send messages to public persons. It's a component of POPLUS project.
Switch branches/tags
17-link-logo-to-home 198-add-page-post-submission 200_report_this_message_button 350_timing_problem 399_use_photos_from_popit 428_handle_more_than_text_plain_responses_exploration_1 428_handle_more_than_text_plain_responses 461_use_video_responses_miwaber_approach 525-update-manage-urls 580_thing_with_the_templates_and_email_with_multi_alternatives 620-expand-social-logins 704-moderation-for-all 923-moderation-admin 944-add-contact-page-for-admin about-page-alpaca-m-edit add-extra-languages-from-transifex add-missing-vagrant-dependencies add-mysql-to-travis add-new-about-page-alpaca add-survey add_post_submission_page_198 allow-anonymous-rebased allow-anonymous-users allow_messages_using_form-default alpaca-about-page-edit alpaca-about-translation alpaca-design-feedback alpaca-new-translations alpaca-rebased-django-1.8 alpaca-rebased alpaca-second-about-page alpaca-update-about-page alpaca api_messages_search_per_person better-celery-docs bootstrap bug/623-bots-can-push-several-messages-to-api contact-instance-owner-form customize-from-real-name dealing_with_psycopg2_requirement delayed-delivery-warnings design-messages-screen-master django-1.7-upgrade-after-move django-1.7-upgrade django-1.8 doc elasticsearch-versions-update email-links-should-be-instance-default-language fix-bad-date-defaults fix-chosen-css-production-error fix-for-multiple-popolo-uri-ids fix-intermittent-test-failure fix-offering-moderation-of-unconfirmed fix-subdomain-dependent-templates fix-subdomain-missing-for-handleemail fix-sync-updated fix-vagrant-provisioning fixing_missing_template freeze-requirements gh-pages-bkp gh-pages-help gh-pages help-pages-within-app-dave hide-unmoderated-messages-on-from-page https issue_337 issue_414_API_docs issues/610-resync-popit issues/633-post-logout-redirect issues/647-edit-link-on-instance-home issues/665-data-sources-screen issues/706-testing-mode-message issues/824-admin-settings-page issues/827-message-manager-improvements issues/846/chicken-way issues/846/create-writeit-from-popit-url jalali-calendar-for-persian landscape_config make-root-redirect-temporary manually_create_answers master migrate-to-django-popolo-part-1 migrate-to-django-popolo-part-2 migrate-to-django-popolo-part-3 migrate-to-django-popolo missing-contact-details moderation-fixes more-fixes-for-comma-and-and-joining more-moderated-viewing-fixes new-fa-translations new_answer_bug no-rejected-messages-in-all-threads per-instance-css pin-django-nose remove-circular-dependencies reviewed-migrate-to-django-popolo sass-pipeline selenium_testing small_frontend_changes stricter-anonymity-same-messages-as translations-for-whole-project travis-container-based-builds try-reversing-small update-documentation using_django1.8 vagrant-gettext version-view webhookwith_an_api_key wip-migrate-to-django-popolo write-in-public-design
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.tx
config_examples
contactos
instance
locale
mailit
nuntium
scripts
writeit
.coveragerc
.gitignore
.landscape.yaml
.travis.yml
INTEGRATION_GUIDE.md
LICENSE.txt
MANIFEST.in
Procfile
README.md
Vagrantfile
coverage.sh
deploying_to_heroku.md
diagram.png
example_data.yaml
global_test_case.py
hook-pre-commit
manage.py
requirements-amazon.txt
requirements-production.txt
requirements.txt
requirements_testing.txt
schema.xml
setup.cfg
setup.py
start_local_popit_api.bash
writeit_utils.py

README.md

You write it, and we deliver it.

Build Status Coverage Status Code Health

Write-it is an application that aims to deliver messages to people whose contacts are to be private or the messages should be public, for example: members of congress.

Write-it is a layer on top of popit from where it takes the people and adds contacts. The way it delivers messages is using plugins for example: mailit. And this approach allows for future ways of delivering for example: twitter, whatsapp, fax or pager.

Future uses are in congresoabierto to replace the old "preguntales" (You can check here, to see how it used to work) feature, it was inspired by writetothem.

Installation instructions for developers are below. If you'd like to integrate WriteIt with your civic tech application it's recommended that you use the hosted version and read INTEGRATION_GUIDE.md in this directory for integration instructions.

Quick Installation (Vagrant)

Assuming you have Vagrant installed, run the following:

git clone https://github.com/ciudadanointeligente/write-it.git
cd write-it
vagrant up

Vagrant will automatically install WriteIt and all of its dependencies. This can take a few minutes.

Once it’s complete, log into the virtual machine with:

vagrant ssh

Once you’re inside the virtual machine, you can load some fixtures with:

./manage.py loaddata example_data.yaml

Then run the development server with:

./manage.py runserver 0.0.0.0:8000

And visit http://127.0.0.1.xip.io:8000 on your host machine to use WriteIt.

Background jobs

./manage.py celery worker

This handles syncing contact details from remote sources. If you have created a new instance and the contacts do not seem to be syncing it is probably because a celery worker is not running.

Scheduled jobs

./manage.py celery beat

This sends emails to recipients and periodically re-sync contacts from remote sources.

Manual Installation (without Vagrant)

System Requirements

It's required if you want to play around seaching messages and answers, this part is optional.

Your version of the Python elasticsearch package must match the version of Elasticsearch you have. The requirements.txt file in this repository currently specifies elasticsearch==1.6.0, which will only work with Elasticsearch with a major version of 1. If you have a 0.x or 2.x version of Elasticsearch you will need to install a different version of the Python elasticsearch package. For more details on how to pick the right version to use, see: https://elasticsearch-py.readthedocs.io/en/master/#compatibility

In ubuntu you can do sudo apt-get install libffi-dev

  • Libssl

In ubuntu you can do sudo apt-get install libssl-dev

  • GCC (G++) 4.3+ (used by python libsass package)

In ubuntu you can do sudo apt-get install g++

  • yui-compressor

In ubuntu you can do sudo apt-get install yui-compressor

Write-it is built using Django. You should install Django and its dependencies inside a virtualenv. We suggest you use virtualenvwrapper to create and manage virtualenvs, so if you don’t already have it, go install it, remembering in particular to add the required lines to your shell startup file.

With virtualenvwrapper installed, clone this repo, cd into it, and create a virtualenv:

git clone git@github.com:ciudadanointeligente/write-it.git
cd write-it
mkvirtualenv writeit

Install the requirements:

pip install -r requirements.txt

Set up the database, creating an admin user when prompted:

./manage.py syncdb && ./manage.py migrate

Compile all the available translations:

./manage.py compilemessages

Troubleshooting database migration

There's a problem migrating and the problem looks like

django.db.utils.OperationalError: no such table: tastypie_apikey

It can be fixed by running it twice.

Then run the server:

./manage.py runserver

Testing and Development

If you want to test without Elasticsearch

Elasticsearch is optional and can be turned off by creating a new local_settings.py file vi writeit/local_settings.py with the following content

LOCAL_ELASTICSEARCH = False

Running tests

For testing you need to run ./manage.py test nuntium contactos mailit

Coverage Analysis

For coverage analysis run ./coverage.sh

Logging in

At this point you probably have write-it running without any users. You could create a (super) user by running:

python manage.py createsuperuser

It will ask you the username and password (which you will need to repeat).

With that done you will be able to access '/accounts/login/'.

API clients

Write-it has been used mostly through its REST API for which there are a number of API clients. The github repos and the status of the development are listed below:

There are instructions to install write-it in heroku

The instructions are in the following link.