diff options
author | mjfernez <mjf@mjfer.net> | 2021-11-26 15:22:22 -0500 |
---|---|---|
committer | mjfernez <mjf@mjfer.net> | 2021-11-26 15:22:22 -0500 |
commit | 274a23b6fe167d30ce063aa1cc2f07374d18bc04 (patch) | |
tree | 51ce1b3952088bd24332b1c40f9e82332beb9e8c /config.py | |
parent | ec6feec81ebab89dc6779027649b1ce517042d22 (diff) | |
download | ezcms-274a23b6fe167d30ce063aa1cc2f07374d18bc04.tar.gz |
Separates user configuration siteconfig from core
Creates config.py to handle all filesystem stuff
Diffstat (limited to 'config.py')
-rw-r--r-- | config.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/config.py b/config.py new file mode 100644 index 0000000..6f796fe --- /dev/null +++ b/config.py @@ -0,0 +1,33 @@ +import os + +class config: + # BACKGROUND SETTINGS # + # These don't need to be changed + + # This setting is required, don't change it unless you're running + # things in different directories + BASE_DIR = "./templates/site/" + + # Add your desired mimetypes to the csv file + MIMETYPES = {} + with open('mimetypes.csv') as f: + for line in f.readlines(): + ext, mime = line.strip().split(',') + MIMETYPES.update({ext: mime}) + + # This reads your omit file. + # Entries should be the full path from the site directory. + # For example "dontread.txt" in this project is entered as + # 'thoughts/rants/donread.txt' + RSS_OMIT = [] + with open('omit') as f: + for line in f.readlines(): + RSS_OMIT.append(BASE_DIR + line.strip()) + + DEFAULT_SITE_DIRS = [] + for x in os.listdir(BASE_DIR): + if os.path.isdir(BASE_DIR + x) and not x.startswith("."): + DEFAULT_SITE_DIRS.append(x) + + GENERATED_SECRET_KEY = os.urandom(32) + |