1. Домой
  2. Документы
  3. Smarty (English version)
  4. Smarty configuring and management
  5. System parameters

System parameters

These settings must be specified in the Smarty configuration file /etc/microimpuls/smarty/smarty.py, or in your custom configuration file. The file is based on Python syntax.

Attention! In order for the changes to take effect, you must restart uWSGI. Rebooting uWSGI can be carried out with the sudo service uwsgi restart command.

General settings

  • DEBUG — enable debugging mode. If errors occur, expanded error stacktraces will be shown in the browser. Data type: bool. Default is False.
  • TIME_ZONE — server time zone according to IANA naming. Data type: string. Default is Europe/Moscow.
  • SECRET_KEY — unique secret key of the instance. Used to securely cache secret data during operation progress. Don’t forget to change the SECRET_KEY parameter to a unique value. Data type: string.
  • BILLING_CLIENTS_EXCLUDE — disables built-in billing (check_accounts and make_autopayments commands) for certain Client IDs. Data type: list.
  • UWSGI_THREADING_ENABLED — enables the use of uWSGI threads instead of native ones when executing some background tasks, which prevents them from ending erroneously when cleaning up resources after making a request to the server. We recommend using this option when cache invalidation errors are detected after executing queries. Requires enable-threads option to be enabled in uWSGI configuration.

Setting example:

DEBUG = False

TIME_ZONE = «Europe/Moscow»

SECRET_KEY = «de2kpvtRn19EGXu8r93DB1CDCZTmW5yE194pY7PQiw2kI7z002e1aCapj5HYITiY»

BILLING_CLIENTS_EXCLUDE = [1, 2,]

List of enabled modules

  • INSTALLED_APPS — list of enabled modules. The list complements the base modules written in base.py through the += operation. Data type: list.

Setting example:

INSTALLED_APPS += (

    ‘viewstats’,

    ‘megogo’,

    ‘tvzavr’,

    ‘device_monitoring’,

    ‘custom’

)

Database connection settings

  • DATABASES — in this array the connection to the DBMS is configured. When using several DBMSs for replication, you must separately configure the connection to each of them, setting a unique name for each connection. Data type: dict.

Setting example:

DATABASES = {

    ‘default’: {

        ‘ENGINE’: ‘django.db.backends.mysql’,

        ‘NAME’: ‘smarty’,

        ‘USER’: ‘root’,

        ‘PASSWORD’: ‘jAE427aAyzVA8k8p’,

        ‘HOST’: ‘192.168.77.150’,

        ‘PORT’: »,

    }

}

Path and address settings

  • SMARTY_URL — full URL to the Smarty instance. Used to generate full URLs to the API and affects the operation of Smarty and modules at a low level. Data type: string. By default is http://smarty.example.com.
  • MEDIA_BASE_URL — full URL that is used in API responses as the base path to images and static resources, such as TV channel icons, EPG thumbnails, or movie covers. In the basic version, it can be equal to the SMARTY_URL value. Data type: string.
  • TVMIDDLEWARE_PORTAL_DOMAIN — name of the domain on which the portal for STB and Smart TV device types is located. Used for auxiliary information purposes only and does not affect the operation of the application. Data type: string. By default example.com.
  • TVMIDDLEWARE_API_URL — full URL to the TVMW API for use in the portal and applications. Used to generate full URLs to the API and affects the operation of Smarty and modules at a low level. Data type: string. The default is http://smarty.example.com/tvmiddleware/api. For a multi-domain installation, you can use the relative /api value.

Setting example:

SMARTY_URL = ‘http://smarty.example.com:8180’

MEDIA_BASE_URL = ‘http://smarty.example.com:8180’

TVMIDDLEWARE_PORTAL_DOMAIN = ‘example.com’

TVMIDDLEWARE_API_URL = ‘/api’

