-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsettings.py
47 lines (40 loc) · 1022 Bytes
/
settings.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
from fake_useragent import UserAgent
from toapi.cache import MemoryCache, RedisCache, JsonSerializer
from toapi.settings import Settings
class MemCacheSettings(Settings):
cache = {
'cache_class': MemoryCache,
'cache_config': {},
'serializer': None,
'ttl': None
}
storage = {
"PATH": os.getcwd(),
"DB_URL": None
}
web = {
"with_ajax": False,
"request_config": {"headers": {'User-Agent': UserAgent().random}},
"headers": None
}
class RedisCacheSettings(Settings):
cache = {
'cache_class': RedisCache,
'cache_config': {
'host': '127.0.0.1',
'port': 6379,
'db': 0
},
'serializer': JsonSerializer,
'ttl': None
}
storage = {
"PATH": os.getcwd(),
"DB_URL": None
}
web = {
"with_ajax": False,
"request_config": {"headers": {'User-Agent': UserAgent().random}},
"headers": None
}