Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 91fb72f

Browse files
07.02 split settings according to use
1 parent c106974 commit 91fb72f

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

‎src/config/settings.py‎ renamed to ‎src/config/settings/base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
ENV = Env()
1313

14-
BASE_DIR = Path(__file__) - 2
14+
BASE_DIR = Path(__file__) - 3
1515

1616
SECRET_KEY = ENV.str("SECRET_KEY")
1717

‎src/config/settings/development.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Development settings for Startup Organizer"""
2+
from .base import * # noqa: F403
3+
4+
DEBUG = ENV.bool("DEBUG", default=True) # noqa: F405
5+
6+
TEMPLATES[0]["OPTIONS"].update( # noqa: F405
7+
{
8+
"debug": ENV.bool( # noqa: F405
9+
"TEMPLATE_DEBUG", default=True
10+
)
11+
}
12+
)

‎src/config/settings/production.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""Django Settings for Production instances of the site"""
2+
from .base import * # noqa: F401 F403
3+
4+
######################################################################
5+
# PRODUCTION SETTINGS
6+
######################################################################
7+
8+
ALLOWED_HOSTS = [".herokuapp.com"]
9+
10+
ADMINS = MANAGERS = [
11+
# ('Your Name', 'name@email.com'),
12+
]
13+
14+
#####################
15+
# SECURITY SETTINGS #
16+
#####################
17+
18+
CSRF_COOKIE_HTTPONLY = True
19+
CSRF_COOKIE_SECURE = True
20+
21+
SECURE_BROWSER_XSS_FILTER = True
22+
SECURE_CONTENT_TYPE_NOSNIFF = True
23+
24+
SECURE_SSL_REDIRECT = True
25+
SECURE_HSTS_SECONDS = 3600
26+
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
27+
28+
SESSION_COOKIE_DOMAIN = None # not set on subdomains
29+
SESSION_COOKIE_HTTPONLY = True
30+
SESSION_COOKIE_NAME = "suorganizer_sessionid"
31+
SESSION_COOKIE_SECURE = True
32+
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
33+
34+
X_FRAME_OPTIONS = "DENY"
35+
36+
REST_FRAMEWORK = {
37+
"DEFAULT_PERMISSION_CLASSES": (
38+
"rest_framework.permissions.IsAuthenticatedOrReadOnly",
39+
)
40+
}

‎src/manage.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
if __name__ == "__main__":
66
os.environ.setdefault(
7-
"DJANGO_SETTINGS_MODULE", "config.settings"
7+
"DJANGO_SETTINGS_MODULE",
8+
"config.settings.development",
89
)
910
try:
1011
from django.core.management import (

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /