Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 3.2.18 on 2023-05-18 00:18

from django.conf import settings
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='Profile',
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=10)),
('photo', models.ImageField(blank=True, upload_to='profile/')),
('follower_set', models.ManyToManyField(blank=True, related_name='following_set', to=settings.AUTH_USER_MODEL)),
('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()),
],
),
]
105 changes: 42 additions & 63 deletions accounts/templates/accounts/profile.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
{% load bootstrap4 %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
{% extends 'base.html' %}
{% load static %} {% load bootstrap4 %}
{% block head %}
<title>RED-GLASSES</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="profile.css" />
</head>
<body>
<link rel="stylesheet" href="{% static 'css/profile.css' %}" />
{% endblock head %}
{% block content %}
<!--User 모델의 인스턴스 -->
<!--로그아웃 시에는 AnonymousUser-->
<h1>{{ user }}</h1>
{{ user.is_authenticated }}
{% comment %} <a href="{% url 'accounts:profile_edit' %}">프로필 수정</a> {% endcomment %}
<div class="container">
{{ user.is_authenticated }} {% comment %}
<a href="{% url 'accounts:profile_edit' %}">프로필 수정</a> {% endcomment %}
<div class="profile-container">
<div class="img-cover">
<img
src="https://t1.daumcdn.net/cfile/tistory/21070B395466C1101D"
Expand All @@ -29,7 +25,7 @@ <h1>{{ user }}</h1>
</div>
<div class="profile-info">
<div class="profile-image"></div>
<h3><b>조정곤</b></h3>
<h3><b>{{person}}</b></h3>
<p>프로필이 없습니다.</p>
</div>
<div class="like">
Expand All @@ -41,64 +37,47 @@ <h3><b>조정곤</b></h3>
<span class="text-middle">&nbsp취향분석</span>
</div>
</div>
<div class="card-box">
<!-- 캐로젤 -->
<div
id="carouselExampleControls"
class="carousel slide"
data-bs-ride="carousel"
>
<div class="carousel-inner">
<div class="carousel-item active d-flex justify-content-between">
<div class="card-carousel">
<div>
<h6><b>영화</b></h6>
<div><b>★11</b></div>
</div>
<div class="text-small">보고싶어요 <span>0</span></div>
<!-- 박스 -->
{% comment %} <div>
<div class="accordion accordion-flush" id="accordionFlushExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
영화
</button>
</h2>
</div>
<div class="card-carousel">
<div>
<h6><b>TV프로그램</b></h6>
<div><b>★3</b></div>
</div>
<div class="text-small">보고싶어요 <span>0</span></div>
</div>
<div class="card-carousel">
<div>
<h6><b>책</b></h6>
<div><b>★0</b></div>
</div>
<div class="text-small">읽고싶어요 <span>0</span></div>
<div id="flush-collapseOne" class="accordion-collapse collapse" data-bs-parent="#accordionFlushExample">
<div class="accordion-body"><div class="title">★0</div>
<div class="text">보고싶어요<span>0</span></div></div>
</div>
</div>
</div> {% endcomment %}
{% comment %} flush {% endcomment %}
<ul class="list-group list-group-flush">
<li class="list-group-item">영화</li>
<li class="list-group-item">★0</li>
<li class="list-group-item">보고싶어요<span>0</span></li>
</ul>


<div class="d-flex justify-content-center m-5">
<div class="d-grid gap-3 d-md-flex justify-content-md-end">
<button type="button" class="btn btn-outline-secondary">
로그아웃
</button>
<button type="button" class="btn btn-outline-secondary">
회원탈퇴
</button>
</div>
<button
class="carousel-control-prev"
type="button"
data-bs-target="#carouselExampleControls"
data-bs-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button
class="carousel-control-next"
type="button"
data-bs-target="#carouselExampleControls"
data-bs-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>

<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"
></script>
</body>
{% endblock content %}
</html>

88 changes: 88 additions & 0 deletions accounts/templates/profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{% extends 'base.html' %}
{% load static %}

{% block head %}
<title>Document</title>
<link rel="stylesheet" href="{% static 'css/profile.css' %}" />
{% endblock head %}

{% block content %}
<!--User 모델의 인스턴스 -->
<!--로그아웃 시에는 AnonymousUser-->
<h1>{{ user }}</h1>
{{ user.is_authenticated }}
<a href="{% url 'accounts:profile_edit' %}">프로필 수정</a>
<div class="container">
<div class="img-cover">
<img src="https://t1.daumcdn.net/cfile/tistory/21070B395466C1101D" alt="" />
</div>
<div class="profile-info">
<div class="profile-image"></div>
<h3><b>조정곤</b></h3>
<p>프로필이 없습니다.</p>
</div>
<div class="like">
<div class="d-flex align-items-center">
<img
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIvPgogICAgICAgIDxwYXRoIGZpbGw9IiNFRjY5MkUiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTEuMTggMTEuOTZoMy43NHY4LjM2SDEuMTh6TTE1Ljc1IDE2LjgzaDMuNzR2My40OWgtMy43NHpNNi4wNCA5LjEyaDMuNzR2MTEuMkg2LjA0ek0xMC45IDEzLjg0aDMuNzR2Ni40OEgxMC45eiIvPgogICAgICAgIDxwYXRoIGZpbGw9IiNGRkNBMjIiIGQ9Ik0xNy40NCAxLjM3bDEuNjYgNCA0LjMxLjM0LTMuMjggMi44MSAxIDQuMjEtMy42OS0yLjI2LTMuNjkgMi4yNiAxLjAxLTQuMjEtMy4yOS0yLjgxIDQuMzItLjM0eiIvPgogICAgPC9nPgo8L3N2Zz4K"
alt=""
/>
<span class="text-middle">&nbsp취향분석</span>
</div>
</div>
<div class="card-box">
<!-- 캐로젤 -->
<div
id="carouselExampleControls"
class="carousel slide"
data-bs-ride="carousel"
>
<div class="carousel-inner">
<div class="carousel-item active d-flex justify-content-between">
<div class="card-carousel">
<div>
<h6><b>영화</b></h6>
<div><b>★11</b></div>
</div>
<div class="text-small">보고싶어요 <span>0</span></div>
</div>
<div class="card-carousel">
<div>
<h6><b>TV프로그램</b></h6>
<div><b>★3</b></div>
</div>
<div class="text-small">보고싶어요 <span>0</span></div>
</div>
<div class="card-carousel">
<div>
<h6><b>책</b></h6>
<div><b>★0</b></div>
</div>
<div class="text-small">읽고싶어요 <span>0</span></div>
</div>
</div>
</div>
<button
class="carousel-control-prev"
type="button"
data-bs-target="#carouselExampleControls"
data-bs-slide="prev"
>
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button
class="carousel-control-next"
type="button"
data-bs-target="#carouselExampleControls"
data-bs-slide="next"
>
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
{% endblock content %}

{% block script %}{% endblock script %}
64 changes: 64 additions & 0 deletions posts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by Django 3.2.18 on 2023-05-18 00:18

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='Comment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('movie', models.IntegerField()),
('content', models.CharField(max_length=200)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('like_users', models.ManyToManyField(related_name='like_comments', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50, unique=True)),
],
),
migrations.CreateModel(
name='Recomment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.CharField(max_length=200)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='posts.comment')),
('like_users', models.ManyToManyField(related_name='like_recomments', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=80)),
('image', models.ImageField(upload_to='posters/')),
('content', models.TextField()),
('score', models.FloatField(null=True)),
('released_at', models.CharField(max_length=200)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('Tag_set', models.ManyToManyField(blank=True, to='posts.Tag')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('like_users', models.ManyToManyField(related_name='like_posts', to=settings.AUTH_USER_MODEL)),
],
),
]
Loading