Compare commits
2 Commits
ee4e2122ed
...
0e20aa194c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e20aa194c | |||
| 9003b231aa |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
SECRET_KEY = 'django-insecure-kst@+h&50%!m$(d!l*qbb0l7f@z#@#me__yye^$5kg%0m%1=im'
|
SECRET_KEY = 'django-insecure-kst@+h&50%!m$(d!l*qbb0l7f@z#@#me__yye^$5kg%0m%1=im'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['www.sillaamp.com', 'sillaamp.com', '192.168.1.119', 'localhost', '127.0.0.1', '*']
|
ALLOWED_HOSTS = ['www.sillaamp.com', 'sillaamp.com', '192.168.1.119', 'localhost', '127.0.0.1', '*']
|
||||||
|
|
||||||
|
|||||||
@ -15,10 +15,11 @@ Including another URLconf
|
|||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path, include
|
from django.urls import path, include, re_path
|
||||||
from django.views.generic import RedirectView
|
from django.views.generic import RedirectView
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
|
from django.views.static import serve
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
@ -28,10 +29,12 @@ urlpatterns = [
|
|||||||
path('accounts/', include('allauth.urls')), # allauth 기본 URL
|
path('accounts/', include('allauth.urls')), # allauth 기본 URL
|
||||||
path('accounts/', include('C_accounts.urls')), # 커스텀 계정 URL
|
path('accounts/', include('C_accounts.urls')), # 커스텀 계정 URL
|
||||||
path('', include('B_main.urls')),
|
path('', include('B_main.urls')),
|
||||||
|
# 미디어 파일 서빙 (DEBUG=False 상황에서도 작동)
|
||||||
]
|
]
|
||||||
|
|
||||||
# 미디어 파일 서빙 (개발 및 프로덕션 환경 모두)
|
urlpatterns += [
|
||||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
|
||||||
|
]
|
||||||
|
|
||||||
# 정적 파일 서빙 (개발 환경에서만)
|
# 정적 파일 서빙 (개발 환경에서만)
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +1,5 @@
|
|||||||
from django.urls import path
|
from django.urls import path
|
||||||
from . import views
|
from . import views
|
||||||
from django.conf import settings
|
|
||||||
from django.conf.urls.static import static
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.main, name='main'),
|
path('', views.main, name='main'),
|
||||||
@ -14,7 +12,4 @@ urlpatterns = [
|
|||||||
path('session_logout/', views.session_logout, name='session_logout'),
|
path('session_logout/', views.session_logout, name='session_logout'),
|
||||||
path('signup/', views.signup_view, name='signup'),
|
path('signup/', views.signup_view, name='signup'),
|
||||||
path('privacy-policy/', views.privacy_policy, name='privacy_policy'),
|
path('privacy-policy/', views.privacy_policy, name='privacy_policy'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# 미디어 파일 서빙 (개발 및 프로덕션 환경 모두)
|
|
||||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
||||||
@ -144,12 +144,19 @@ def search_people(request):
|
|||||||
base_filter = Person.objects.all()
|
base_filter = Person.objects.all()
|
||||||
|
|
||||||
# 현재 사용자의 권한에 따라 추가 필터 적용
|
# 현재 사용자의 권한에 따라 추가 필터 적용
|
||||||
if current_user_person and not current_user_person.모든사람보기권한:
|
print(f"[DEBUG] 검색 - 사용자: {request.user.username}, 슈퍼유저: {request.user.is_superuser}")
|
||||||
# 모든사람보기권한이 False인 경우 회원가입한 사람만 표시 (user가 있는 사람들)
|
print(f"[DEBUG] 검색 - current_user_person: {current_user_person}")
|
||||||
|
|
||||||
|
# 슈퍼유저이거나 Person 객체가 없는 경우 모든 사람 표시
|
||||||
|
if request.user.is_superuser or current_user_person is None:
|
||||||
|
print(f"[DEBUG] 검색 - 슈퍼유저 또는 Person 객체 없음 - 모든 사람 표시 모드")
|
||||||
|
# 모든 사람 표시 (필터 추가 없음)
|
||||||
|
elif current_user_person and not current_user_person.모든사람보기권한:
|
||||||
|
# 모든사람보기권한이 False인 경우 회원가입한 사람만 표시
|
||||||
base_filter = base_filter.filter(user__isnull=False)
|
base_filter = base_filter.filter(user__isnull=False)
|
||||||
print(f"[DEBUG] 검색 - 회원가입자만 표시 모드: {current_user_person.이름}")
|
print(f"[DEBUG] 검색 - 회원가입자만 표시 모드: {current_user_person.이름}")
|
||||||
else:
|
else:
|
||||||
print(f"[DEBUG] 검색 - 모든 사람 표시 모드")
|
print(f"[DEBUG] 검색 - 모든 사람 표시 모드 (모든사람보기권한: {current_user_person.모든사람보기권한})")
|
||||||
|
|
||||||
if query:
|
if query:
|
||||||
# 이름, 소속, 직책, 키워드로 검색
|
# 이름, 소속, 직책, 키워드로 검색
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
BIN
media/profile_photos/증명사진.jpg
Normal file
BIN
media/profile_photos/증명사진.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Loading…
x
Reference in New Issue
Block a user