Customer and account behavior settings

  • TVMIDDLEWARE_CUSTOMER_LOG_ENABLED — enables logging of customer activity in the database. Data type: bool. Default is False.
  • TVMW_REGISTRATION_DEFAULT_TARIFFS_LOCATION_FILTER — enables filtering of the enabled by default tariffs by registration geolocation. If the value is True, at the time of registration of a new customer, they will be connected to tariffs marked as “Connected by default” and corresponding to their geolocation (fields “Available in cities” or “Available in countries” in the tariff form). Otherwise, geolocation will be ignored during registration. Data type: bool. Default: True.

Setting example:

TVMIDDLEWARE_CUSTOMER_LOG_ENABLED = True

TVMW_REGISTRATION_DEFAULT_TARIFFS_LOCATION_FILTER = True

TV and EPG behavior settings

  • TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_PAST — depth of EPG search into the past in days. Used for content search queries. If a large value is used, the search will take longer and use more resources of the database server and Middleware. Data type: int. Default is 1.
  • TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_FUTURE — depth of EPG search into the future in days. Used for content search queries. If a large value is used, the search will take longer and use more resources of the database server and Middleware. Data type: int. Default is 1.
  • TVMIDDLEWARE_PROGRAM_LIST_SEARCH_LIMIT_RESULTS_TO — maximum number of results that will be returned by the server for a program search query(ProgramListSearch API method). Data type: int. Default is 20.
  • TVMIDDLEWARE_RECOMMENDATIONS_ENABLED — enable the “Recommended” category in the “TV by interests” section. Data type: bool. Default is False.
  • TVMW_CONSIDER_PROGRAM_CATEGORY — if False, then in the output of the API method ProgramCategoryChannelList (“TV by interests”), the dynamic category of the current program is not taken into account, and the list of channels is formed only based on the fixed EpgChannel category. Data type: bool. Default is True.
  • TVMW_DISABLE_MULTICAST_SMARTTV — if True, channels with multicast addresses for Smart TV will be hidden. Data type: bool. Default is True.
  • TVMW_DISABLE_MULTICAST_MOBILE — if True, channels with multicast addresses for mobile devices will be hidden. Data type: bool. Default is True.
  • TVMIDDLEWARE_CHANNEL_LIST_MAX_ACCOUNTS_PER_MINUTE — the speed of setting the flag for the need to update the list of channels for accounts, regulates the maximum number of accounts per minute to which this flag is set (works only when the smarty_rq mechanism is enabled). Data type: int. Default is 1000.
  • RQ_CHANNEL_LIST_CHANGED_JOB_TIMEOUT — maximum operating time of RQ in the process of setting the flag for the need to update the list of channels for accounts. Data type: int. Default is 3600.
  • TVMW_EPG_DO_NOT_IMPORT_UNUSED —  this option allows you to disable the import of unused EPG channels and speed up the operation of the epg_import command. Data type: bool. Default is False.
  • TVMW_EPG_SAVE_MULTIPLE_CATEGORIES — whether to save all transmission categories that are described in XMLTV when importing EPGs. If False, only the first category found will be saved. The option is present to ensure backward compatibility with older versions of applications. Data type: bool. Default is True.
  • TVMW_EPG_IMPORT_ALLOW_PARSER_HANDLING — allows you to transfer import control to the parser during EPG import; if enabled, the parser may not load the EPG under certain conditions; it must be disabled if the EPG does not load for some reason. Default is True.
  • TVMW_EPG_OPTIMIZE_DUMMY_SOURCE — enables simplified import that does not recreate existing programs. Default is False.
  • TVMW_EPG_DEFAULT_ASPECT_RATIO — specifies the default aspect ratio for imported program thumbnails. If there is no thumbnail with the default ratio, the first corresponding thumbnail is loaded. Possible values: 16:9, 4:3, 2:3. Data type: string. Default is 4:3.
  • TVMW_SELECTION_PREVIEW_ASPECT_RATIO — specifies the size of the returned thumbnails for selection-related methods. Data type: string. Default is None (when None is set to TVMW_EPG_DEFAULT_ASPECT_RATIO).
  • TVMW_EPG_PREVIEW_MAX_WIDTH — limit the length of the thumbnail image of a program with a resolution of 4×3. Warning: in order for this option to work, you must enable the conversion of thumbnails and channel icons in the EPG source. The image is compressed based on parameters predetermined by the following conditions: if the size of any side of the original image exceeds the specified boundaries, then the image is compressed in proportion to the specified condition (for example, if there is an original image of 1000×500 and a limit of 500×500, it is compressed to 500×250). Data type: int. Default is 300.
  • TVMW_EPG_PREVIEW_MAX_HEIGHT — limit the height of the thumbnail image of a program with a resolution of 4×3. Warning: in order for this option to work, you must enable the conversion of thumbnails and channel icons in the EPG source. The image is compressed based on parameters predetermined by the following conditions: if the size of any side of the original image exceeds the specified boundaries, then the image is compressed in proportion to the specified condition (for example, if there is an original image of 1000×500 and a limit of 500×500, it is compressed to 500×250). Data type: int. Default is 300.
  • TVMW_EPG_PREVIEW_MAX_WIDTH_16_9 — limit the length of the thumbnail image of a program with a resolution of 16×9. Warning: in order for this option to work, you must enable the conversion of thumbnails and channel icons in the EPG source. The image is compressed based on parameters predetermined by the following conditions: if the size of any side of the original image exceeds the specified boundaries, then the image is compressed in proportion to the specified condition (for example, if there is an original image of 1000×500 and a limit of 500×500, it is compressed to 500×250). Data type: int. Default is 300.
  • TVMW_EPG_PREVIEW_MAX_HEIGHT_16_9 — limit the height of the thumbnail image of a program with a resolution of 16×9. Warning: in order for this option to work, you must enable the conversion of thumbnails and channel icons in the EPG source. The image is compressed based on parameters predetermined by the following conditions: if the size of any side of the original image exceeds the specified boundaries, then the image is compressed in proportion to the specified condition (for example, if there is an original image of 1000×500 and a limit of 500×500, it is compressed to 500×250). Data type: int. Default is 300.

