Usage & Setting
Environmental Variables
ENV-KEY | Default Value / Data Type | Description |
---|---|---|
MAIN_HOST | "http://localhost" (any str) | Public/local-network facing main URL. Used for links e.g. for webpush push notifications e.g. "https://news.yourwebsite.com" or "http://19.168.172.100" |
HOSTS | "http://localhost,http://127.0.0.1/" (any str) | List of urls to access news platform from. Required to avoid CSRF errors from CSRF attack protection e.g. "http://localhost,http://127.0.0.1,http://0.0.0.0,http://docker-container-name,http://news.yourwebsite.com,https://news.yourwebsite.com" |
CUSTOM_PLATFORM_NAME | "Personal News Platform" (any str) | Name of news platform e.g. "John doe's Personal News Platform" |
SIDEBAR_TITLE | "Latest News" (any str) | Name of sidebar news section e.g. "News Ticker" |
TIME_ZONE | "Europe/London" (iso str per ICANN tz name) | Server time-zone as per official ICANN tz name e.g "Europe/Berlin" |
ALLOWED_LANGUAGES | "" (str list of ISO 639-2)* | List of languages in which articles are allowed e.g. "en,de". This is to exclude languages the user does not understand that might be from topic feeds e.g. all articles tagged with "Tech" which might be in English, German, Chines, Spanish etc. |
LANGUAGE_CODE | "en-UK" (two letter language-country ISO code) | ISO code of News Plattform's language and localization for internet browser e.g. "en-US" or "de-DE" |
FULL_TEXT_URL | "http://ftr.fivefilters.org/" (None or str url) | A local instance of fivefilters full-text-rss is required for full-text fetching currently - working on own full-text fetcher. |
FEED_CREATOR_URL | None (None or str url) | Local instance of fivefilters feed-creator if webpages don't have a rss feed to create an rss feed - working on own feed-creator. |
WEBPUSH_PUBLIC_KEY | " |
Get your own public & private keys for webpush push-notifications e.g. from web-push-codelab.glitch.me or follow these instructions Google Dev Documentation. |
WEBPUSH_PRIVATE_KEY | " |
Get your own public & private keys for webpush push-notifications e.g. from web-push-codelab.glitch.me or follow these instructions Google Dev Documentation. |
WEBPUSH_ADMIN_EMAIL | "news-platform@example.com" (str email address) | Email address to get notified in case something is wrong with the webpush push notification sending. |
OPENAI_API_KEY | None (str of openai api key or None) | Open AI API key for article summaries. |
SENTRY_URL | None (str of personal Sentry.io url) | Sentry.io error tracing DNS URL e.g. "https:// |
SECRET_KEY | " |
Django's production secret key. |
DEBUG | True (bool - currently only True working) | To run the news platform in production / dev modus. Currently the production modus does not work. |
TESTING | False (bool) | To run the news platform in real-life testing modus - i.e. fetiching only 10% of news sources to avoid waiting. |
FORCE_REFETCH | False (bool) | Refetches every article/video and connected feed_position. This might fix errors caused by container shutdowns during task execution. Should be manually re-set to False after one run. |
These environmental variables can be
- included in the dockercompose.yml file in section "environment:" as arguments (as above in the dockercompose.yml example),
- saved as an .env file (example) and passed to the docker_compose.yml file as argument "env_file: /your/local/dir/.env", or
- saved as an .env file (example) in the news platform container's data directory e.g. "/your/local/data/dir/news_platform/.env"