Issues (463)

testproject/settings.py (1 issue)

1
import os
0 ignored issues
show
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
DEBUG = True
4
5
BASE_DIR = os.path.dirname(__file__)
6
7
DATABASES = {
8
    "default": {
9
        "ENGINE": "django.db.backends.sqlite3",
10
        "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
11
    }
12
}
13
14
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
15
16
AUTH_PASSWORD_VALIDATORS = [{"NAME": "testapp.validators.Is666"}]
17
18
SECRET_KEY = "_"
19
20
MIDDLEWARE = ["django.contrib.sessions.middleware.SessionMiddleware"]
21
22
23
INSTALLED_APPS = (
24
    "django.contrib.auth",
25
    "django.contrib.contenttypes",
26
    "django.contrib.sessions",
27
    "django.contrib.staticfiles",
28
    "templated_mail",
29
    "rest_framework",
30
    "rest_framework.authtoken",
31
    "djoser",
32
    "social_django",
33
    "testapp",
34
)
35
36
STATIC_URL = "/static/"
37
38
REST_FRAMEWORK = {
39
    "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
40
    "DEFAULT_AUTHENTICATION_CLASSES": (
41
        "rest_framework_simplejwt.authentication.JWTAuthentication",
42
        "rest_framework.authentication.TokenAuthentication",
43
    ),
44
}
45
46
ROOT_URLCONF = "urls"
47
48
TEMPLATES = [
49
    {"BACKEND": "django.template.backends.django.DjangoTemplates", "APP_DIRS": True}
50
]
51
52
AUTHENTICATION_BACKENDS = [
53
    "django.contrib.auth.backends.ModelBackend",
54
    "djoser.social.backends.facebook.FacebookOAuth2Override",
55
    "social_core.backends.google.GoogleOAuth2",
56
    "social_core.backends.steam.SteamOpenId",
57
]
58
59
SOCIAL_AUTH_FACEBOOK_KEY = os.environ.get("FACEBOOK_KEY", "")
60
SOCIAL_AUTH_FACEBOOK_SECRET = os.environ.get("FACEBOOK_SECRET", "")
61
62
SOCIAL_AUTH_FACEBOOK_SCOPE = ["email"]
63
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {"fields": "id, name, email"}
64
65
SOCIAL_AUTH_STEAM_API_KEY = os.environ.get("STEAM_API_KEY", "")
66
SOCIAL_AUTH_OPENID_TRUST_ROOT = "http://test.localhost/"
67
68
DJOSER = {
69
    "SEND_ACTIVATION_EMAIL": False,
70
    "PASSWORD_RESET_CONFIRM_URL": "#/password/reset/confirm/{uid}/{token}",
71
    "USERNAME_RESET_CONFIRM_URL": "#/username/reset/confirm/{uid}/{token}",
72
    "ACTIVATION_URL": "#/activate/{uid}/{token}",
73
    "SOCIAL_AUTH_ALLOWED_REDIRECT_URIS": ["http://test.localhost/"],
74
}
75
76
77
SIMPLE_JWT = (
78
    {}
79
)  # https://django-rest-framework-simplejwt.readthedocs.io/en/latest/settings.html#settings
80