Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

프로필 미모티콘 필드 추가 #42

Open
wants to merge 2 commits into
base: main2
Choose a base branch
from
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
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions runningmate/addproject/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import *


admin.site.register(Project)
6 changes: 6 additions & 0 deletions runningmate/addproject/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AddprojectConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'addproject'
28 changes: 28 additions & 0 deletions runningmate/addproject/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.0.4 on 2022-07-06 01:51

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Project',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=20)),
('intro', models.CharField(max_length=50)),
('otheruser', models.ImageField(blank=True, null=True, upload_to='calendar/')),
('pub_date', models.DateTimeField(verbose_name='date published')),
],
options={
'verbose_name': '프로젝트기간',
'verbose_name_plural': '프로젝트기간들',
},
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.0.4 on 2022-07-06 02:53

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('addproject', '0001_initial'),
]

operations = [
migrations.AlterModelOptions(
name='project',
options={'verbose_name': '프로젝트', 'verbose_name_plural': '프로젝트들'},
),
migrations.RenameField(
model_name='project',
old_name='otheruser',
new_name='usericon',
),
migrations.RemoveField(
model_name='project',
name='pub_date',
),
migrations.AddField(
model_name='project',
name='endday',
field=models.DateField(default=django.utils.timezone.now, verbose_name='date published'),
),
migrations.AddField(
model_name='project',
name='startday',
field=models.DateField(default=django.utils.timezone.now, verbose_name='date published'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.0.4 on 2022-07-06 02:54

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('addproject', '0002_alter_project_options_and_more'),
]

operations = [
migrations.AlterField(
model_name='project',
name='endday',
field=models.DateField(default=django.utils.timezone.now, verbose_name='프로젝트 마감일'),
),
migrations.AlterField(
model_name='project',
name='startday',
field=models.DateField(default=django.utils.timezone.now, verbose_name='프로젝트 시작일'),
),
]
17 changes: 17 additions & 0 deletions runningmate/addproject/migrations/0004_remove_project_usericon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.0.4 on 2022-07-06 03:00

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('addproject', '0003_alter_project_endday_alter_project_startday'),
]

operations = [
migrations.RemoveField(
model_name='project',
name='usericon',
),
]
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions runningmate/addproject/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from tabnanny import verbose
from django.db import models
from django.forms import *
from datetime import *

from django.contrib.auth.models import *


# Create your models here.
class Project(models.Model):
startday = models.DateField('프로젝트 시작일', default = timezone.now) # 시작기간 입력 날짜만
endday = models.DateField('프로젝트 마감일', default = timezone.now) # 종료기간 입력 날짜만
title = models.CharField(max_length=20) # 과목명
intro = models.CharField(max_length=50) # 프로젝트 상세내용


class Meta:
verbose_name = '프로젝트'
verbose_name_plural = '프로젝트들'

Empty file.
3 changes: 3 additions & 0 deletions runningmate/addproject/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.
7 changes: 7 additions & 0 deletions runningmate/addproject/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path, include
from .views import *

app_name = "addproject"
urlpatterns = [
path('addproject/', addproject, name='addproject'),
]
6 changes: 6 additions & 0 deletions runningmate/addproject/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.shortcuts import render
from .models import *

def addproject(request):
projects = Project.objects.all()
return render(request, 'addproject.html')
Binary file removed runningmate/db.sqlite3
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/mateapp/__pycache__/views.cpython-39.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions runningmate/mateapp/migrations/0002_delete_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.0.4 on 2022-07-06 02:53

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('mateapp', '0001_initial'),
]

operations = [
migrations.DeleteModel(
name='Project',
),
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 10 additions & 7 deletions runningmate/mateapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ class Meta:
# 캘린더 모델을 다룰거다라는 request를 보냄 but 반영이 안돼서 에러가뜸
# no such column 은 migrations 오류임

class Project(models.Model):
id = models.AutoField(primary_key=True)
title = models.CharField(max_length=200)
writer = models.ForeignKey(User,on_delete=models.CASCADE)
pub_date = models.DateTimeField()
body = models.TextField()

# 프로젝트 입력폼을 만들기 위해 주석처리
# class Project(models.Model):
# id = models.AutoField(primary_key=True)
# title = models.CharField(max_length=200)
# writer = models.ForeignKey(User,on_delete=models.CASCADE)
# pub_date = models.DateTimeField()
# body = models.TextField()

class TodoTitle(models.Model):
id = models.AutoField(primary_key=True)
Expand All @@ -42,4 +44,5 @@ class TodoComment(models.Model):
content = models.TextField()
post = models.ForeignKey(TodoTitle ,on_delete=models.CASCADE, related_name ='comments')
created_at = models.DateTimeField(auto_now_add=True)
update_at = models.DateTimeField(auto_now=True)
update_at = models.DateTimeField(auto_now=True)

13 changes: 2 additions & 11 deletions runningmate/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
asgiref==3.5.2
certifi==2022.6.15
cffi==1.15.0
charset-normalizer==2.1.0
cryptography==37.0.2
defusedxml==0.7.1
Django==4.0.5
Django==4.0.4
django-allauth==0.51.0
django-rest-framework==0.1.0
djangorestframework==3.13.1
idna==3.3
oauthlib==3.2.0
Pillow==9.1.1
pycparser==2.21
PyJWT==2.4.0
PyMySQL==1.0.2
python3-openid==3.2.0
pytz==2022.1
requests==2.28.1
requests==2.28.1
requests-oauthlib==1.3.1
sqlparse==0.4.2
urllib3==1.26.9
Binary file modified runningmate/runningmate/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/runningmate/__pycache__/settings.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/runningmate/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/runningmate/__pycache__/wsgi.cpython-39.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions runningmate/runningmate/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'allauth.socialaccount.providers.google',
'users',
'rest_framework',
'addproject',
]

REST_FRAMEWORK = {
Expand Down
1 change: 1 addition & 0 deletions runningmate/runningmate/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
path('admin/', admin.site.urls),
path('',include('mateapp.urls')),
path('accounts/',include('allauth.urls')),
path('addproject/', include('addproject.urls')),
path('login/', views.login, name="login"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Binary file modified runningmate/users/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/users/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/users/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/users/__pycache__/forms.cpython-39.pyc
Binary file not shown.
Binary file modified runningmate/users/__pycache__/models.cpython-39.pyc
Binary file not shown.
18 changes: 18 additions & 0 deletions runningmate/users/migrations/0002_profile_usericon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2022-07-06 03:00

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='profile',
name='usericon',
field=models.ImageField(blank=True, null=True, upload_to=''),
),
]
Binary file not shown.
Binary file not shown.
Binary file modified runningmate/users/migrations/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions runningmate/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE) # 유저 삭제시 프로필도 같이 삭제됨
phone = models.CharField(max_length=13) # 폰 번호
timetable = models.ImageField(upload_to = "calendar/", blank=True, null=True) # 사용자들이 시간표를 올릴 때마다 media/calendar에 저장됨
usericon = models.ImageField(blank=True, null=True) # 미모티콘


class Meta:
Expand Down