-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
88 lines (77 loc) · 2.52 KB
/
admin.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8 -*-
from flaskext import wtf
from main import app
class ConfigUpdateForm(wtf.Form):
brand_name = wtf.TextField(
'Brand Name', [wtf.validators.required()]
)
analytics_id = wtf.TextField(
'Analytics ID', [wtf.validators.optional()]
)
facebook_app_id = wtf.TextField(
'Facebook ID', [wtf.validators.optional()]
)
facebook_app_secret = wtf.TextField(
'Facebook Secret', [wtf.validators.optional()]
)
vk_app_id = wtf.TextField(
'Vkontakte ID', [wtf.validators.optional()]
)
vk_app_secret = wtf.TextField(
'Vkontakte Secret', [wtf.validators.optional()]
)
ya_app_id = wtf.TextField(
'Yandex app ID', [wtf.validators.optional()]
)
ya_app_secret = wtf.TextField(
'Yandex app password', [wtf.validators.optional()]
)
mailru_app_id = wtf.TextField(
'Mail.ru app ID', [wtf.validators.optional()]
)
mailru_app_secret = wtf.TextField(
'Mail.ru secret key', [wtf.validators.optional()]
)
odnoklassniki_app_id = wtf.TextField(
'Odnoklassniki app ID', [wtf.validators.optional()]
)
odnoklassniki_app_public = wtf.TextField(
'Odnoklassniki public key', [wtf.validators.optional()]
)
odnoklassniki_app_secret = wtf.TextField(
'Odnoklassniki secret key', [wtf.validators.optional()]
)
twitter_consumer_key = wtf.TextField(
'Twitter Key', [wtf.validators.optional()]
)
twitter_consumer_secret = wtf.TextField(
'Twitter Secret', [wtf.validators.optional()]
)
feedback_email = wtf.TextField('Feedback Email', [
wtf.validators.optional(),
wtf.validators.email("That doesn't look like an email"),
])
recaptcha_public_key = wtf.TextField(
'reCaptcha public key', [wtf.validators.optional()]
)
recaptcha_private_key = wtf.TextField(
'reCaptcha private key', [wtf.validators.optional()]
)
pubnub_publish = wtf.TextField(
'PubNub Publish', [wtf.validators.optional()]
)
pubnub_subscribe = wtf.TextField(
'PubNub Subsrcibe', [wtf.validators.optional()]
)
pubnub_secret = wtf.TextField(
'PubNub Secret', [wtf.validators.optional()]
)
flask_secret_key = wtf.TextField(
'Flask Secret Key', [wtf.validators.required()]
)
def update_config_variables(config_db):
app.config.update(
BRAND_NAME=config_db.brand_name,
ANALYTICS_ID=config_db.analytics_id,
SECRETE_KEY=config_db.flask_secret_key,
)