steemengine.settings (Django Settings)

Submodules

steemengine.settings.core module

This file contains the core settings of the application. Settings specified within this file are used directly by the Django framework, or a third-party extension / application for Django.

User specifiable environment variables:

Basic Config

  • DEBUG - If set to true, enable debugging features, such as extremely verbose error pages and automatic code reloading on edit. DO NOT RUN WITH DEBUG IN PRODUCTION, IT IS NOT SAFE.

    Default: False

  • SECRET_KEY - MANDATORY - A long random string used to encrypt user sessions, among other security features.

  • CORS_ORIGIN_ALLOW_ALL - If True, allow all cross-origin requests (disable whitelist). Default: True

  • CORS_ORIGIN_WHITELIST - Comma separated list of domains and subdomains to allow CORS for. Adding a domain does not automatically include it’s subdomains. All subdomains must be added manually. Default: Blank

  • ALLOWED_HOSTS - Comma separated list of the domains you intend to run this on. For security (e.g. preventing cookie theft), Django requires that you specify each hostname that this application should be accessible from. Default: 127.0.0.1,localhost (these are also auto added if DEBUG is True).

Database Settings

  • DB_BACKEND - What type of DB are you using? mysql or postgresql Default: postgresql
  • DB_HOST - What hostname/ip is the DB on? Default: localhost
  • DB_NAME - What is the name of the database to use? Default: steemengine_pay
  • DB_USER - What username to connect with? Default: steemengine
  • DB_PASS - What password to connect with? Default: no password

For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/

Copyright:

+===================================================+
|                 © 2019 Privex Inc.                |
|               https://www.privex.io               |
+===================================================+
|                                                   |
|        CryptoToken Converter                      |
|                                                   |
|        Core Developer(s):                         |
|                                                   |
|          (+)  Chris (@someguy123) [Privex]        |
|                                                   |
+===================================================+

steemengine.settings.custom module

This file contains settings that are specific to CryptoToken Converter, and do not affect the core Django framework.

User specifiable environment variables:

  • STEEM_RPC_NODES - Comma-separated list of one/more Steem RPC nodes. If not set, will use the default beem nodes.
  • BITSHARES_RPC_NODE - Node to use to connect to Bitshares network if Bitshares coin handler is enabled. If not set, will default to wss://eu.nodes.bitshares.ws
  • EX_FEE - Conversion fee taken by us, in percentage (i.e. “1” = 1%) Default: 0 (no fee)
  • COIN_HANDLERS - A comma separated list of Coin Handler modules to load. Default: SteemEngine,Bitcoin
  • COIN_HANDLERS_BASE - If your coin handlers are not located in payments.coin_handlers then you may change this to point to the base module where your coin handlers are located.
  • LOWFUNDS_NOTIFY - If you’re using the low wallet balance notifications, you can change how often it re-notifies the admin emails ADMINS if the balance is still too low to fulfill a conversion. (in hours). Default: 12 (hours)

Copyright:

+===================================================+
|                 © 2019 Privex Inc.                |
|               https://www.privex.io               |
+===================================================+
|                                                   |
|        CryptoToken Converter                      |
|                                                   |
|        Core Developer(s):                         |
|                                                   |
|          (+)  Chris (@someguy123) [Privex]        |
|                                                   |
+===================================================+
steemengine.settings.custom.COIN_HANDLERS = ['SteemEngine', 'HiveEngine', 'Bitcoin', 'Steem', 'Hive', 'EOS', 'Telos', 'Bitshares', 'Appics']

Specify in the env var COIN_HANDERS a comma separated list of local coin handlers payments.coin_handlers to load. If not specified, the default list will be used.

steemengine.settings.custom.COIN_HANDLERS_BASE = 'payments.coin_handlers'

Load coin handlers from this absolute module path

steemengine.settings.custom.COIN_TYPES = (('crypto', 'Generic Cryptocurrency'), ('token', 'Generic Token'))

This is used for the dropdown “Coin Type” selection in the Django admin panel. Coin handlers may add to this list.

steemengine.settings.custom.ENCRYPT_KEY = None

Used for encrypting and decrypting private keys so they cannot be displayed in plain text by the admin panel, or external applications accessing the DB. Generate an encryption key using ./manage.py generate_key. To print just the key, use ./manage.py generate_key 2> /dev/null

steemengine.settings.custom.EX_FEE = Decimal('0')

Conversion fee taken by us, in percentage (i.e. “1” = 1%)

steemengine.settings.custom.LOWFUNDS_RENOTIFY = 12

After the first email to inform admins a wallet is low, how long before we send out a second notification? (in hours) (Default: 12 hrs)

steemengine.settings.custom.PRIVEX_HANDLERS = ['Golos']

These handlers are from the :py:my:`privex.coin_handlers` package, so they’re loaded differently to the handlers listed in COIN_HANDLERS

steemengine.settings.log module

Logging configuration for CryptoToken Converter.

Valid environment log levels (from least to most severe) are:

DEBUG, INFO, WARNING
ERROR, FATAL, CRITICAL

User customisable environment variables are:

  • CONSOLE_LOG_LEVEL - Messages equal to and above this level will be logged to the console (i.e. the output of manage.py commands such as runserver or load_txs) Default: INFO in production, DEBUG when DEBUG setting is true
  • DBGFILE_LEVEL - Messages equal to and above this level will be logged to the debug.log files. Default: INFO in production, DEBUG when DEBUG setting is true.
  • ERRFILE_LEVEL - Same as DBGFILE_LEVEL but for error.log - Default: WARNING
  • LOGGER_NAMES - A comma separated list of logger instance names to apply the default logging settings onto. Default: privex (Use same logging for Privex’s python packages)
  • BASE_LOGGER_NAME - The logger instance name to use for the main logger. If this is not specified, or is blank, then the logging API “RootLogger” will be used, which may automatically configure logging for various packages.
  • BASE_LOG_FOLDER - A relative path from the root of the project (folder with manage.py) to the folder where log files should be stored. Default: logs
  • BASE_WEB_LOGS - Relative path from BASE_LOG_FOLDER where logs from the web app should be stored. Default: web
  • BASE_CRON_LOGS - Relative path from BASE_LOG_FOLDER where logs from scheduled commands (load_txs etc.) should be stored. Default: crons
steemengine.settings.log.config_logger(*logger_names, log_dir='/home/docs/checkouts/readthedocs.org/user_builds/cryptotoken-converter/checkouts/latest/logs')[source]

Used to allow isolated parts of this project to easily change the log output folder, e.g. allow Django management commands to change the logs folder to crons/

Currently only used by payments.management.CronLoggerMixin

Usage:

>>> config_logger('someapp', 'otherlogger', 'mylogger', log_dir='/full/path/to/log/folder')
Parameters:
  • logger_names (str) – List of logger names to replace logging config for (see LOGGER_NAMES)
  • log_dir (str) – Fully qualified path. Set each logger’s timed_file log directory to this
Returns:

logging.Logger instance of BASE_LOGGER

Module contents