-
Notifications
You must be signed in to change notification settings - Fork 68
/
settings_example.py
92 lines (66 loc) · 4.81 KB
/
settings_example.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
89
90
91
92
### Rename this file to chat/settings.py
### 3 hashtag in this file tells you want to do, while single hastag is required to uncomment
########################################################################################################################
############################################# START REQUIRED SECTION ###################################################
### Uncomment a SINGLE import from 3 below
# from chat.settings_docker import * # If you run pychat inside of docker container uncomment this
# from chat.settings_local import * # If you run development server on your local machine uncomment this one
# from chat.settings_prod import * # if you run this in production without docker uncomment this
### Prevent host header attacks in emails
### this will used to sent emails with magic link, replce to your ip/domain , notice no trailing slash!
# SERVER_ADDRESS = 'https://192.168.1.15:8080'
### Replace with your django secret key, use the command bellow to audogenerate it
### bash download_content.sh generate_secret_key
# SECRET_KEY = '**************************************************'
############################################# END REQUIRED SECTION #####################################################
########################################################################################################################
########################################################################################################################
##################################### EVERYTHING BELOW IS OPTIONAL #####################################################
### Every email (like magic link will be marked with this lable)
# FROM_EMAIL = 'pychat'
### Uncomment this setting if you want to see everyone location. You may also need to enable FLAGS in production.json inside frontend directory
# SHOW_COUNTRY_CODE = True
### Replace with your timezone. You can find list of timezones here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# TIME_ZONE = 'Europe/Kiev'
### this this emails settings will be used to send emails. E.g. when user restores password via email.
### Comment them out if you don't want to setup
# ADMINS = [('YourName', '[email protected]'), ]
# EMAIL_USE_TLS = True
# EMAIL_HOST = 'localhost'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = ''
# EMAIL_HOST_PASSWORD = ''
# SERVER_EMAIL = '[email protected]'
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
### Gmail smpt (from account) settings example:
#EMAIL_USE_TLS = True
#EMAIL_HOST = 'smtp.gmail.com' # For gmail settings example
#EMAIL_PORT = '587' # google smpt port
#EMAIL_HOST_USER = '[email protected]'
#EMAIL_HOST_PASSWORD = 'yourgmailpassword'
#SERVER_EMAIL = '[email protected]'
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
### Pychat also supports https://developers.google.com/web/fundamentals/push-notifications/ firebase notifications, like in facebook.
### They will fire even user doesn't have opened tab. That can be turned on/off by used in his/her profile with checkbox `Notifications`.
### The implementation is similar like https://github.com/GoogleChrome/samples/tree/gh-pages/push-messaging-and-notifications.
### 1. Create a project on the Firebase Developer Console: https://console.firebase.google.com/
### 2. Go to Settings (the cog near the top left corner), click the Cloud Messaging Tab: https://console.firebase.google.com/u/1/project/pychat-org/settings/cloudmessaging/
### 3. Put `<Your Cloud Messaging API Key ...>` to `FIREBASE_API_KEY` below.
### 4. Create `chat/static/manifest.json` with content like https://github.com/GoogleChrome/samples/blob/gh-pages/push-messaging-and-notifications/manifest.sample.json:
###
### {
### "name": "Pychat Push Notifications",
### "short_name": "PyPush",
### "start_url": "/",
### "display": "standalone",
### "gcm_sender_id": "<Your Sender ID from https://console.firebase.google.com>"
### }
# FIREBASE_API_KEY = '***********:********************************************************************************************************************************************'
### If you want recaptcha: Open https://www.google.com/recaptcha/admin#list and register new domain, type is web captcha
### If you set RECAPTCHA_PRIVATE_KEY you should set RECAPTCHA_PUBLIC_KEY in frontend/development.json and frontend/production.json
# RECAPTCHA_PRIVATE_KEY = '****************************************' # Secret key
### For google auth follow the instructions here https://developers.google.com/identity/sign-in/web/devconsole-project
### Select Web Browser type
# GOOGLE_OAUTH_2_CLIENT_ID = 'YOUR_CLIENT_ID.apps.googleusercontent.com'
### For facebook auth:
# FACEBOOK_ACCESS_TOKEN = '**' # https://developers.facebook.com/apps/ -> click on app -> settings -> basic "App ID|App Secret" e.g. FACEBOOK_ACCESS_TOKEN = "91237|bf86sd3"