Skip to content

Commit

Permalink
Debugging Django error correction progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ankiwoong committed May 3, 2020
1 parent dbad393 commit 511dacb
Show file tree
Hide file tree
Showing 265 changed files with 23 additions and 37,485 deletions.
18 changes: 8 additions & 10 deletions anjia/settings.py
Expand Up @@ -20,12 +20,12 @@
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '3$$3%0-zaudfy0!+5!8#(nyd7y_h0n*n8*a1*=gj@k0_elcy%g'
SECRET_KEY = 'cm^jyqm^qxfh8cxpe^=o$q-t5a_x=tw82=$v3$9y6qq@t*3svd'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['192.168.56.101', 'localhost', '127.0.0.1']
ALLOWED_HOSTS = ['*']


# Application definition
Expand All @@ -37,7 +37,10 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog.apps.BlogConfig', # blog app 추가
]

INSTALLED_APPS += [
'blog.apps.BlogConfig',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -104,9 +107,9 @@
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'ko-kr' # 언어 : 한국
LANGUAGE_CODE = 'ko'

TIME_ZONE = 'Asia/Seoul' # 타임존 : 한국 시간(기본 : UTC(세계표준시))
TIME_ZONE = 'Asia/Seoul'

USE_I18N = True

Expand All @@ -119,8 +122,3 @@
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'

# STATIC File
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
6 changes: 3 additions & 3 deletions anjia/urls.py
Expand Up @@ -20,10 +20,10 @@
from django.conf import settings
from django.conf.urls.static import static


# http://localhost:8000/ => http://localhost:8000/blog
urlpatterns = [
path('admin/', admin.site.urls),
# 주소창에 blog를 입력시 blog.urls가 처리
path('blog/', include('blog.urls')),
# 기본주소로 처리시 blog로 넘겨준다.
path('', RedirectView.as_view(url='/blog/', permanent=True)),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) # 정적 파일 처리
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) # staic 정적 파일 처리
3 changes: 0 additions & 3 deletions blog/admin.py
@@ -1,6 +1,3 @@
from django.contrib import admin
from blog.models import Category, Post

# Register your models here.
admin.site.register(Category)
admin.site.register(Post)
33 changes: 0 additions & 33 deletions blog/migrations/0001_initial.py

This file was deleted.

35 changes: 0 additions & 35 deletions blog/models.py
@@ -1,38 +1,3 @@
from django.db import models
from django.urls import reverse

# Create your models here.
# 글의 분류(일상, 유머, 정보)


class Category(models.Model):
# 분류 : 최대길이 50자
name = models.CharField(max_length=50, help_text="분류를 입력하세요.")

def __str__(self):
return self.name

# 블로그 글(제목, 작성일, 대표이미지, 내용, 분류)


class Post(models.Model):
# 글 제목 : 최대길이 200자
title = models.CharField(max_length=200)
# 대표 이미지 : 비어있어도 됨
title_image = models.ImageField(blank=True)
# 글 내용 : 내용의 글자수는 정해지지 않으므로 TextField
content = models.TextField()
# 작성일 : 사용자가 입력하지 않고 현재 날짜를 받아옴
createDate = models.DateTimeField(auto_now_add=True)
# 수정일 : 사용자가 입력하지 않고 현재 날짜를 받아옴
updateDate = models.DateTimeField(auto_now_add=True)
# 분류 : 다대다 관계정의
category = models.ManyToManyField(Category, help_text='분류를 입력하세요.')

def __str__(self):
return self.title

# 1번 글의 경우 -> single/1

def get_absolute_url(self):
return reverse('single', args=[str(self.id)])

0 comments on commit 511dacb

Please sign in to comment.