This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup to development testing without touch CMS API: | |
# /triller_cms/settings/base.py | |
TRILLER_CMS_OLD_API_URL = 'https://development-social.triller.co/v1.5/' | |
#TRILLER_CMS_API_URL = 'http://api.staging.triller.co/v1.5/cms-api' | |
TRILLER_CMS_API_URL = '' | |
# triller_cms/settings/development.py | |
#TRILLER_CMS_API_URL = os.getenv('CMS_API_URL', 'https://development-social.triller.co/v1.5/cms-api') | |
# triller_cms/settings/docker.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def count_digits(n, digit): | |
"""Return the number of times digit appears in the squares of the sequence 1..n. | |
Example: | |
count_digits(10, 1) = 4 | |
# 1, 2, 3, 4, ..., 9, 10 --> 1, 4, 9, 16, ..., 81, 100 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Testiong Sonoff mini REST API</h1> | |
<button id="turnON" type="button">Turn ON</button> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""" | |
When you wanna validate dynamically different image size in Django forms and model forms | |
"""" | |
# settings.py | |
DEFAULT_THUMBNAILS_DIMENSION = ( | |
os.getenv('THUMBNAIL_WIDTH_PX', 300), os.getenv('THUMBNAIL_HEIGHT_PX', 300) | |
) |
OlderNewer