diff options
author | mjfernez <mjfernez@gmail.com> | 2021-10-10 22:15:07 -0400 |
---|---|---|
committer | mjfernez <mjfernez@gmail.com> | 2021-10-10 22:15:07 -0400 |
commit | 02a37ad308fbcc27a04787c84a76de7c2936a6d5 (patch) | |
tree | df25089ab76cc0c3faa94e2990b600ea7568ab63 /siteconfig.py | |
parent | a800163aeae0998fa49f011664f32a6c348db886 (diff) | |
download | ezcms-02a37ad308fbcc27a04787c84a76de7c2936a6d5.tar.gz |
Caching support. Separate views.py in 2 files
This commit adds the Flask-Caching module to the software stack and
enables the caching of views in a wide variety of ways, but implemented
here to be simple to understand to someone new to the concept of caching
(aka me).
Various documentation and formatting was applied to all files. views.py
internal functions (mostly related to filesystem operations of the
server). have been moved into view_functions.py
Diffstat (limited to 'siteconfig.py')
-rw-r--r-- | siteconfig.py | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/siteconfig.py b/siteconfig.py index fa73b46..4e0ef90 100644 --- a/siteconfig.py +++ b/siteconfig.py @@ -1,15 +1,20 @@ +""" +siteconfig.py - user editable configuration file +""" + + class siteconfig: # REQUIRED SETTINGS# - DOMAIN = "example.net" # Your site here! - HOME_TITLE = "WELCOME" # Goes right under - # your site - LINKS_FILE = ".links" # ".lnx" if you like - DESC_FILE = ".description" # ".desc" - DEFAULT_MIMETYPE = "application/octet-stream" + DOMAIN = "example.net" # Your site here! + HOME_TITLE = "WELCOME" # Goes right under + # your site + LINKS_FILE = ".links" # ".lnx" if you like + DESC_FILE = ".description" # ".desc" + DEFAULT_MIMETYPE = "application/octet-stream" # ^This usually prompts a browser to download a file if the mime # type is unknown. A good alternative might be "text/plain" - + # Add your desired mimetypes to the csv file MIMETYPES = {} with open('mimetypes.csv') as f: @@ -23,9 +28,18 @@ class siteconfig: # ./templates/site/. You can change this to only specific directories, but # these still have to be in ./templates/site MAIN_SITE_DIRS = None # ["dir1", "dir2", "dir3"] + # Set a custom secret key. If not set, it will be generated # Most of the time, you don't need to set this! - SECRET_KEY = None # Something random. - # Special option for Flask Compress + SECRET_KEY = None # Something random. + + # Option for Flask Compress # see here https://pypi.org/project/Flask-Compress/ COMPRESS_MIMETYPES = list(MIMETYPES.values()) + + # Option for Flask Caching + # https://flask-caching.readthedocs.io/en/latest/#configuring-flask-caching + CACHE_TYPE = "SimpleCache" + + # Time in seconds that your files stay cached for + CACHE_DEFAULT_TIMEOUT = 300 |