Setting example:

TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_PAST = 1

TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_FUTURE = 3

TVMIDDLEWARE_PROGRAM_LIST_SEARCH_LIMIT_RESULTS_TO = 20

TVMW_EPG_DO_NOT_IMPORT_UNUSED = True

TVMW_EPG_DEFAULT_ASPECT_RATIO = ‘2:3’

TVMW_SELECTION_PREVIEW_ASPECT_RATIO = ’16:9′

TVMW_EPG_PREVIEW_MAX_WIDTH = 300

TVMW_EPG_PREVIEW_MAX_HEIGHT = 300

TVMW_EPG_PREVIEW_MAX_WIDTH_16_9 = 300

TVMW_EPG_PREVIEW_MAX_HEIGHT_16_9 = 300

VOD and online cinema behavior settings

  • TVMIDDLEWARE_VIDEO_NEW_DAYS — the period in days from the date the movie was added, during which the added movie is considered new and is displayed in the corresponding section in the customer’s applications. Data type: int. Default is 60.
  • TVMIDDLEWARE_VIDEO_PREMIERE_DAYS —  the period in days from the date of the film’s premiere, during which the film is considered a premiere and is displayed in the corresponding section in the customer’s applications. Data type: int. Default is 90.
  • TVMIDDLEWARE_CONTENT_POSITION_TTL_DAYS_VIDEO —  the period in days during which it is necessary to store saved video viewing positions on the server in order to be able to offer a customer to continue watching from the previous position. Data type: int. Default is 30.
  • TVMIDDLEWARE_CONTENT_POSITION_TTL_DAYS_PROGRAM — the period in days during which it is necessary to store saved program viewing positions on the server in order to be able to offer a customer to continue viewing from the previous position. Data type: int. Default is 30.
  • TVMIDDLEWARE_VIDEO_IS_VIEWED_TO_END_THRESHOLD_PERCENTAGE — sets the threshold (in percentage) of the remaining time until the end of the movie, upon reaching which the movie is considered viewed. Data type: int. Default is 1.
  • TVMIDDLEWARE_VIDEO_EXTERNAL_API_REQUIRED — if True, the “External ID” and “API Handler” fields in the movie creation form will be required. Data type: bool. Default is False.
  • EXTERNAL_API_VIDEO_CHECK_BALANCE_REQUEST — when True, a billing alert is enabled during a balance check (by calling the perform_subscr_action_in_default_video_api_client method with action=’check_balance’), an option relevant for operators with external billing integration.
  • TVMIDDLEWARE_VIDEO_ACTORS_EXTENDED_UPDATE —  when downloading films from a third-party source, additional information about actors will be automatically loaded. Data type: bool. Default is True.
  • TVMIDDLEWARE_MOVIEDB —  select a movie database that is used to fill in information about added movies. Available values: kinopoisk, tmdb, kinopoisk_api_unofficial. Data type: string. Default is kinopoisk.
  • TVMIDDLEWARE_TMDB_API_KEY —  API key for working with the themoviedb.org database (located on the account page of themoviedb.org website in the Settings section). Data type: string.
  • TVMIDDLEWARE_KINOPOISK_API_UNOFFICIAL_API_KEY — key for accessing the Kinopoisk Api Unofficial API https://kinopoiskapiunofficial.tech/
  • TVMW_VIDEO_LIST_SEARCH_BY_RELEVANCE — enables a search by relevance in search queries, in which the list of movies in the response will be sorted by the position of the search string: first, movies are returned where the search character set is in the first positions. Warning: in search results, the space character is taken into account; if a space is typed at the end of the search string, then the response will only include those films in which one of the words ends in a match to the search string (a space at the beginning of the search query is also taken into account). Data type: bool. Default is False.

