Skip to content

Commit

Permalink
feat: terms of uses
Browse files Browse the repository at this point in the history
  • Loading branch information
power16one5 committed Mar 18, 2024
1 parent 7d997fb commit dfa6edf
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/project/project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"django.contrib.staticfiles",
"app",
"users",
"terms_of_use",
]

MIDDLEWARE = [
Expand Down
1 change: 1 addition & 0 deletions web/project/project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
path("auth/", include("auth.urls")),
path("users/", include("users.urls")),
path("admin/", admin.site.urls),
path("terms_of_use/", include("terms_of_use.urls")),
]
132 changes: 132 additions & 0 deletions web/project/templates/terms_of_use/terms_of_use.html

Large diffs are not rendered by default.

Empty file.
3 changes: 3 additions & 0 deletions web/project/terms_of_use/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions web/project/terms_of_use/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class TermsOfUseConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "terms_of_use"
29 changes: 29 additions & 0 deletions web/project/terms_of_use/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 5.0.2 on 2024-03-15 05:07

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = []

operations = [
migrations.CreateModel(
name="TermsOfUse",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("content", models.TextField()),
("updated_at", models.DateTimeField(auto_now=True)),
],
),
]
Empty file.
9 changes: 9 additions & 0 deletions web/project/terms_of_use/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.db import models

# Create your models here.
class TermsOfUse(models.Model):
content = models.TextField()
updated_at = models.DateTimeField(auto_now=True)

def __str__(self):
return f"이용약관 업데이트 시간: {self.updated_at}"
3 changes: 3 additions & 0 deletions web/project/terms_of_use/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
6 changes: 6 additions & 0 deletions web/project/terms_of_use/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path
from .views import terms_of_use_view

urlpatterns = [
path('', terms_of_use_view, name='terms_of_use'),
]
8 changes: 8 additions & 0 deletions web/project/terms_of_use/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.shortcuts import render
from .models import TermsOfUse

# Create your views here.

def terms_of_use_view(request):
terms = TermsOfUse.objects.first() # 가장 최근의 이용약관을 가져옵니다.
return render(request, 'terms_of_use/terms_of_use.html', {'terms': terms})

0 comments on commit dfa6edf

Please sign in to comment.