Skip to content

Commit

Permalink
Merge branch 'feature/random-playlist-crud/#16' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TGoddessana authored Sep 19, 2022
2 parents 63a3536 + 09103a8 commit d681214
Show file tree
Hide file tree
Showing 37 changed files with 12 additions and 622 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
__pycache__/
db.sqlite3
/venv
.idea
media
.idea
1 change: 0 additions & 1 deletion backend/accounts/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
default_app_config = 'accounts.apps.AccountsConfig'
5 changes: 1 addition & 4 deletions backend/accounts/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from django.contrib import admin
from .models import Profile

@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
pass
# Register your models here.
3 changes: 0 additions & 3 deletions backend/accounts/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'

def ready(self):
import accounts.signals
31 changes: 0 additions & 31 deletions backend/accounts/migrations/0001_initial.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/accounts/migrations/0002_alter_profile_nickname.py

This file was deleted.

19 changes: 0 additions & 19 deletions backend/accounts/migrations/0003_alter_profile_profile_pic.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/accounts/migrations/0004_alter_profile_profile_pic.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/accounts/migrations/0005_alter_profile_profile_pic.py

This file was deleted.

18 changes: 0 additions & 18 deletions backend/accounts/migrations/0006_alter_profile_profile_pic.py

This file was deleted.

23 changes: 1 addition & 22 deletions backend/accounts/models.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
from django.conf import settings
from django.db import models


class TimeStampedModel(models.Model):
'''
모든 모델의 기본이 되는 TimeStampedModel
생성일자, 수정일자가 자동 추가되도록
'''
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

class Meta:
abstract = True


class Profile(TimeStampedModel):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
nickname = models.CharField(max_length=150, unique=True, null=True)
profile_pic = models.ImageField(null=True, upload_to="profiles/%Y/%m/%d")


def __str__(self):
return f'{self.pk}:{self.user.username} Profile'
# Create your models here.
8 changes: 0 additions & 8 deletions backend/accounts/serializers.py

This file was deleted.

15 changes: 0 additions & 15 deletions backend/accounts/signals.py

This file was deleted.

10 changes: 0 additions & 10 deletions backend/accounts/urls.py

This file was deleted.

9 changes: 2 additions & 7 deletions backend/accounts/views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from rest_framework.viewsets import ModelViewSet
from .models import Profile
from .serializers import ProfileSerializer
from django.shortcuts import render


class ProfileViewSet(ModelViewSet):
queryset = Profile.objects.all()
serializer_class = ProfileSerializer
# Create your views here.
5 changes: 1 addition & 4 deletions backend/backend/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent
print(BASE_DIR)
ROOT_DIR = os.path.dirname(BASE_DIR)


# Quick-start development settings - unsuitable for production
Expand Down Expand Up @@ -44,7 +42,7 @@
'rest_framework',
# local apps
'plinic',
'accounts.apps.AccountsConfig',
'accounts'
]

MIDDLEWARE = [
Expand Down Expand Up @@ -107,7 +105,6 @@
},
]

AUTH_USER_MODEL = "auth.User"

# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
Expand Down
3 changes: 1 addition & 2 deletions backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

urlpatterns = [
path('admin/', admin.site.urls),
path('plinic-api/', include("plinic.urls")),
path('accounts-api/', include("accounts.urls")),
path('', include("plinic.urls")),
]

if settings.DEBUG:
Expand Down
Binary file added backend/media/profiles/2022/08/07/profile.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/media/profiles/2022/09/01/펭수.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/media/thumbnails/2022/08/07/profile.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/media/thumbnails/2022/08/19/pic.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/media/thumbnails/2022/09/12/이두근.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 1 addition & 31 deletions backend/plinic/admin.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
from django.contrib import admin

from .models import Genre, Post, Notice, Playlist, Tag, Track


@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
pass


@admin.register(Notice)
class NoticeAdmin(admin.ModelAdmin):
pass


@admin.register(Playlist)
class PostAdmin(admin.ModelAdmin):
pass


@admin.register(Genre)
class GenreAdmin(admin.ModelAdmin):
pass


@admin.register(Tag)
class TagAdmin(admin.ModelAdmin):
pass


@admin.register(Track)
class TrackAdmin(admin.ModelAdmin):
pass
# Register your models here.
89 changes: 0 additions & 89 deletions backend/plinic/migrations/0001_initial.py

This file was deleted.

Loading

0 comments on commit d681214

Please sign in to comment.