PVR behavior settings

  • TVMIDDLEWARE_VODPVR_TIMEOUT_OFFSET — determines how long before deleting an archived record they should disappear from the output for clients in hours. Data type: int. Default is 2.
  • TVMW_DONT_USE_ENDLESS_WRT — when True, the addition of the endless=1 flag for WRT set-top boxes in links to video streams is disabled. Data type: bool. Default is False.
  • TVMIDDLEWARE_PROGRAM_RECORD_ONLY_FINISHED — when True in the API method for obtaining a list of records in the “Archive” screen, unfinished programs will not be passed. Data type: bool. Default is False.

Account and device authorization settings

  • TVMIDDLEWARE_CLEAN_OLD_SESSIONS_DAYS — lifetime of an authorization session in days. If the session was not online during this period, it will be automatically deleted. Data type: int. Default is 3650.
  • TVMIDDLEWARE_MULTILOGIN_ENABLED —  enables or disables the multilogin mechanism (an account with unlimited authorization capabilities) in Smarty. Data type: bool. Default is True.
  • TVMW_USE_DIRECT_AUTHKEY_GENERATOR — if True, then during authorization the generator of the Direct type will be used instead of the Secondary for unregistered device types. Data type: bool. Default is False.
  • TVMW_REGISTRATION_SAVE_MOBILE_PHONE — saves the phone number used during registration. Data type: bool. Default is True.
  • RANDOM_NEXT_ABONEMENT — flag for switching the account number generation mode when creating accounts. When set to False, the number of each new account is equal to the increment of the maximum account number value among client accounts; when set to True, the account number is generated randomly (six digits). Data type: bool. Default is False.
  • TVMW_REGISTRATION_SUBNETS_FOR_CAPTCHA — sets a list of subnets from which users will be shown a captcha when registering. Data type: array. Default is [‘0.0.0.0/0’].
  • TVMW_UPDATE_PHONE_NUMBER_ON_REGISTER — when True, when trying to register an account on a device already registered in Smarty, a new account is not created, and the specified phone number is added to the current device account. Data type: bool. Default is False.
  • TVWM_MULTILOGIN_CREATE_DEVICE — when True, during authorization from an account with a multilogin set in Smarty, a linked device is created. Data type: bool. Default is False.
  • TVMW_REMOVE_DUPLICATE_UID_ON_LOGIN — if True, when the Login method is called, duplicate devices with the same UID are deleted. Does not work in conjunction with the TVWM_REBIND_DEVICE_ON_LOGIN option. Data type: bool. Default is False.
  • TVWM_REBIND_DEVICE_ON_LOGIN — when True, the authorization method does not return an error stating that a device is already linked to another account, but instead unlinks the device from the old account and links it to the new one. Data type: bool. Default is False.
  • TVMIDDLEWARE_API_ALLOW_ACCOUNT_REGISTER — when False, the ability to register new users through the TVMW API is blocked. Data type: bool. Default is True.
  • TVMW_UPDATE_IP_IN_REALTIME — when True, an account’s IP and geolocation are updated with any API request. Data type: bool. Default is False.
  • TVMIDDLEWARE_LOGIN_TYPE_PRIORITY_ORDER — setting the order for checking the authorization type. Used to determine the type of authorization when requesting said authorization in the TVMW API. When authorizing in the TVMW API, Smarty checks the data passed to the corresponding API method to ensure that the conditions of each authorization type are satisfied in order. The first type whose condition is satisfied by the passed data will be accepted. Valid values for authorization types:
    • multilogin — multilogin (if it is enabled and available for the account)
    • ip — authorization based on the IP address of the request source. Does not take into account restrictions on the number of device sessions
    • basic_device — basic type device
    • secondary_device — secondary type device

