|
56 | 56 | "django.contrib.sessions", |
57 | 57 | "django.contrib.messages", |
58 | 58 | "django.contrib.staticfiles", |
59 | | - # "django.contrib.sites", |
| 59 | + "django.contrib.sites", |
60 | 60 | ) |
61 | | - |
| 61 | + |
62 | 62 | THIRD_PARTY_APPS = ( |
63 | 63 | "allauth", |
64 | 64 | "allauth.account", |
|
72 | 72 | "rest_framework", |
73 | 73 | "django_filters", |
74 | 74 | "simple_history", |
| 75 | + #"sslserver", used in development server only |
75 | 76 | ) |
76 | 77 |
|
77 | 78 | OUR_APPS = ( |
|
86 | 87 | ) |
87 | 88 |
|
88 | 89 | INSTALLED_APPS = CORE_APPS + THIRD_PARTY_APPS + OUR_APPS |
| 90 | +SITE_ID = 1 |
| 91 | + |
| 92 | +# Provider specific settings |
| 93 | +SOCIALACCOUNT_PROVIDERS = { |
| 94 | + 'github': { |
| 95 | + # For each provider, you can choose whether or not the |
| 96 | + # email address(es) retrieved from the provider are to be |
| 97 | + # interpreted as verified. |
| 98 | + 'VERIFIED_EMAIL': True, |
| 99 | + 'APP': { |
| 100 | + 'client_id': 'enter your github client_id', |
| 101 | + 'secret': 'enter your github secret key', |
| 102 | + 'key': '', |
| 103 | + }, |
| 104 | + }, |
| 105 | + 'google': { |
| 106 | + # For each OAuth based provider, either add a ``SocialApp`` |
| 107 | + # (``socialaccount`` app) containing the required client |
| 108 | + # credentials, or list them here: |
| 109 | + 'SCOPE': { |
| 110 | + 'profile', |
| 111 | + 'email', |
| 112 | + }, |
| 113 | + 'APP': { |
| 114 | + 'client_id': 'enter your google client_id', |
| 115 | + 'secret': 'enter your google secret key', |
| 116 | + 'key': '', |
| 117 | + }, |
| 118 | + } |
| 119 | +} |
89 | 120 |
|
90 | 121 |
|
91 | 122 | TEMPLATES = [ |
|
119 | 150 | ACCOUNT_EMAIL_SUBJECT_PREFIX = "[{}] ".format(SITE_VARIABLES["site_name"]) |
120 | 151 | ACCOUNT_LOGOUT_ON_GET = True |
121 | 152 | ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" |
122 | | - |
123 | 153 | EMAIL_SUBJECT_PREFIX = ACCOUNT_EMAIL_SUBJECT_PREFIX |
124 | 154 |
|
125 | 155 | LOGIN_REDIRECT_URL = "/" |
126 | 156 |
|
127 | 157 | # E-Mail Settings |
128 | 158 | EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" |
129 | | -EMAIL_HOST = "smtp.sendgrid.com" |
130 | | -EMAIL_HOST_USER = (os.environ.get("EMAIL_HOST_USER", ""),) |
131 | | -EMAIL_HOST_PASSWORD = (os.environ.get("EMAIL_HOST_PASSWORD", ""),) |
| 159 | +EMAIL_HOST = "smtp.gmail.com" |
| 160 | +EMAIL_HOST_USER = DEFAULT_FROM_EMAIL = (os.environ.get("EMAIL_HOST_USER", "enter gmail id"),) |
| 161 | +EMAIL_HOST_PASSWORD = (os.environ.get("EMAIL_HOST_PASSWORD", "enter App password"),) #turn on 2-step verification in your gmail account and add App password |
132 | 162 | EMAIL_PORT = 587 |
133 | 163 | EMAIL_USE_TLS = True |
134 | | -DEFAULT_FROM_EMAIL = SITE_VARIABLES["site_name"] + " <noreply@pssi.org.in>" |
| 164 | +# DEFAULT_FROM_EMAIL = SITE_VARIABLES["site_name"] + " <noreply@pssi.org.in>" |
135 | 165 |
|
136 | 166 | BOOTSTRAP3 = { |
137 | 167 | "required_css_class": "required", |
|
186 | 216 |
|
187 | 217 |
|
188 | 218 | DATABASES = { |
| 219 | + "default": { |
| 220 | + "ENGINE": "django.db.backends.postgresql_psycopg2", |
| 221 | + "NAME": os.environ.get("DB_NAME", "enter postgres db name"), |
| 222 | + "USER": os.environ.get("DB_USER", "postgres"), |
| 223 | + "PASSWORD": os.environ.get("DB_PASSWORD", "enter postgres password"), |
| 224 | + "HOST": os.environ.get("DB_HOST", "localhost"), |
| 225 | + "PORT": os.environ.get("DB_PORT", "5432"), |
| 226 | + } |
189 | 227 | # "default": { |
190 | | - # "ENGINE": "django.db.backends.postgresql_psycopg2", |
191 | | - # "NAME": os.environ.get("DB_NAME", ""), |
192 | | - # "USER": os.environ.get("DB_USER", ""), |
193 | | - # "PASSWORD": os.environ.get("DB_PASSWORD", ""), |
194 | | - # "HOST": os.environ.get("DB_HOST", ""), |
195 | | - # "PORT": os.environ.get("DB_PORT", ""), |
| 228 | + # "ENGINE": "django.db.backends.sqlite3", |
| 229 | + # "NAME": os.path.join(ROOT_DIR, "test.sqlite3"), |
196 | 230 | # } |
197 | | - "default": { |
198 | | - "ENGINE": "django.db.backends.sqlite3", |
199 | | - "NAME": os.path.join(ROOT_DIR, "test.sqlite3"), |
200 | | - } |
201 | 231 | } |
202 | 232 |
|
203 | 233 | SECRET_KEY = os.environ.get( |
204 | 234 | "SECRET_KEY", "z^bd9lk)o!03n#9e_u87zidd1zt7*^_oc4v6t!@@86vtbu0*&j" |
205 | 235 | ) |
206 | 236 |
|
207 | 237 |
|
208 | | -ALLOWED_HOSTS = ["*"] |
| 238 | +ALLOWED_HOSTS = ["*"] |
209 | 239 |
|
210 | 240 | SITE_PROTOCOL = "http" |
211 | 241 |
|
|
0 commit comments