ip관리대장 db연동필드 변경 && 환경변수 호출로직수정
All checks were successful
Build And Test / build-and-push (push) Successful in 4m5s

This commit is contained in:
icurfer 2025-01-28 10:01:28 +09:00
parent 1d38fe26bd
commit aacd0e47d2
4 changed files with 16 additions and 6 deletions

View File

@ -7,7 +7,7 @@ class IPManagementRecord(models.Model):
network_nm = models.CharField(max_length=100) # NETWORK_NM
ip_addrs = models.CharField(max_length=50) # IP_ADDRS
svr_nm = models.CharField(max_length=100) # SVR_NM
contents = models.TextField(blank=True, null=True) # DESC
contents = models.TextField(blank=True, null=True) # desc -> contents
remark = models.TextField(blank=True, null=True) # REMARK
created_at = models.DateTimeField(auto_now_add=True) # 생성 시간 자동 기록
updated_at = models.DateTimeField(auto_now=True) # 수정 시간 자동 기록

View File

@ -62,7 +62,7 @@ def add_ip_record(request):
network_nm = request.POST.get("network_nm")
ip_addrs = request.POST.get("ip_addrs")
svr_nm = request.POST.get("svr_nm")
desc = request.POST.get("desc")
contents = request.POST.get("contents")
remark = request.POST.get("remark")
# 작성자 (author)는 로그인된 사용자로 설정
author = request.user
@ -71,7 +71,7 @@ def add_ip_record(request):
network_nm=network_nm,
ip_addrs=ip_addrs,
svr_nm=svr_nm,
desc=desc,
contents=contents,
remark=remark,
author=author,
)
@ -96,7 +96,7 @@ def edit_ip_record(request, pk):
record.network_nm = request.POST.get("network_nm")
record.ip_addrs = request.POST.get("ip_addrs")
record.svr_nm = request.POST.get("svr_nm")
record.desc = request.POST.get("desc")
record.contents = request.POST.get("contents")
record.remark = request.POST.get("remark")
record.save()
return redirect("/ip_mgmt")

View File

@ -16,7 +16,17 @@ from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
load_dotenv(os.path.join(BASE_DIR, '.env.dev'))
# 우선순위: .env.prd > .env.dev > .env
if os.path.exists(os.path.join(BASE_DIR, '.env.prd')):
print("Read ::: .env.prd")
load_dotenv(os.path.join(BASE_DIR, '.env.prd'))
elif os.path.exists(os.path.join(BASE_DIR, '.env.dev')):
print("Read ::: .env.dev")
load_dotenv(os.path.join(BASE_DIR, '.env.dev'))
else:
print("Read ::: local_env")
# load_dotenv(os.path.join(BASE_DIR, '.env.dev'))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/

View File

@ -1 +1 @@
dev_0.0.26
dev_0.0.27