These settings must be specified in the Smarty configuration file /etc/microimpuls/smarty/smarty.py or in your custom configuration file. The file has Python syntax.
Attention! In order for the changes to take effect, you need to reboot uwsgi. Reboot uwsgi is carried out by the team sudo service uwsgi restart
General settings
DEBUG
includes debugging mode. If errors occur, deployed stacktrace errors in the browser will be shown. Data type: bool. By default False.
TIME_ZONE
time zone of the server according to the name IANA. Data type: string. By default Europe/Moscow.
SECRET_KEY
unique private key of the instance. Used for secure caching of secret data in the process. Don't forget to change the setting SECRET_KEY it has a unique meaning. Data type: string.
BILLING_CLIENTS_EXCLUDE
disables built-in billing (check_accounts and make_autopayments) for certain Client IDs. Data type: list.
UWSGI_THREADING_ENABLED
this includes using uWSGI streams instead of native ones when performing some background tasks, which prevents them from erroneously ending when clearing resources after a request to the server is executed. It is recommended to use this parameter when detecting cache disability errors after requests. Requires enable-threads enabled in the uWSGI configuration.
SMARTY_DEFAULT_LANGUAGE
Set the localization language of text variables returned from Smarty to client applications, which is used by default. Data type: string.
SMARTY_ADDITIONAL_LANGUAGES
Adds additional localization languages for text variables returned from Smarty to client applications. Data type: list.
Example of settings:
DEBUG = False
TIME_ZONE = "Europe/Moscow"
SECRET_KEY = "de2kpvtRn19EGXu8r93DB1CDCZTmW5yE194pY7PQiw2kI7z002e1aCapj5HYITiY"
BILLING_CLIENTS_EXCLUDE = [1, 2,]
SMARTY_DEFAULT_LANGUAGE = 'ru'
SMARTY_ADDITIONAL_LANGUAGES = [
'en',
]
LOG_REQUEST_TIME
includes logging the time of execution of commands, requests (parameter) runtime). Data type: bool. By default False.
List of modules included
INSTALLED_APPS
list of modules included. The list is supplemented by base.py basic modules via +=. Data type: list.
Example of settings:
INSTALLED_APPS += 'viewstats', 'megogo,' 'tvzavr,' 'device_monitoring', 'custom' )
Connection settings to DB
DATABASES
in this array, the connection to the DBMS is configured. When using several DBMS for replication, you need to separately configure the connection to each of them, setting a unique name for each connection. Data type: dict.
Example of settings:
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
the full URL to the Smarty instance. It is used to generate full URLs to the API and affects the performance of Smarty and low-level modules. Data type: string. By default http://smarty.example.com.
MEDIA_BASE_URL
a full URL that is used in API responses as a basic path to images and static resources, such as TV icons, EPG pictures or movie covers. In the basic version, it can be equal to the value SMARTY_URL. Data type: string.
TVMIDDLEWARE_PORTAL_DOMAIN
the domain name on which the portal for devices such as STB and Smart TV is located. Used only for auxiliary information purposes 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. It is used to generate full URLs to the API and affects the performance of Smarty and low-level modules. Data type: string. By default http://smarty.example.com/tvmiddleware/api. Relative value can be used for multidomain installation /api.
Example of settings:
SMARTY_URL = 'http://smarty.example.com:8180'
MEDIA_BASE_URL = 'http://smarty.example.com:8180'
TVMIDDLEWARE_PORTAL_DOMAIN = 'example.com'
TVMIDDLEWARE_API_URL = '/api'
Settings of behavior of subscribers and accounts
TVMIDDLEWARE_CUSTOMER_LOG_ENABLED
includes logging the activity of subscribers in the database. Data type: bool. By default False.
TVMW_REGISTRATION_DEFAULT_TARIFFS_LOCATION_FILTER
includes filtering of the default geolocation tariffs of registration. With the True value at the time of registration of a new subscriber, tariffs marked as “Default Connected” and corresponding to its geolocation will be connected to it (the fields “Available in cities” or “Available in countries” in the form of a tariff). Otherwise, geolocation will be ignored during registration. Data type: bool. By default True true.
Example of settings:
TVMIDDLEWARE_CUSTOMER_LOG_ENABLED = True TVMW_REGISTRATION_DEFAULT_TARIFFS_LOCATION_FILTER = True
Behavior settings TV and EPG
TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_PAST
depth of EPG search into the past in days. It is used when searching for content. When using a high value, the search will be carried out longer and use more resources of the database server and Middleware. Data type: int. By default 1.
TVMIDDLEWARE_PROGRAM_LIST_SEARCH_DAYS_FUTURE
depth of EPG search into the future in days. It is used when searching for content. When using a high value, the search will be carried out longer and use more resources of the database server and Middleware. Data type: int. By default 1.
TVMIDDLEWARE_PROGRAM_LIST_SEARCH_LIMIT_RESULTS_TO
the maximum number of results that will be returned by the server to the transmission search request (the API ProgramListSearch method). Data type: int. By default 20.
TVMIDDLEWARE_RECOMMENDATIONS_ENABLED
includes the category "Recommended" in the section "TV by interests". Data type: bool. By default False.
TVMW_CONSIDER_PROGRAM_CATEGORY
when the value of False in the issuance of the API-method ProgramCategoryChannelList (“TV by interests”), the dynamic category of the current transmission is not taken into account and the list of channels is formed only based on a fixed category EpgChannel. Data type: bool. By default True true.
TVMW_DISABLE_MULTICAST_SMARTTV
at True, channels with multicast addresses for Smart TVs will be hidden. Data type: bool. By default True true.
TVMW_DISABLE_MULTICAST_MOBILE
at True, channels with multicast addresses for mobile devices will be hidden. Data type: bool. By default True true.
UPDATE_CHANNEL_LIST_CHANGE
at True, it initiates a re-query of the channel list from subscribers after changing the channel list in the Smarty admin panel. Data type: bool. By default True true.
TVMIDDLEWARE_CHANNEL_LIST_MAX_ACCOUNTS_PER_MINUTE
the speed of flagging the need to update the list of channels of accounts, regulates the maximum number of accounts per minute, which displays this flag (works only with the mechanism on) smarty_rq). Data type: int. By default 1000.
RQ_CHANNEL_LIST_CHANGED_JOB_TIMEOUT
maximum time of RQ in the process of flagging the need to update the list of channels for accounts. Data type: int. By default 3600.
TVMW_EPG_DO_NOT_IMPORT_UNUSED
it allows you to disable the import of unused EPG channels and speed up the work of the epg_import team. Data type: bool. By default False.
TVMW_EPG_SAVE_MULTIPLE_CATEGORIES
determines whether to retain all transmission categories described in XMLTV when importing EPG. With the value of False, only the first category found will be retained. The option is present to ensure backward compatibility with older versions of applications. Data type: bool. By default True true.
TVMW_EPG_IMPORT_ALLOW_PARSER_HANDLING
allows the import control of the EPG to be transferred to the parser at the time of import, if enabled, then the parser may not load the EPG under certain conditions, it must be turned off if the EPG is not loaded for some reason. By default True true.
TVMW_EPG_OPTIMIZE_DUMMY_SOURCE
it includes simplified imports that do not recreate existing programs. By default False.
TVMW_EPG_DEFAULT_ASPECT_RATIO
specifies the standard aspect ratio for posters of imported programs. In the absence of a poster with a default ratio, the first corresponding poster is downloaded. Possible values: 16:9, 4:3, 2:3. Data type: string. By default 4:3.
TVMW_SELECTION_PREVIEW_ASPECT_RATIO
indicates the size of the returned posters for collection-related methods. Data type: string. By default None of them (with None the meaning is taken) TVMW_EPG_DEFAULT_ASPECT_RATIO).
TVMW_EPG_PREVIEW_MAX_WIDTH
limit the length of the transmission preview picture with a resolution of 4×3. WarningTo work, you need to enable the conversion of posters and channel icons in the EPG source. The image is compressed according to the parameters according to the following condition: if the size of any side of the original image exceeds the predetermined boundaries, then the image is compressed proportionally to the predetermined condition (for example, if the original image is 1000×500 and the limit is 500×500, it is compressed to 500×250). Data type: int. By default 300.
TVMW_EPG_PREVIEW_MAX_HEIGHT
limiting the height of the transmission preview picture with a resolution of 4×3. WarningTo work, you need to enable the conversion of posters and channel icons in the EPG source. The image is compressed according to the parameters according to the following condition: if the size of any side of the original image exceeds the predetermined boundaries, then the image is compressed proportionally to the predetermined condition (for example, if the original image is 1000×500 and the limit is 500×500, it is compressed to 500×250). Data type: int. By default 300.
TVMW_EPG_PREVIEW_MAX_WIDTH_16_9
limit the length of the transmission preview picture with a resolution of 16×9. WarningTo work, you need to enable the conversion of posters and channel icons in the EPG source. The image is compressed according to the parameters according to the following condition: if the size of any side of the original image exceeds the predetermined boundaries, then the image is compressed proportionally to the predetermined condition (for example, if the original image is 1000×500 and the limit is 500×500, it is compressed to 500×250). Data type: int. By default 300.
TVMW_EPG_PREVIEW_MAX_HEIGHT_16_9
limit the height of the transmission preview picture with a resolution of 16×9. WarningTo work, you need to enable the conversion of posters and channel icons in the EPG source. The image is compressed according to the parameters according to the following condition: if the size of any side of the original image exceeds the predetermined boundaries, then the image is compressed proportionally to the predetermined condition (for example, if the original image is 1000×500 and the limit is 500×500, it is compressed to 500×250). Data type: int. By default 300.
Example of settings:
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
Behavior settings of VOD and online cinemas
TVMIDDLEWARE_VIDEO_NEW_DAYS
the period in days from the date of addition of the film, during which the added film is considered a novelty and is displayed in the relevant section in the subscriber's applications. Data type: int. By default 60.
TVMIDDLEWARE_VIDEO_PREMIERE_DAYS
the period in days from the date of the premiere of the film, during which the film is considered to be the premiere and is displayed in the corresponding section in the subscriber's applications. Data type: int. By default 90.
TVMIDDLEWARE_VIDEO_PREMIERE_YEARS
the range of years in which added films are considered premieres and will be returned by the VideoList method when the option is added premiere. The range is calculated by the following formula:
[current year - TVMIDDLEWARE_VIDEO_PREMIERE_YEARS; current year].
Warning: With the value of None, films will be returned depending on the option TVMIDDLEWARE_VIDEO_PREMIERE_DAYS. When specifying the option TVMIDDLEWARE_VIDEO_PREMIERE_YEARS and TVMIDDLEWARE_VIDEO_PREMIERE_DAYS priority is given first. Data type: int. By default None of them.
TVMIDDLEWARE_CONTENT_POSITION_TTL_DAYS_VIDEO
a period in days during which it is necessary to store stored video viewing positions on the server in order to offer the subscriber to continue viewing from the previous position. Data type: int. By default 30.
TVMIDDLEWARE_CONTENT_POSITION_TTL_DAYS_PROGRAM
the period in days during which it is necessary to store saved viewing positions of the program on the server in order to offer the subscriber to continue viewing from the previous position. Data type: int. By default 30.
TVMIDDLEWARE_VIDEO_IS_VIEWED_TO_END_THRESHOLD_PERCENTAGE
establishes a threshold value (in percentage) of the remaining time until the end of the film, upon reaching which the film is considered viewed. The mechanism for determining viewing will work correctly only if the film associates correctly filled in the Duration field. Data type: int. By default 1.
TVMIDDLEWARE_VIDEO_EXTERNAL_API_REQUIRED
for True, the "External ID" and "API Processor" fields in the film creation form will be mandatory. Data type: bool. By default False.
EXTERNAL_API_VIDEO_CHECK_BALANCE_REQUEST
at the value of True, the billing alert is activated during the balance check (using the method call) perform_subcr_action_in_default_video_api_client on action='check_balance'), the option is relevant for operators with integration of external billing.
TVMIDDLEWARE_VIDEO_ACTORS_EXTENDED_UPDATE
when downloading films from a third-party source, additional information about the actors will be automatically downloaded. Data type: bool. By default True true.
TVMIDDLEWARE_MOVIEDB
selection of a database with films, which is used to fill in information about added films. Available values: kinopoisk, tmdb, kinopoisk_api_unofficial . Data type: string. By default kinopoisk_api_unofficial.
TVMIDDLEWARE_TMDB_API_KEY
API key for working with themoviedb.org database (located in the personal account of themoviedb.org in the Settings section). Data type: string.
TVMIDDLEWARE_TMDB_IMPORT_LANGUAGE
defines the language of imported values with TMDB. A list of possible language values can be found in the ISO 639-1 table. Data type: string. By default ru.
TVMIDDLEWARE_KINOPOISK_API_UNOFFICIAL_API_KEY
ключ для доступа к API Kinopoisk Api Unofficial https://kinopoiskapiunofficial.tech/.
TVMW_VIDEO_LIST_SEARCH_BY_RELEVANCE
includes a search by relevance in search queries, in which the list of films in the answer will be sorted by the position of the search bar: first return movies, where the set of search characters is in the first positions. Warning: the search results take into account the space symbol, if a space is indicated in the search bar at the end, then only those films will come in the answer in which one of the words will end on the match of the search bar (the gap at the beginning of the search query is also taken into account). Data type: bool. By default False.
PVR behavior settings
TVMIDDLEWARE_VODPVR_TIMEOUT_OFFSET
determines how long before deletion, the archival record should disappear from the customer issue (in hours). Data type: int. By default 2.
TVMW_DONT_USE_ENDLESS_WRT
when the value of True turns off the addition of the flag endless=1 for WRT consoles in links to video streams. Data type: bool. By default False.
TVMIDDLEWARE_PROGRAM_RECORD_ONLY_FINISHED
when the True value in the API method for obtaining a list of records in the Archive screen, not yet completed transfers will be transmitted. Data type: bool. By default False.
Account and device authorization settings
TVMIDDLEWARE_MULTILOGIN_ENABLED
enables or disables the multilogin mechanism (an account with unlimited authorization options) in Smarty. Data type: bool. By default True true.
TVMW_USE_DIRECT_AUTHKEY_GENERATOR
when the True value is used, a Direct generator will be used instead of a Secondary generator for unregistered device types. Data type: bool. By default False.
TVMW_REGISTRATION_SAVE_MOBILE_PHONE
store the phone number used during registration. Data type: bool. By default True true.
RANDOM_NEXT_ABONEMENT
flag switching mode generation season tickets when creating accounts. When installing False, the number of each new subscription is equal to the increment of the maximum subscription value among the client accounts, when installing True, the subscription number is generated randomly (six characters). Data type: bool. By default False.
TVMW_REGISTRATION_SUBNETS_FOR_CAPTCHA
establishes a list of subnets from which CAPTCHA will be shown to users when registering. Data type: array. By default ['0.0.0.0/0'].
TVMW_UPDATE_PHONE_NUMBER_ON_REGISTER
when you try to register an account on a device already registered with Smarty, a new account is not created, and the specified phone number is added to the current account of the device. Data type: bool. By default False.
TVMW_USE_PHONE_NUMBER_IN_ABONEMENT
at the value of True, a new account with a number similar to the phone number of the customizer will be generated during registration (without the country number, 10 characters). Otherwise, the generation is performed in a standard way. Data type: bool. By default False.
WarningIf Smarty already has an account with such a number, then the account number is generated according to the option RANDOM_NEXT_ABONEMENT.
TVWM_MULTILOGIN_CREATE_DEVICE
at the value of True during authorization from the account with the multilogin in Smarty, a tied device is created. Data type: bool. By default False.
TVMW_REMOVE_DUPLICATE_UID_ON_LOGIN
at True, when calling Login, duplicate devices with the same UID are removed. Data type: bool. By default False.
TVWM_REBIND_DEVICE_ON_LOGIN
at True, the authorization method does not return the error that the device is already linked to another account, but instead unties the device from the old account and binds to the new one. Data type: bool. By default False.
TVMIDDLEWARE_API_ALLOW_ACCOUNT_REGISTER
at False, the ability to register new users through the TVMW API is blocked. Data type: bool. By default True true.
TVMW_UPDATE_IP_IN_REALTIME
at the value of True, the IP update and geolocation of the account is enabled for any API requests. Data type: bool. By default False.
TVMW_CORRECT_IP_LOGIN
at True, IP authorization will take into account sessions from basic and/or additional devices. Data type: bool. By default False.
TVMW_CHECK_STATUS_REASON_ON_LOGIN
if the value of True when calling the Login method, the account in addition to the main status will also be checked additional. Data type: bool. By default True true.
TVMW_LOGIN_REQUEST_MAX_COUNT
sets a limit on the number of login attempts in a certain period of time. Data type: int. By default 3. Warning: time period is determined by the option TVMW_LOGIN_REQUEST_COUNTING_PERIOD_MINUTES. At 0, the check is off.
TVMW_LOGIN_REQUEST_COUNTING_PERIOD_MINUTES
establishes the period of time (in minutes) during which the number of login attempts is counted. Data type: int. By default 0. Warning: at 0, the check is off.
TVMIDDLEWARE_LOGIN_TYPE_PRIORITY_ORDER
setting up the procedure for checking the type of authorization. It is used to determine the type of authorization when requesting authorization in the TVMW API. When logging into TVMW, the Smarty API checks the data transmitted to the corresponding API method to satisfy the condition of each type of authorization in order. The first type will be accepted, the condition of which is satisfied by the transmitted data. Permissible values of authorization types:
By default:
TVMIDDLEWARE_LOGIN_TYPE_PRIORITY_ORDER = 'multilogin', 'ip', 'basic_device,' 'secondary_device', ]
Settings of internal billing Smarty
TVMIDDLEWARE_API_ALLOW_UNSUBSCRIBE_BASIC
includes the ability to disable basic tariffs through the TVMiddleware API (through client applications), without this option, Smarty billing allows you to only replace one basic tariff with another.
BILLING_ON_ACCOUNT_TARIFF_SUBSCRIBE_CINEMA
at the value of True, when calling AccountTariffAssign/AccountTariffRemove methods, the connection / disabling of the corresponding tariff of the external theater and the connection / disconnection of the subscription from the subscriber occurs. Data type: bool. By default False.
TVMW_ACTIVATE_CUSTOMERS_ON_FIRST_PAYMENT
activate subscribers at the first payment. Data type: bool. By default False.
TVMW_ACTIVATE_REGISTERED_BY_DEFAULT
determines the status of the option “active” for accounts registered through the TVMW API. Data type: bool. By default False.
TVMW_MAXIMUM_PAYMENT_LIMIT
sets a limit on the maximum amount of financial transactions. Data type: int. By default 5000.
TVMW_LIMIT_TRANSACTION_COUNT
it limits the creation of financial transactions by one user within 10 minutes. Data type: int. By default 3.
at True TVMW, API methods return hidden rates if they have a non-zero cost. Data type: bool.
TVMW_NOTIFY_TARIFF_ACTION
at the value of True when changing the tariff plan, the subscriber sees the corresponding notification on the TV screen. In False, no message is generated. Data type: bool. By default True true.
TVMW_SEND_EMAIL_DEACTIVATED_ACCOUNTS
at the value of True, inactive accounts will be sent notifications about connecting tariffs to the mail. In False, no notification is generated. Data type: bool. By default True true.
DEFAULT_CHEQUE_EMAIL
allows you to specify default mail for sending checks on payments in case of its absence from the subscriber. If DEFAULT_CHEQUE_EMAIL empty, it uses the old behavior with the generation of mail on the domain example.com. When filled DEFAULT_CHEQUE_EMAIL e-mail of the subscriber is used if available. Data type: string.
Example of settings:
DEFAULT_CHEQUE_EMAIL = "payments@mail.ru"
TVMW_MESSAGE_DEFERRED_DELETION
at True, messages that have the “Delete After Reading” flag are not deleted immediately, but are added to the list for deletion. Otherwise, the messages are deleted immediately. Data type: bool. By default False.
TVMW_MESSAGE_DEFERRED_DELETION_COUNT
sets a limit on the number of messages to be deleted. When a given value is reached, messages are deleted. Designed to reduce the load on the DB. Data type: int. By default 100.
TVMW_MESSAGE_LOG_ENABLED
at the value of False logging messages / mass mailings will be disabled. Data type: bool. By default True true.
Streaming and routing settings
TVMIDDLEWARE_STREAM_SERVICE_TOKEN_TTL
lifetime of a one-time token to authorize streaming services in seconds. After this time, 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. By default 3600 (60 minutes).
TVMIDDLEWARE_STREAM_SERVICE_TOKEN_MAX_TTL
the maximum lifetime of the token in seconds, after which the extension is not carried out. Data type: int. By default 10800 (180 minutes).
TVMIDDLEWARE_STREAM_SERVICE_TOKEN_PROLONGATION_THRESHOLD_TTL
the threshold value of the remaining life of the token in seconds, after which the extension is carried out. Data type: int. By default 360 (6 minutes).
TVMIDDLEWARE_STREAM_SERVICE_AUTH_DURATION
the time interval after which the token is rechecked in Flussonic. It's in seconds. Data type: int. By default 180 (3 minutes).
TVMW_ARCHIVE_MINIMUM_PLAYLIST_DURATION
the option affects the $pet (program end time) setting in the mask of streaming services such as PVR. It is necessary to ensure that Smarty does not return too short a playlist if the current transfer ends soon. Data type: int. By default 10000.
STREAMING_MAINTENCE_JOB_BEGIN_TIMESHIFT
STREAMING_MAINTENCE_JOB_BEGIN_TIMESHIFTthe option specifies the time of deferred team check_maintenances planner rqscheduler. Data type: int. By default 60.
an option to specify a stream-stub URL that will be played if the channel is unavailable. Data type: string. By default blank-line.
Settings of widgets and external applications
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 subscriber's applications. The city must exist on OpenWeatherMap. Data type: string.
TVMIDDLEWARE_WEATHER_WIDGET_OPENWEATHERMAP_APPID
App ID in the OpenWeatherMap service is used in calls to the service API when requesting a weather forecast. Data type: int.
TVMIDDLEWARE_WEATHER_WIDGET_CACHE_TIMEOUT
time in seconds for which you need to cache the result of the weather forecast request. It is used to reduce the number of requests. Data type: int. By default 900.
WEATHER_DEFAULT_BACKKEND
backend source of weather information used by default. Data type: string. Possible values: openweathermap, gismeteo, yahoo, fobos. By default openweathermap.
WEATHER_GISMETEO_TOKEN
token for the Gismeteo service. Data type: string.
WEATHER_FOBOS_USER
username for the weather service Phobos. Data type: string.
WEATHER_FOBOS_PASS
user password for the weather service Phobos. Data type: string.
TVMIDDLEWARE_EXCHANGE_WIDGET_CACHE_TIMEOUT
time in seconds for which it is necessary to cache the result of the request for exchange rates. It is used to reduce the number of requests. Data type: int. By default 7200.
TVMIDDLEWARE_EXCHANGE_WIDGET_FIRST_CURRENCY
первая валюта для виджета курсов валют в портале (см. http://www.cbr.ru/scripts/Root.asp?PrtId=SXML). Тип данных: string. По умолчанию USD.
TVMIDDLEWARE_EXCHANGE_WIDGET_SECOND_CURRENCY
the second currency for the widget of exchange rates in the portal. Data type: string. By default EUR.
TVMIDDLEWARE_EXCHANGE_WIDGET_COUNTRY_CODE
country code. Depending on this, a source of data 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). По умолчанию RU.
TVMIDDLEWARE_RSS_WIDGET_CACHE_TIMEOUT
time in seconds for which you need to cache the result of the RSS feed request. It is used to reduce the number of requests. Data type: int. By default 900.
TVMIDDLEWARE_RSS_WIDGET_REQUEST_TIMEOUT
time in seconds during which a response from an external news service is expected. Data type: int. By default 3.
Settings of operator logos, channel icons and content covers
MEDIA_ROOT
the absolute path to the directory in which static files (css, pictures, js) are placed. Data type: string. By default directory media at the root of Smarty.
UPLOAD_URL
relative directory path for downloadable content (the absolute path is defined as concatenation) MEDIA_ROOT and UPLOAD_URL). Data type: string. By default upload.
TVMW_CLIENT_LOGO_MAX_HEIGHT
maximum height of the operator logo. The uploaded logo will be compressed to this size. Data type: int. By default 240.
TVMW_CLIENT_LOGO_MAX_WIDTH
maximum width of the operator’s logo. The uploaded logo will be compressed to this size. Data type: int. By default 320.
TVMW_CLIENT_PLAY_DEVICE_LOGO_MAX_HEIGHT
maximum height of the main logo in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 240.
TVMW_CLIENT_PLAY_DEVICE_LOGO_MAX_WIDTH
maximum width of the main logo in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 320.
TVMW_CLIENT_PLAY_DEVICE_LOGO_LOGIN_MAX_HEIGHT
maximum logo height for the authorization screen in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 240.
TVMW_CLIENT_PLAY_DEVICE_LOGO_LOGIN_MAX_WIDTH
maximum width of the logo for the authorization screen in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 320.
TVMW_CLIENT_PLAY_DEVICE_LOGO_LOADING_MAX_HEIGHT
maximum logo height for the download screen in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 240.
TVMW_CLIENT_PLAY_DEVICE_LOGO_LOADING_MAX_WIDTH
maximum width of the logo for the authorization screen in the subscriber application. The uploaded logo will be compressed to this size. Data type: int. By default 320.
TVMW_VIDEO_POSTER_BIG_MAX_HEIGHT
the maximum height of the VOD film cover. The uploaded cover will be compressed to this size. Data type: int. By default 800.
TVMW_VIDEO_POSTER_BIG_MAX_WIDTH
the maximum width of the VOD film cover. The uploaded cover will be compressed to this size. Data type: int. By default 800.
TVMW_VIDEO_POSTER_SMALL_MAX_HEIGHT
maximum cover height for previewing a VOD film. The uploaded cover will be compressed to this size. Data type: int. By default 300.
TVMW_VIDEO_POSTER_SMALL_MAX_WIDTH
maximum cover width for previewing a VOD film. The uploaded cover will be compressed to this size. Data type: int. By default 300.
TVMW_VIDEO_FILE_PROMO_IMAGE_MAX_HEIGHT
the maximum height of the promotional video asset in VOD. The uploaded image will be compressed to this size. Data type: int. By default 720.
TVMW_VIDEO_FILE_PROMO_IMAGE_MAX_WIDTH
the maximum width of the promotional video asset in VOD. The uploaded image will be compressed to this size. Data type: int. By default 1280.
TVMW_VIDEO_SCREENSHOT_BIG_MAX_HEIGHT
the maximum height of the frame from the content film in VOD. The uploaded image will be compressed to this size. Data type: int. By default 720.
TVMW_VIDEO_SCREENSHOT_BIG_MAX_WIDTH
the maximum width of the frame from the content film in VOD. The uploaded image will be compressed to this size. Data type: int. By default 1280.
TVMW_VIDEO_SCREENSHOT_BLUR_RADIUS
the blur radius applied to screenshots of a video asset when downloading. Data type: int. By default 4.
TVMW_EXAPP_ICON_MAX_HEIGHT
the maximum height of the third-party application icon. The uploaded image will be compressed to this size. Data type: int. By default 600.
TVMW_EXAPP_ICON_MAX_WIDTH
maximum width of the third-party application icon. The uploaded image will be compressed to this size. Data type: int. By default 900.
TVMW_ACTOR_PHOTO_MAX_HEIGHT
maximum height of the actor's photo in VOD. The uploaded image will be compressed to this size. Data type: int. By default 800.
TVMW_ACTOR_PHOTO_MAX_WIDTH
maximum width of the actor's photo in VOD. The uploaded image will be compressed to this size. Data type: int. By default 800.
TVMW_TARIFF_MOBILE_ICON_MAX_HEIGHT
maximum height of the tariff icon for mobile devices. If the resolution of the image is less than the specified option, it will be changed depending on the value specified by the option. Data type: int. By default 177.
TVMW_TARIFF_MOBILE_ICON_MAX_WIDTH
maximum width of the tariff icon for mobile devices. If the resolution of the image is less than the specified option, it will be changed depending on the value specified by the option. Data type: int. By default 157.
TVMW_TARIFF_STB_ICON_MAX_HEIGHT
maximum tariff icon height for STB and Smart TV. If the resolution of the image is less than the specified option, it will be changed depending on the value specified by the option.
Data type: int. By default: 177.
TVMW_TARIFF_STB_ICON_MAX_WIDTH
maximum width of the tariff icon for STB and Smart TV. If the resolution of the image is less than the specified option, it will be changed depending on the value specified by the option.
Data type: int. By default 157.
TVMIDDLEWARE_CACHE_EXISTING_ICONS
this includes caching data on the size of existing icons. It is necessary to send icons of correct sizes for devices. Data type: bool. By default False.
SMARTY_DEFAULT_ICON_SIZE
standard channel icon size for download to EPG Channel. Data type: tuple.
SMARTY_DEFAULT_ICON_SIZES
a list of additional sizes for TV icons. Each value must be a tuple of two integer values. Maximum 3 extra sizes. Data type: list of tuples.
Example of settings:
SMARTY_DEFAULT_ICON_SIZE = (500, 500)
SMARTY_DEFAULT_ICON_SIZES = [(120, 91), (40, 40)]
Advertising integration settings
TVMIDDLEWARE_ADS_ENABLED
if the value of True in the methods API ChannelUrl and ProgramUrl will return the parameter ads. It is necessary for the functionality of advertising blocks and videos in templates that support this. It can lead to a decrease in the performance of Smarty with a large number of users per server. Data type: bool. By default False.
ADS_BLOCK_FREQUENCY_INTERVAL
sets the maximum time interval of the frequency of display of the advertising unit for one account (frequency is indicated in the Settings of the display of the advertising unit). Indicated in seconds, by default 3600 (1 hour).
ADS_BLOCK_MAX_AMOUNT
sets a limit on the number of ad units received, by default 5. Warning: it is necessary to take into account priorities in setting up advertising blocks.
MONGODB_ADS_HOST
mongoDB server address to collect statistics. By default '127.0.0.1'.
MONGODB_ADS_PORT
mongoDB server port. By default 27017.
MONGODB_ADS_NAME
database name. By default 'smarty_device_monitoring'.
MONGODB_ADS_USERNAME
user name for authorization. By default 'admin2'.
MONGODB_ADS_PASSWORD
password for authorization. By default 'password2'.
MONGODB_ADS_PUSH_TIMEOUT
timeout for connection. By default 150.
MONGODB_ADS_AUTH_METHOD
authorization method. The authorization method depends on the MongoDB version. By default 'MONGODB-CR'.
ADS_ADSTREAM_DEVMODE
the option allows you to include the return of test commercials from the advertising provider AdStream. Data type: bool. By default False.
ADS_ADSTREAM_HOST_REPLACE
host of a caching server of commercials for ADStream. Some advertising providers recommend caching videos on the operator’s side to give them to users, for this purpose you can use Nginx, and the new host from which the videos will be given should be registered in this field, so Smarty will automatically replace the host of the advertising provider with a given one. This measure will also avoid blocking ads from browsers.
ADS_QVOL_HOST_REPLACE
host of a caching server of commercials for Qvol. Some advertising providers recommend caching videos on the operator’s side to give them to users, for this purpose you can use Nginx, and the new host from which the videos will be given should be registered in this field, so Smarty will automatically replace the host of the advertising provider with a given one. This measure will also avoid blocking ads from browsers.
ADS_EPG_USE_CATEGORIES_AS_GENRES
for targeting, the advertising provider needs to know which genre is currently transmitted on the channel for which the advertising is requested. In case your EPG provider does not provide genres for programs, you should specify this option with a True value and EPG categories will be used instead of genres. By default False.
ADS_DEFAULT_CITY
establishes the default value of the city for advertising. It is necessary to work with external sources of advertising. Used if the account city is not automatically determined. Data type: string.
Smarty control panel settings
TVMIDDLEWARE_DISABLE_PAGINATION
turns off counting the number of objects during pagination in some lists in the admin. Data type: bool. By default False.
TVMIDDLEWARE_CHANNEL_AUTOSORT
allows you to disable the channel autosort function in Smarty if you set the value []. Data type: list.
TVMW_PREVENT_CASCADE_DELETION
with the value of True prohibits the removal of objects in Smarty through the Administrator Panel in the presence of subsidiaries associated objects. With a False value, removal of such objects is permitted, but child objects will not be removed. Data type: bool. By default False.
TVMW_ENABLE_LINK_TO_CUSTOMER_ON_ACCOUNTS_PAGE
when the value of True on the page of the list of accounts in the administrator panel in the column "Subscriber" will display a link to editing the subscriber. Otherwise, just the name of the subscriber. Data type: bool. By default False.
TVMW_SHOW_CONTENT_ALWAYS
if the value of True on the pages of subscribers, accounts and devices, the lists will always be disclosed. Otherwise, the lists unfold only after pressing the button. Data type: bool. By default True true.
DEALERS_DISPLAY_MANUAL_ACCOUNT_ACTIVATION_DATE
includes / disables the ability to manually enter the activation date and deactivation in the personal account of the dealer. Data type: bool. By default False.
MONGODB_REPORT_TIMEOUT
timeout to create reports from the administration panel in seconds. It is necessary to reduce the load on MongoDB. Data type: int. By default 600000.
BILLING_ACCURATE_SUBSCRIPTIONS
when the value of True for created subscriptions must indicate the exact time of creation (otherwise, the time is displayed as 12:00). Available in new billing logic. Data type: bool. By default False.
Example of settings:
TVMIDDLEWARE_CHANNEL_AUTOSORT = ["sort_auto", "sort_id", "sort_alphabet", "sort_user", "sort_lcn"]
Caching settings
TVMW_USE_TARIFF_LCN
an option with which you can disable the formation of a cache of channels with LCN filtering according to tariffs. If the operator does not use channel sorting by LCN, this option can significantly reduce the number of cache. Data type: bool. By default True true.