aboutsummaryrefslogtreecommitdiffstats
path: root/config.py
blob: 6f796fee27709a9c25ee89e20830e70b6d6b02e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)