Skip to content

Commit

Permalink
Merge pull request #410 from sparcs-kaist/develop
Browse files Browse the repository at this point in the history
Deploy v3.0.1
  • Loading branch information
injoonH authored Aug 10, 2023
2 parents abe95c0 + fe0caab commit a60553f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 2 additions & 0 deletions apps/core/views/viewsets/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def filter_queryset(self, queryset):
"created_by__profile",
"parent_topic",
"parent_board",
"parent_board__group",
).prefetch_related(
ArticleReadLog.prefetch_my_article_read_log(self.request.user),
)
Expand All @@ -119,6 +120,7 @@ def filter_queryset(self, queryset):
"created_by__profile",
"parent_topic",
"parent_board",
"parent_board__group",
).prefetch_related(
"attachments",
models.Prefetch(
Expand Down
15 changes: 14 additions & 1 deletion ara/settings/dev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import socket
from datetime import datetime, timezone

from ara.settings import INSTALLED_APPS, LOGGING, MIDDLEWARE
Expand All @@ -12,7 +13,7 @@
"http://localhost",
]

CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_ALL_ORIGINS = True

SSO_IS_BETA = False

Expand All @@ -29,6 +30,18 @@
"debug_toolbar_force.middleware.ForceDebugToolbarMiddleware",
]

# https://django-debug-toolbar.readthedocs.io/

_, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + [
"127.0.0.1",
"10.0.2.2",
]

DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": lambda _: True,
}

REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"] = (
"rest_framework.authentication.BasicAuthentication",
"ara.authentication.CsrfExemptSessionAuthentication",
Expand Down
7 changes: 0 additions & 7 deletions ara/settings/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,8 @@

STATIC_URL = "/static/"


# https://django-debug-toolbar.readthedocs.io/

INTERNAL_IPS = ("127.0.0.1",)

if env("DJANGO_ENV") == "development":
INTERNAL_IPS = type(str("c"), (), {"__contains__": lambda *a: True})()


SESSION_ENGINE = "django.contrib.sessions.backends.db"
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
Expand Down
4 changes: 4 additions & 0 deletions ara/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@

CELERY_TASK_ALWAYS_EAGER = True
ELASTICSEARCH_INDEX_NAME = "articles_test"

DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": lambda _: False,
}
5 changes: 1 addition & 4 deletions ara/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
),
]

# installed apps (test environment)
if settings.DEBUG:
import debug_toolbar

urlpatterns += [
path("__debug__/", include(debug_toolbar.urls)),
path("api/__debug__/", include("debug_toolbar.urls")),
]

0 comments on commit a60553f

Please sign in to comment.