diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/.gitignore" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/.gitignore"
new file mode 100644
index 00000000..a966cc97
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/.gitignore"
@@ -0,0 +1,237 @@
+
+# Created by https://www.toptal.com/developers/gitignore/api/python,django,venv
+# Edit at https://www.toptal.com/developers/gitignore?templates=python,django,venv
+
+### Django ###
+*.log
+*.pot
+*.pyc
+__pycache__/
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+media
+
+# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
+# in your Git repository. Update and uncomment the following line accordingly.
+# /staticfiles/
+
+### Django.Python Stack ###
+# Byte-compiled / optimized / DLL files
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+### Database ###
+*.accdb
+*.db
+*.dbf
+*.mdb
+*.pdb
+*.sqlite3
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+
+# Django stuff:
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+### Python ###
+# Byte-compiled / optimized / DLL files
+
+# C extensions
+
+# Distribution / packaging
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+
+# Installer logs
+
+# Unit test / coverage reports
+
+# Translations
+
+# Django stuff:
+
+# Flask stuff:
+
+# Scrapy stuff:
+
+# Sphinx documentation
+
+# PyBuilder
+
+# Jupyter Notebook
+
+# IPython
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+
+# Celery stuff
+
+# SageMath parsed files
+
+# Environments
+
+# Spyder project settings
+
+# Rope project settings
+
+# mkdocs documentation
+
+# mypy
+
+# Pyre type checker
+
+# pytype static type analyzer
+
+# Cython debug symbols
+
+### venv ###
+# Virtualenv
+# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
+[Bb]in
+[Ii]nclude
+[Ll]ib
+[Ll]ib64
+[Ll]ocal
+[Ss]cripts
+pyvenv.cfg
+pip-selfcheck.json
+
+# End of https://www.toptal.com/developers/gitignore/api/python,django,venv
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/__init__.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/__init__.py"
new file mode 100644
index 00000000..e69de29b
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/admin.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/admin.py"
new file mode 100644
index 00000000..764e6050
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/admin.py"
@@ -0,0 +1,4 @@
+from django.contrib import admin
+from .models import User
+
+admin.site.register(User)
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/apps.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/apps.py"
new file mode 100644
index 00000000..2b08f1ad
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/apps.py"
@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class AccountConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'account'
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/migrations/0001_initial.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/migrations/0001_initial.py"
new file mode 100644
index 00000000..85fb23ac
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/migrations/0001_initial.py"
@@ -0,0 +1,46 @@
+# Generated by Django 3.2.4 on 2021-07-17 15:30
+
+import django.contrib.auth.models
+import django.contrib.auth.validators
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ('auth', '0012_alter_user_first_name_max_length'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='User',
+ fields=[
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('password', models.CharField(max_length=128, verbose_name='password')),
+ ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
+ ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
+ ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
+ ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
+ ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
+ ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
+ ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
+ ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
+ ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
+ ('nickname', models.CharField(max_length=50)),
+ ('university', models.CharField(max_length=50)),
+ ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
+ ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
+ ],
+ options={
+ 'verbose_name': 'user',
+ 'verbose_name_plural': 'users',
+ 'abstract': False,
+ },
+ managers=[
+ ('objects', django.contrib.auth.models.UserManager()),
+ ],
+ ),
+ ]
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/migrations/__init__.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/migrations/__init__.py"
new file mode 100644
index 00000000..e69de29b
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/models.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/models.py"
new file mode 100644
index 00000000..7113a019
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/models.py"
@@ -0,0 +1,7 @@
+from django.db import models
+
+from django.contrib.auth.models import AbstractUser
+
+class User(AbstractUser):
+ nickname = models.CharField(max_length=50)
+ university = models.CharField(max_length=50)
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/static/css/home.css" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/static/css/home.css"
new file mode 100644
index 00000000..2a107b69
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/static/css/home.css"
@@ -0,0 +1,7 @@
+.header{
+ display: flex;
+ border-bottom: 1px solid black;
+ justify-content: center;
+ align-items: center;
+ background-color: pink;
+}
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/login.html" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/login.html"
new file mode 100644
index 00000000..3466e70a
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/login.html"
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% load static %}
+{% block link %}{% static 'css/home.css' %}{% endblock %}
+{% block title %} login {% endblock %}
+{% block contents %}
+
+
+
+ {% block contents %}
+ {% endblock %}
+
+{% endblock %}
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/mypage.html" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/mypage.html"
new file mode 100644
index 00000000..3f0f4d17
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/mypage.html"
@@ -0,0 +1,13 @@
+{% extends "base.html" %}
+{% load static %}
+{% block link %}{% static 'css/home.css' %}{% endblock %}
+{% block title %} My Page {% endblock %}
+{% block contents %}
+
내 정보
+ 아이디 :
+ {{user.username}}
+ 별명 :
+ {{user.nickname}}
+ 대학교 :
+ {{user.university}}
+{% endblock %}
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/signup.html" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/signup.html"
new file mode 100644
index 00000000..36079f2f
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/templates/signup.html"
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+{% load static %}
+{% block link %}{% static 'css/home.css' %}{% endblock %}
+{% block title %} login {% endblock %}
+{% block contents %}
+
+{% endblock %}
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/tests.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/tests.py"
new file mode 100644
index 00000000..7ce503c2
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/tests.py"
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/urls.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/urls.py"
new file mode 100644
index 00000000..a2c65b76
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/urls.py"
@@ -0,0 +1,9 @@
+from django.urls import path
+from . import views
+
+urlpatterns = [
+ path('signup', views.user_signup, name='signup'),
+ path('login', views.user_login, name="login"),
+ path('logout', views.user_logout, name="logout"),
+ path('mypage', views.mypage, name="mypage"),
+]
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/views.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/views.py"
new file mode 100644
index 00000000..bffb4601
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/account/views.py"
@@ -0,0 +1,51 @@
+from django.shortcuts import redirect, render
+from django.contrib.auth import authenticate, login, logout
+
+from .models import User
+from django.contrib import auth
+
+# def home(request):
+# return render(request, 'home.html')
+
+def user_signup(request):
+ if request.method == "POST":
+ if request.POST["password"] == request.POST["password2"]:
+ user = User.objects.create_user(
+ username = request.POST["username"],
+ password = request.POST["password"],
+ nickname = request.POST["nickname"],
+ university = request.POST["university"],
+ )
+ user.save()
+ auth.login(request, user)
+ return redirect('home')
+
+ else:
+ return render(request, 'signup.html')
+
+ else:
+ return render(request, 'signup.html')
+
+def user_login(request):
+ if request.method == "POST":
+ username = request.POST["username"]
+ password = request.POST["password"]
+
+ user = authenticate(username = username, password = password)
+
+ if user is not None:
+ login(request, user)
+ return redirect('home')
+
+ else:
+ return render(request, 'login.html', {'error': '아이디와 비밀번호가 맞지 않습니다.'})
+
+ else:
+ return render(request, 'login.html')
+
+def user_logout(request):
+ logout(request)
+ return redirect('home')
+
+def mypage(request):
+ return render(request, 'mypage.html')
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/__init__.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/__init__.py"
new file mode 100644
index 00000000..e69de29b
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/admin.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/admin.py"
new file mode 100644
index 00000000..22759a39
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/admin.py"
@@ -0,0 +1,5 @@
+from django.contrib import admin
+from .models import *
+
+admin.site.register(Board)
+admin.site.register(Comment)
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/apps.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/apps.py"
new file mode 100644
index 00000000..8e13c06b
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/apps.py"
@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class BoardConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'board'
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/migrations/0001_initial.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/migrations/0001_initial.py"
new file mode 100644
index 00000000..6a16657b
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/migrations/0001_initial.py"
@@ -0,0 +1,37 @@
+# Generated by Django 3.2.4 on 2021-07-17 15:30
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Board',
+ fields=[
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('title', models.CharField(max_length=100)),
+ ('body', models.TextField()),
+ ('pub_date', models.DateTimeField()),
+ ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Comment',
+ fields=[
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('content', models.CharField(max_length=100)),
+ ('create_date', models.DateField(auto_now=True)),
+ ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
+ ('board', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='board.board')),
+ ],
+ ),
+ ]
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/migrations/__init__.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/migrations/__init__.py"
new file mode 100644
index 00000000..e69de29b
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/models.py" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/models.py"
new file mode 100644
index 00000000..5513c4c7
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/models.py"
@@ -0,0 +1,21 @@
+from django.db import models
+from django.db.models.fields.related import ForeignKey
+from django.utils import timezone
+
+class Board(models.Model):
+ title = models.CharField(max_length=100)
+ body = models.TextField()
+ pub_date = models.DateTimeField()
+ author = models.ForeignKey('account.User', on_delete=models.CASCADE)
+
+ def __str__(self):
+ return self.title
+
+class Comment(models.Model):
+ content = models.CharField(max_length=100)
+ author = models.ForeignKey('account.User', on_delete=models.CASCADE)
+ board = models.ForeignKey(Board, on_delete=models.CASCADE)
+ create_date = models.DateField(auto_now = True)
+
+ def __str__(self):
+ return self.content
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/static/css/home.css" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/static/css/home.css"
new file mode 100644
index 00000000..8c3e6e8b
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/static/css/home.css"
@@ -0,0 +1,8 @@
+.header{
+ background-color: red;
+}
+
+.home-logo{
+ color: black;
+ text-decoration-line: none;
+}
\ No newline at end of file
diff --git "a/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/templates/base.html" "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/templates/base.html"
new file mode 100644
index 00000000..cc4e8c93
--- /dev/null
+++ "b/17_\354\261\204\355\235\254\354\260\254/session9, 10/board/templates/base.html"
@@ -0,0 +1,43 @@
+{% load static %}
+
+
+
+
+
+
+
+
+
+
{% block title %}{% endblock %}
+
+
+