By default:

TVMIDDLEWARE_LOGIN_TYPE_PRIORITY_ORDER = [

   ‘multilogin’,

   ‘ip’,

   ‘basic_device’,

   ‘secondary_device’,

]

Smarty internal billing settings

  • TVMIDDLEWARE_API_ALLOW_UNSUBSCRIBE_BASIC — enables the ability to disable basic tariffs via the TVMiddleware API (via client applications); without this option, Smarty billing only allows you to replace one basic tariff with another.
  • TVMW_ACTIVATE_CUSTOMERS_ON_FIRST_PAYMENT — activates customers upon first payment. Data type: bool. Default is False.
  • TVMW_ACTIVATE_REGISTERED_BY_DEFAULT — determines the status of the “active” parameter for accounts registered through the TVMW API. Data type: bool. Default is False.
  • TVMW_MAXIMUM_PAYMENT_LIMIT — sets a limit for the maximum amount of financial transactions. Data type: int. Default is 5000.
  • TVMW_DISPLAY_HIDDEN_TARIFFS_WITH_PRICE — if True, TVMW API methods return hidden tariffs if they have a non-zero cost. Data type: bool.

Streaming and routing settings

  • TVMIDDLEWARE_STREAM_SERVICE_TOKEN_TTL — lifetime of a one-time token for authorization of streaming services in seconds. After this time has passed, a renewal mechanism is triggered for the token, if this is supported in the video server used (for example, Spectr or Flussonic). Data type: int. Default is 3600 (60 minutes).
  • TVMIDDLEWARE_STREAM_SERVICE_TOKEN_MAX_TTL — maximum token lifetime in seconds, after which no renewal is carried out. Data type: int. Default is 10800 (180 minutes).
  • TVMIDDLEWARE_STREAM_SERVICE_TOKEN_PROLONGATION_THRESHOLD_TTL — the threshold value of the remaining token lifetime in seconds, after which the extension is carried out. Data type: int. Default is 360 (6 minutes).
  • TVMIDDLEWARE_STREAM_SERVICE_AUTH_DURATION — time interval after which the token is rechecked in Flussonic. Specified in seconds. Data type: int. Default is 180 (3 minutes).
  • TVMW_ARCHIVE_MINIMUM_PLAYLIST_DURATION ­– this option affects the $pet (program end time) parameter in the mask of PVR-type streaming services. This is necessary to prevent Smarty from returning a playlist that is too short if the current show is ending soon. Data type: int. Default is 10000.

