-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
48 lines (40 loc) · 1.42 KB
/
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
48
import yaml
with open("./models/payment_v0.yaml", "r") as f:
schema = yaml.load(f.read())
# Let's just use the local mongod instance. Edit as needed.
# Please note that MONGO_HOST and MONGO_PORT could very well be left
# out as they already default to a bare bones local 'mongod' instance.
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
# Skip these if your db has no auth. But it really should.
# MONGO_USERNAME = '<your username>'
# MONGO_PASSWORD = '<your password>'
MONGO_DBNAME = 'form3'
payments = {
# 'title' tag used in item links. Defaults to the resource title minus
# the final, plural 's'
'item_title': 'payment',
'allow_unknown': True,
# We choose to override global cache-control directives for this resource.
'cache_control': 'max-age=10,must-revalidate',
'cache_expires': 10,
'schema': schema
}
# Enable reads (GET), inserts (POST)
# read-only access to the endpoint).
RESOURCE_METHODS = ['GET', 'POST']
# Enable reads (GET), edits (PATCH), replacements (PUT) and deletes of
# individual items (defaults to read-only item access).
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']
# ALLOWED_FILTERS = ['*']
# VALIDATE_FILTERS = True
ID_FIELD = 'id'
ITEM_LOOKUP_FIELD = 'id'
ITEM_URL = 'regex("[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}")'
IF_MATCH = False
ITEMS = 'data'
DOMAIN = {'payments': payments}
# THis is for the JWT
JWT_SECRET = "secret"
JWT_ISSUER = "form3"
JWT_AUDIENCES = ['admin']