수강이 제한됩니다.
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
질문있습니다 제발...
저는 aws의 lightsail을 이용하여 nginx와 gunicorn 설정까지 완료했습니다 근데 http://3.35.19.80/blog/ 로 접속하니 이렇게 뜹니다... read more를 클릭하면 흰창에 server error(500)만 뜨고요 이번에 한이음에서 클라우드를 지원해줘서 강사님의 강의와 다르게 진행했는데 이 문제에 대해 조언을 주실수 있을지 여쭤봅니다 그리고 저는 2주일동안 이것만 머리털빠져라 헤매면서 겨우겨우해도 성공하기 힘든데 강사님이 하는 방법은 왜이렇게 간단한건가요 ㅠ
- 해결됨파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
VPS연결 관련, 숫자 도메인은 접속이 되는데, garbia 구입 도메인으로 접속 안되는 문제
안녕하세요. 도메인 구입하고 VPS에 연결하기 수업 관련 질문 드립니다. 저랑 비슷한 질문을 하신 분들이 좀 계신 것 같은데요. 숫자 도메인으로는 접속이 되는데, gabia에서 구입한 도메인으로는 접속이 안됩니다. 저는 .kr 형태의 도메인을 구입했는데.. .com이 아닌 것이 문제인지.. garbia에서 무슨 네임서버 설정 관련 글들이 보이던데.. 이건 무엇인지... 끝까지 잘 따라왔는데.. 여기서 막히네요. 해법이 있는지 답변 부탁드립니다. 감사합니다.
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
태그 없애기
이미 태그가 선택된 포스트들은 태그를 바꿀순 있어도 아예 없애진 못하던데요.. 포스트를 날려버리고 새로 만들어야만 하나요?
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
강사님 소스코드를 그대로 가져왔는데 로그인과 admin페이지가 안들어가집니다..
제 원래코드의 문제점을 찾지못해서 강사님 코드로 실행하려고 했으나 로그인을 하려하면 이메일로 가입은 되나 구글로그인과 이메일로 로그인이 안되고 admin 에 접속하려하면 admin페이지를 들어가야 google allauth의 아이디와 키를 적용할수 있는데그것을 못하니 google allauth를 이용한 로그인이 안되는 것이고 admin 페이지는 로그인을 해야 접속할 수 있도록 코드가 작성되어 있어서두개가 충돌하는 문제일까요? 어떻게 해야 할까요 ㅠㅠ
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
createsuperuser할 때 패스워드 입력이 안됩니다.
Cmder 창에서 키보드를 아무리 눌러도 password 부분에서는 엔터키를 제외하고 먹지 않아서 superuser를 못만드는데 왜 그럴까요
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
google login 질문
영상 내용을 쭉 따라했는데 구글로그인이 안돼서 질문 남깁니다.. 이런 오류가 뜨면 어느부분을 수정해야 되나요..?
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
OperationalError at /blog/ 오류가 생겼습니다.ㅠㅠ
models 수정후 OperationalError at /blog/ 가 생겼습니다.(8.21 - 09:50여전히 해결안됨..)
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
models 헤드 부분 수정후
models 헤드 부분 수정후 이런 오류가 나오는데 어떻게해야될까요...
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
python manage.py test 오류
이런 오류가 납니다ㅠㅠ tests.py 코드 입니다 from django.test import TestCase, Clientfrom bs4 import BeautifulSoupfrom .models import Post, Category, Tagfrom django.utils import timezonefrom django.contrib.auth.models import Userdef create_category(name='life', description=''): category, is_created = Category.objects.get_or_create( name=name, description=description, ) category.slug = category.name.replace('', '-').replace('/', '') category.save() return categorydef create_tag(name='some tag'): tag, is_created = Tag.objects.get_or_create( name=name ) tag.slug = tag.name.replace('', '-').replace('/', '') tag.save() return tagdef create_post(title, content, author, category=None): blog_post = Post.objects.create( title=title, content=content, created=timezone.now(), author=author, category=category, ) return blog_postclass TestModel(TestCase): def setUp(self): self.client = Client() self.author_000 = User.objects.create(username='smith', password='nopassword') def test_category(self): category = create_category() post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, category=category, ) self.assertEqual(category.post_set.count(), 1) def test_tag(self): tag_000 = create_tag(name='bad_guy') tag_001 = create_tag(name='america') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, ) post_000.tags.add(tag_000) post_000.tags.add(tag_001) post_000.save() post_001 = create_post( title='Stay Fool, Stay Hungry', content='Story about Steve Jobs', author=self.author_000 ) post_001.tags.add(tag_001) post_001.save() self.assertEqual(post_000.tags.count(), 2) self.assertEqual(tag_001.post_set.count(), 2) self.assertEqual(tag_001.post_set.first(), post_000) self.assertEqual(tag_001.post_set.last(), post_001) def test_post(self): category=create_category( ) post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, category=category, )class TestView(TestCase): def setUp(self): self.client = Client() self.author_000 = User.objects.create_user(username='smith', password='nopassword') self.user_obama = User.objects.create_user(username='obama', password='nopassword') def check_navbar(self, soup): navbar = soup.find('div', id='navbar') self.assertIn('Blog', navbar.text) self.assertIn('About me', navbar.text) def check_right_side(self, soup): category_card = soup.find('div', id='category-card') self.assertIn('미분류 (1)', category_card.text) # 미분류 (1) 있어야 함 self.assertIn('정치/사회 (1)', category_card.text) # 정치/사회 (1) 있어야 함 def test_post_list_no_post(self): response = self.client.get('/blog/') self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') title = soup.title self.assertIn(title.text, 'Blog') self.check_navbar(soup) self.assertEqual(Post.objects.count(), 0) self.assertIn('아직 게시물이 없습니다.', soup.body.text) def test_post_list_with_post(self): tag_america = create_tag(name='america') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, ) post_000.tags.add(tag_america) post_000.save() post_001 = create_post( title='The first post', content='Second Second Second', author=self.author_000, category=create_category(name='정치/사회') ) post_001.tags.add(tag_america) post_001.save() self.assertGreater(Post.objects.count(), 0) response = self.client.get('/blog/') self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') body = soup.body self.assertNotIn('아직 게시물이 없습니다.', body.text) self.assertIn(post_000.title, body.text) post_000_read_more_btn = body.find('a', id='read-more-post-{}'.format(post_000.pk)) self.assertEqual(post_000_read_more_btn['href'], post_000.get_absolute_url()) self.check_right_side(soup) # main_div에는 main_div = soup.find('div', id='main_div') self.assertIn('정치/사회', main_div.text) # '정치/사회' 있어야 함 self.assertIn('미분류', main_div.text) # '미분류' 있어야 함 # Tag post_card_000 = main_div.find('div', id='post-card-{}'.format(post_000.pk)) self.assertIn('#america',post_card_000.text) #Tag가 해당 post의 card마다 있다. def test_post_detail(self): category_politics = create_category(name='정치/사회') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, category=category_politics ) tag_america = create_tag(name='america') post_000.tags.add(tag_america) post_000.save() post_001 = create_post( title='The first post', content='Second Second Second', author=self.author_000, ) self.assertGreater(Post.objects.count(), 0) post_000_url = post_000.get_absolute_url() self.assertEqual(post_000_url, '/blog/{}/'.format(post_000.pk)) response = self.client.get(post_000_url) self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') title = soup.title self.assertEqual(title.text, '{} - Blog'.format(post_000.title)) self.check_navbar(soup) body = soup.body main_div = body.find('div', id='main_div') self.assertIn(post_000.title, main_div.text) self.assertIn(post_000.author.username, main_div.text) self.assertIn(post_000.content, main_div.text) self.check_right_side(soup) # Tag self.assertIn('#america', main_div.text) # Tag가 해당 post의 card마다 있다. self.assertIn(category_politics.name, main_div.text)#category가 main_div에 있다. self.assertNotIn('EDIT', main_div.text)#EDIT 버튼이 로그인하지 않은 경우 보이지 않는다. login_success = self.client.login(username='smith', password='nopassword')#login을 한 경우에는 self.assertTrue(login_success) response = self.client.get(post_000_url) self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') main_div = soup.find('div', id='main-div') self.assertEqual(post_000.author, self.author_000) #post.author와 login한 사용자가 동일하다면 self.assertIn('EDIT', main_div.text) #EDIT 버튼이 있다. # 다른 사람인 경우에는 없다. login_success = self.client.login(username='obama', password='nopassword') #login을 한 경우에는 self.assertTrue(login_success) response = self.client.get(post_000_url) self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') main_div = soup.find('div', id='main-div') self.assertEqual(post_000.author, self.author_000) # post.author와 login한 사용자가 동일하다면 self.assertNotIn('EDIT', main_div.text) # EDIT 버튼이 있다. def test_post_list_by_category(self): category_politics = create_category(name='정치/사회') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, ) post_001 = create_post( title='The first post', content='Second Second Second', author=self.author_000, category=category_politics ) response = self.client.get(category_politics.get_absolute_url()) self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') main_div = soup.find('div', id='main_div') self.assertNotIn('미분류', main_div.text) self.assertIn(category_politics.name, main_div.text) def test_post_list_no_category(self): category_politics = create_category(name='정치/사회') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, ) post_001 = create_post( title='The first post', content='Second Second Second', author=self.author_000, category=category_politics ) response = self.client.get('/blog/category/_none/') self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') main_div = soup.find('div', id='main_div') self.assertIn('미분류', main_div.text) self.assertNotIn(category_politics.name, main_div.text) def test_tag_page(self): tag_000 = create_tag(name='bad_guy') tag_001 = create_tag(name='america') post_000 = create_post( title='The first post', content='Hello World. We are the world.', author=self.author_000, ) post_000.tags.add(tag_000) post_000.tags.add(tag_001) post_000.save() post_001 = create_post( title='Stay Fool, Stay Hungry', content='Story about Steve Jobs', author=self.author_000 ) post_001.tags.add(tag_001) post_001.save() response = self.client.get(tag_000.get_absolute_url()) self.assertEqual(response.status_code, 200) soup = BeautifulSoup(response.content, 'html.parser') main_div = soup.find('div', id='main-div') blog_h1 = main_div.find('h1', id='blog-list-title') self.assertIn('#{}'.format(tag_000.name), blog_h1.text) self.assertIn(post_000.title, main_div.text) self.assertNotIn(post_001.title, main_div.text)
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
migrate 에러 문의
저번에 awesome avartar 문의를 드렸었는데요 결국 포기하고 원상태로 복구시키려니 이런 에러가 뜹니다저번에 venv의 하위파일중 db를 건드렸던건지 venv안의 awesome avartar 파일들과 manage.py 파일들을 모두 삭제하고 진행시켰는데도 'blog_category'가 이미 있다고 뜹니다 전에는 blog_comment.author_id 가 있다고 뜨고 그 뒤엔 blog_comment가 이미있다고 뜨고 지금은 이상태입니다... 뭐가문제일까요 models.py와 views.py는 강사님과 다른게없습니다
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
category에서
models.py의 Post 클래스에서 category를 blank=True로 설정하잖아요. 차라리 '미분류'라는 디폴트값을 둘 순 없나요? 그러니까 모든 Post 모델들은 따로 설정하지 않았을때 '미분류' 카테고리에 자동으로 연결이 되는거죠. 그럼 템플릿에 굳이 if문으로 미분류 카테고리를 나눌 필요가 없지 않을까요
- 파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
runserver시 오류
삭제된 글입니다
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
git add에 관해서
안녕하세요 파이참에서도 정상적으로 settings,urls, py 파일 다 올라가있는데 git add 하면 추가되는 목록도 안뜨고 commit 해도 이상한 화면이 뜨네요; 결과적으로 깃허브에도 전혀 저장이 안된 상태구요! 어떻게 해결할 수 있을까요? ㄴ
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
pip install django 계속 오류납니다 ㅜ ㅜ
파이썬 , 아나콘다 다 지우고 다시 깔아도 보고 프로젝트 다 지우고 다시 만들어서 해봐도 오류가 해결이 안 됩니다 ㅜ 강의 들으시는 분들 중에서 저렇게 오류 난다고 하신 분들 질문도 다 읽어보고 구글링해서 방법 찾아서 다 해봐도 안 되네요 뭐가 문제인지를 모르겠어요 ,,, ㅜ ㅜ
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
가상환경 이렇게 뜨는데 이유를 모르겠어요...
(사진)
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
Category, body is not defined
cmder에 계속하여 Category와 body is not defiend라는 오류가 뜨는데 해결방법을 모르겠습니다.
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
로그인한 블로그와 시크릿창의 블로그페이지
로그인한 블로그와 시크릿창에서의 블로그에서 Newpost 버튼을 if 문으로 조작하는데 로그인한 상태에서의 블로그페이지를 어떻게 들어가야하는지 모르겠습니다다 Admin페이지에서 가는건가요? 새창에서 localhost/blog 하면 newpost 버튼이 안보이는 건 authenticate 가 아니어서 그런건 당연한데 Admin 페이지에서 로그인 한 다음의 블로그페이지는 어찌 들어가야하는지를 모르겠어요 그래서 new post버튼이 로그인페이지라고 인식을 안해서인지 if 문 코딩후 버튼이 안보여요
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
vps외에 다른 무료 서비스는 없나요?
서버를 공유하는 방법에 vps 말고, 무료로 사용할 수 있는 사이트는 없나요?
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
TypeError: argument of type 'WindowsPath' is not iterable 라는 오류가 발생합니다
이전에 장고 버전이 안 맞아서 생기는 오류가 발생해서, 장고를 3.0에서 2.2로 다시 깔아줬습니다. 그런데 그 뒤로 다시 이런 오류가 발생했습니다ㅠㅠ 이건 어떻게 해결하나요
- 미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
static 파일 경로질문
사정상 공부를 장기간 중단해서 처음부터 다시 복습중인 학생입니다. post_list.html에 있는 {% load static %} 가 뭔지 궁금해서 검색을 해봤더니 settings.py에 STATIC_URL = '/static/' 라고 작성해두면 {% static 'path' %} 가 /static/path 로 변환된다 라고 이해했는데요. 그럼 {% static 'blog/bootstrap/bootstrap.css' %}는 /static/blog/bootstrap/bootstrap.css 로 변환된다고 볼수있는데 static 파일의 경로는 blog/static/blog/bootstrap/bootstrap.css 아닌가요?