Widgets and external applications settings

  • TVMIDDLEWARE_WEATHER_WIDGET_OPENWEATHERMAP_CITY —  name of the city in English (for example, Moscow), for which the default weather forecast will be shown in the corresponding widget in the customer’s applications. The city must exist in the OpenWeatherMap service. Data type: string.
  • TVMIDDLEWARE_WEATHER_WIDGET_OPENWEATHERMAP_APPID —  App ID in the OpenWeatherMap service, used in queries to the service API when requesting a weather forecast. Data type: int.
  • TVMIDDLEWARE_WEATHER_WIDGET_CACHE_TIMEOUT — time in seconds for which the result of a weather forecast request must be cached. Used to reduce the number of requests. Data type: int. Default is 900.
  • WEATHER_DEFAULT_BACKEND — the default weather forecast information source backend. Data type: string. Possible values: openweathermap, gismeteo, yahoo, fobos. Default is openweathermap.
  • WEATHER_GISMETEO_TOKEN — token for the Gismeteo service. Data type: string.
  • WEATHER_FOBOS_USER — username for the Fobos weather forecast service. Data type: string.
  • WEATHER_FOBOS_PASS — password for the Fobos weather forecast service. Data type: string.
  • TVMIDDLEWARE_EXCHANGE_WIDGET_CACHE_TIMEOUT — time in seconds for which the result of the currency rate request must be cached. Used to reduce the number of requests. Data type: int. Default is 7200.
  • TVMIDDLEWARE_EXCHANGE_WIDGET_FIRST_CURRENCY — the first currency for the exchange rates widget in the portal (see http://www.cbr.ru/scripts/Root.asp?PrtId=SXML). Data type: string. Default is USD.
  • TVMIDDLEWARE_EXCHANGE_WIDGET_SECOND_CURRENCY — the second currency for the exchange rates widget in the portal. Data type: string. Default is EUR.
  • TVMIDDLEWARE_EXCHANGE_WIDGET_COUNTRY_CODE — country code. Depending on this, the data source for exchange rates will be selected. Data type: string. Possible values: RU (http://www.cbr.ru/scripts/XML_daily.asp), KG (http://www.nbkr.kg/XML/daily.xml), EE (https://www.eestipank .ee/en/exchange-rates/export/xml/latest). Default is RU.
  • TVMIDDLEWARE_RSS_WIDGET_CACHE_TIMEOUT — time in seconds for which the result of an RSS feed request must be cached. Used to reduce the number of requests. Data type: int. Default is 900.
  • TVMIDDLEWARE_RSS_WIDGET_REQUEST_TIMEOUT — time in seconds during which a response from the external news service is expected. Data type: int. Default is 3.

Operator logos, channel icons and content covers settings

  • MEDIA_ROOT — absolute path to the directory in which static files (css, images, js) are located. Data type: string. The default is the media directory in the Smarty root.
  • UPLOAD_URL — relative path to the directory for the downloaded content (the absolute path is defined as the concatenation of MEDIA_ROOT and UPLOAD_URL). Data type: string. Default is /upload.
  • TVMW_CLIENT_LOGO_MAX_HEIGHT — maximum height of the operator’s logo. The uploaded logo will be compressed to this size. Data type: int. Default is 240.
  • TVMW_CLIENT_LOGO_MAX_WIDTH — maximum width of the operator logo. The uploaded logo will be compressed to this size. Data type: int. Default is 320.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_MAX_HEIGHT — maximum height of the main logo in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 240.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_MAX_WIDTH — maximum width of the main logo in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 320.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_LOGIN_MAX_HEIGHT — maximum height of the logo for the login screen in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 240.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_LOGIN_MAX_WIDTH — maximum width of the logo for the login screen in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 320.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_LOADING_MAX_HEIGHT — maximum height of the logo for the loading screen in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 240.
  • TVMW_CLIENT_PLAY_DEVICE_LOGO_LOADING_MAX_WIDTH — maximum width of the logo for the loading screen in the customer application. The uploaded logo will be compressed to this size. Data type: int. Default is 320.
  • TVMW_VIDEO_POSTER_BIG_MAX_HEIGHT — maximum height of the VOD movie cover. The uploaded cover will be compressed to this size. Data type: int. Default is 800.
  • TVMW_VIDEO_POSTER_BIG_MAX_WIDTH — maximum width of the VOD movie cover. The uploaded cover will be compressed to this size. Data type: int. Default is 800.
  • TVMW_VIDEO_POSTER_SMALL_MAX_HEIGHT — maximum height of the VOD movie preview cover. The uploaded cover will be compressed to this size. Data type: int. Default is 300.
  • TVMW_VIDEO_POSTER_SMALL_MAX_WIDTH — maximum width of the VOD movie preview cover. The uploaded cover will be compressed to this size. Data type: int. Default is 300.
  • TVMW_VIDEO_FILE_PROMO_IMAGE_MAX_HEIGHT — maximum height of the promo image of a video asset in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 720.
  • TVMW_VIDEO_FILE_PROMO_IMAGE_MAX_WIDTH — maximum width of the promo image of a video asset in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 1280.
  • TVMW_VIDEO_SCREENSHOT_BIG_MAX_HEIGHT — maximum height of the screenshot of a video asset in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 720.
  • TVMW_VIDEO_SCREENSHOT_BIG_MAX_WIDTH — maximum width of the screenshot of a video asset in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 1280.
  • TVMW_VIDEO_SCREENSHOT_BLUR_RADIUS — blur radius applied to video asset screenshots when loading. Data type: int. Default is 4.
  • TVMW_EXAPP_ICON_MAX_HEIGHT — maximum height of a third-party application icon. The uploaded image will be compressed to this size. Data type: int. Default is 600.
  • TVMW_EXAPP_ICON_MAX_WIDTH — maximum width of a third-party application icon. The uploaded image will be compressed to this size. Data type: int. Default is 900.
  • TVMW_ACTOR_PHOTO_MAX_HEIGHT — maximum height of an actor’s photo in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 800.
  • TVMW_ACTOR_PHOTO_MAX_WIDTH — maximum width of an actor’s photo in VOD. The uploaded image will be compressed to this size. Data type: int. Default is 800.
  • TVMIDDLEWARE_CACHE_EXISTING_ICONS — enable caching of data on the sizes of existing icons. Necessary for sending icons of the correct sizes for devices. Data type: bool. Default is False.
  • SMARTY_DEFAULT_ICON_SIZE — standard size of a TV channel icon for loading into the EPG Channel. Data type: tuple.
  • SMARTY_DEFAULT_ICON_SIZES — list of additional sizes for TV channel icons. Each value must be a tuple of two integer values. Maximum of 3 additional sizes. Data type: list of tuples.

Setting example:

SMARTY_DEFAULT_ICON_SIZE = (500, 500)

SMARTY_DEFAULT_ICON_SIZES = [(120, 91), (40, 40)]

Advertising integration settings

  • TVMIDDLEWARE_ADS_ENABLED — when True, the ads parameter will be returned in the ChannelUrl and ProgramUrl API methods. Necessary for the functionality of advertisement sections and videos in templates that support this. May reduce Smarty performance when there is a large number of users per server. Data type: bool. Default is False.
  • MONGODB_ADS_HOST — MongoDB server address for collecting statistics. Default is ‘127.0.0.1’.
  • MONGODB_ADS_PORT — MongoDB server port. Default is 27017.
  • MONGODB_ADS_NAME — name of the database. Default is ‘smarty_device_monitoring’.
  • MONGODB_ADS_USERNAME — username for authorization. Default is ‘admin2’.
  • MONGODB_ADS_PASSWORD — password for authorization. Default is ‘password2’.
  • MONGODB_ADS_PUSH_TIMEOUT — connection timeout. Default is 150.
  • MONGODB_ADS_AUTH_METHOD — authorization method. The authorization method depends on the MongoDB version. Default is ‘MONGODB-CR’.
  • ADS_ADSTREAM_DEVMODE — this option allows you to enable the delivery of test commercials from the AdStream advertising provider. Data type: bool. Default is False.
  • ADS_ADSTREAM_HOST_REPLACE — host of the commercials caching server for ADStream. Some advertising providers recommend caching videos on the operator’s side to deliver them to users; for these purposes, you can use nginx, and the new host from which the commercials will be delivered must be entered in this field, so Smarty will automatically replace the advertising provider’s host with the given one. This measure will also avoid ad blocking by browsers.
  • ADS_QVOL_HOST_REPLACE — host of the commercials caching server for Qvol. Some advertising providers recommend caching videos on the operator’s side to deliver them to users; for these purposes, you can use nginx, and the new host from which the commercials will be delivered must be entered in this field, so Smarty will automatically replace the advertising provider’s host with the given one. This measure will also avoid ad blocking by browsers.
  • ADS_EPG_USE_CATEGORIES_AS_GENRES — to target, the advertising provider needs to know what genre is currently being broadcast on the channel for which a commercial is requested. In case your EPG provider does not provide genres for programs, set this option to True and EPG categories will be used instead of genres. Default value: False.
  • ADS_DEFAULT_CITY — sets the default city value for advertising. Necessary for working with external advertising sources. Used if an account’s city is not automatically detected. Data type: string.

Smarty control panel settings

  • TVMIDDLEWARE_DISABLE_PAGINATION — disables counting the number of objects during pagination in some lists in the admin panel. Data type: bool. Default is False.
  • TVMIDDLEWARE_CHANNEL_AUTOSORT — allows you to disable the automatic channel sorting function in Smarty if you set the value []. Data type: list.
  • TVMW_PREVENT_CASCADE_DELETION — when True, prohibits deleting objects in Smarty through the admin panel if the objects have child related objects. If set to False, deleting of such objects is allowed, but child objects will not be deleted. Data type: bool. Default is False.
  • TVMW_ENABLE_LINK_TO_CUSTOMER_ON_ACCOUNTS_PAGE — if True, on the account list page in the admin panel, a link to edit a customer will be displayed in the “customer” column. Otherwise, just the customer’s name. Data type: bool. Default is False.
  • DEALERS_DISPLAY_MANUAL_ACCOUNT_ACTIVATION_DATE — enable/disable the ability to manually enter activation and deactivation dates on the dealer’s account page. Data type: bool. Default is False.
  • MONGODB_REPORT_TIMEOUT — timeout for creating reports from the administration panel, in seconds. Necessary to reduce the load on MongoDB. Data type: int. Default is 600000.
  • BILLING_ACCURATE_SUBSCRIPTIONS — when True, the exact creation time must be specified for created subscriptions (otherwise the time is displayed as 12:00). Available in new billing logic. Data type: bool. Default is False.

Setting example:

TVMIDDLEWARE_CHANNEL_AUTOSORT = [«sort_auto», «sort_id», «sort_alphabet», «sort_user», «sort_lcn»]

Caching settings

TVMW_USE_TARIFF_LCN — option with which you can disable the formation of a channel cache with filtering by LCN according to tariffs. If the operator does not use channel sorting by LCN, this option can significantly reduce the amount of cache. Data type: bool. Default is True.