Skip to content
Snippets Groups Projects
Forked from CTDAS / CTDAS
Source project has a limited visibility.

WOCAT

World Overview of Conservation Approaches and Technologies

Newsletter

Create mailchimp list

The project uses mailchimp: https://mailchimp.com/

https://login.mailchimp.com/signup Please follow their instructions on how to setup an account and create a list. Both the api key and list id need to be set in order for the integration to work. (please see settings section for respective environment variable setup)

Import users to list

There is a newsletter management interface to create a filtered list of users, that can be pasted into the mailchimp list.

  1. Go to https://www.wocat.net/newsletter/management/
  2. Select filters and copy output to clipboard
  3. Go to mailchimp list, under „Add contacts“ select „Import contacts“
  4. Select „Copy/paste from file“ and paste from clipboard
  5. Match columns and import

Register unsubscribe webhook

To synchronize the newsletter flag upon unsubscription via newsletter email link a webhook needs to be registered. http://kb.mailchimp.com/integrations/api-integrations/how-to-set-up-webhooks

  1. Go to mailchimp list
  2. Under „Settings“ select „Webhooks“
  3. Select „Create new webhook“ and paste URL: https://www.wocat.net/newsletter/unsubscribe/
  4. Select only the checkbox for „Unsubscribes“ and save

Elasticsearch

To use Elasticsearch as a search-backend, it suffices to just set it up (through your distributions package management) and change the WAGTAILSEARCH_BACKEND-variable accordinly. As of writing this, a feature for indexing PDFs and other documents has not made it into upstream wagtail (https://github.com/wagtail/wagtail/pull/3028) . Once this feature is merged, we can retroactively index all uploaded documents. (The index engine for ElasticSearch is based on [Tika](https://tika.apache.org/) and can therefore index anything Tika can.)

Basic Commands

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

  • To create an superuser account, use this command:

    $ python manage.py createsuperuser

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Import users from CSV

To import users from CSV use this command:

$ python manage.py import_users_data /path/to/institutions.csv /path/to/users.csv

The CSV file specs are (check samples files in /import folder)

  • encoding: UTF-8
  • delimiter: ";"
  • quoting:
  • escape character:

Attention: Please check before the import again whether the data basis is clean, especially regarding the institutes!

Send reset password link to users

After the final import of the users, they are informed by e-mail that they have to re-assign their password. This mail to the user contains a personal link, which allows you to set a password directly (without having to go through the password-forgotten function). The mail is therefore sent by the CMS, implemented here for a command which triggers the emails:

$ python manage.py send_user_password_reset_links

Rebuild search index

$ ./manage.py update_index [--backend <backend name>]

This command rebuilds the search index from scratch. It is only required when using Elasticsearch.

It is recommended to run this command once a week and at the following times:

whenever any pages have been created through a script (after an import, for example) whenever any changes have been made to models or search configuration The search may not return any results while this command is running, so avoid running it at peak times.

$ python manage.py search_garbage_collect

Wagtail keeps a log of search queries that are popular on your website. On high traffic websites, this log may get big and you may want to clean out old search queries. This command cleans out all search query logs that are more than one week old (or a number of days configurable through the WAGTAILSEARCH_HITS_MAX_AGE setting).

Translations

There are two kinds of translations:

Add a new language

Preparation:

  • Add new language to LANGUAGES in config/settings/common.py
  • Define a link (e.g. de_link) for the new language in wocat/cms/translation.py, also add field FilterField in search_fields.

Source code translation - Create po file:

  • Add new translations to PO file (e.g. DE for german)

    $ python manage.py makemessages -l <LANGUAGE>

CMS translation - Copy page tree:

  • To copy the entire page tree into a new language, use the following management command:

    Note

    On WOCAT Live, translation pages are currently deactivated. Once page tree is copied, remove feature toggle FEATURE_SHOW_TRANSLATIONS.

    python manage.py create_translation_tree

    This command can also be used to copy a single page within the tree (just modify the defaults).