분류 전체보기
-
[WIL] 장고 팀프로젝트thoughts💭 2024. 8. 26. 18:42
장고 팀프로젝트를 하면서 실제로 웹페이지에 우리가 원하는 기능과 원하는 디자인이 구현되고 눈에 하나하나 보이니까 너무 재밌다. 그래서 자꾸 잘 하지 못하면서도 자꾸자꾸 욕심이 생긴다. 그래서 자꾸 뭔가 더 만들어보고 싶고.. 근데 낯설고 어려워서 자꾸 밤을 새고.. ㅎㅎ 그리고 모를 때마다 영환님이 너무 잘 가르쳐주셔서 정말 감사하다. 나현님은 우리 프로젝트의 디자인 팀장님?인데 덕분에 더 예쁜 웹페이지가 만들어진다. 그리고 말씀하시는게 너무 귀여우시다. 나희님은 부트캠프 중에 가장 막내가 아닐까 싶은데 개발을 뚝딱뚝딱 너무 잘 하신다. 어디가셨지 하면 방송실이나 모각코방에 가 계시곤 하는데 그러다 조용히 와서 찌르기를 하시는데 그럼 기능 하나가 구현됐다는 의미다.ㅋㅋ 귀여우심ㅎㅎㅎ 이번에도 너무 좋..
-
git init부터 merge, rebase, pull request까지 (git으로 협업하기)Git 2024. 8. 26. 09:32
Git 기초 로컬에서(내 데스크탑에서) git으로 버전 관리를 하고 싶을 때 → git 이라는 폴더가 생기면서 버전 관리를 시작하는 걸 뜻한다. git init은 한 프로젝트 당 딱 한번만 해야한다.git init 일단 코드를 새로 작성할 때마다 밥먹듯이 해야하는 것 add, commit 둘은 세트다.add: 나 이제 저장할거야, commit: 진짜 저장 (git은 commit을 기준으로 버전 관리를 한다)git add .git commit -m "commit message" 커밋 메시지는, 만약 내가 회원가입 기능을 구현했다면, "feature:signup" 또는 "회원가입" 이런식으로 써주면 된다. 만약, 내가 회원가입, 로그인, 로그아웃 기능 세가지를 구현했다면? 🤔 📌 그래서, 커밋메시지..
-
[Front-end] HTML, CSS, JavaScriptFront-end 2024. 8. 21. 04:48
Front-end 의 기본 구성 요소 HTML웹 페이지의 콘텐츠 구조를 정의모든 텍스트, 이미지, 링크 등은 HTML이라는 마크업 언어를 통해 웹 페이지에 배치된다.CSSHTML로 정의된 콘텐츠의 스타일과 레이아웃을 제어색상, 글꼴, 레이아웃 등이 CSS로 결정된다.JavaScript웹 페이지에 동적인 기능을 추가예를 들어, 버튼을 클릭했을 때 나타나는 팝업 창이나, 입력한 데이터를 실시간으로 검증하는 기능 등을 구현한다. 우리가 아는 크롬이나 사파리같은 브라우저는 → HTML 문서를 파싱하여 웹 페이지의 구조를 이해하고, CSS 스타일을 적용하여 페이지의 디자인을 결정하고, JavaScript 코드를 실행하여 동적인 요소를 다루고 상호작용을 구현하여 우리에게 시각적으로 웹페이지를 보여준다. 브라우저가 ..
-
Django Custom UserModelDjango 2024. 8. 19. 06:17
만약 기본 User Model을 사용하더라도 Custom User Model을 사용하는 것이 권장된다. 🚫 주의AUTH_USER_MODEL 설정은 반드시 프로젝트 최초 마이그레이션에서 함께 진행하기를 권장한다.USER Model은 비지니스로직 깊숙이 관여되기에 중간에 변경하면 많은 변경사항을 야기한다. User Model 정의하기 accounts/models.pyfrom django.db import modelsfrom django.contrib.auth.models import AbstractUser# Create your models here.class User(AbstractUser): pass⇒ 기본 유저를 변경하지 않더라도 확장성을 위해 Custom User Model을 작성해야 한다. ..
-
Djnago Model Relationship (1:N)Django 2024. 8. 19. 04:31
댓글(Comment) 구현하기 articles/models.pyclass Comment(models.Model): article = models.ForeignKey(Article, on_delete=models.CASCADE) content = models.CharField(max_length=255) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) def __str__(self): return self.content 그 다음에 마이그래이션 해주면, 속성값이 생긴걸 확인할 수 있다. 자, 그럼 댓글 달기 해보자. ORM 사용해보기..
-
Django 관리자 페이지 (Admin Site)Django 2024. 8. 19. 00:49
Django의 Admin Site Django는 기본적으로 관리자 사이트를 제공하고 있다.Django Framework를 선택하는 이유가 되기도하는 강력한 장점 중 하나다.직접 record를 조회, 생성, 수정, 삭제할 수 있는 모든 기능을 제공한다.이외에도 각종 권한 부여를 해서 제한하거나, 페이지 자체를 커스텀 하는 것도 가능하다. project app / urls.pypath("admin/", admin.site.urls), 직접 사용해보자. admin 계정 생성python manage.py createsuperuser최소 is_staff 이상의 권한이 필요하다. 기본 등록하기 admin.py# articles/admin.pyfrom django.contrib import adminfrom ...
-
Django Static & MediaDjango 2024. 8. 19. 00:24
Django Static & Media 개념 설명 STATIC_URLstatic 파일을 참조할 때 사용할 url개발 단계에서는 app/static 경로 및 settings의 STATICFILES_DIRS 에 정의된 경로 참조실제 디렉토리 경로가 아님! URL로만 존재하는 경로이다.STATIC_ROOT배포를 위해 정적 파일을 수집하는 디렉토리의 절대경로django 프로젝트에서 사용하는 모든 정적 파일을 이곳으로 모아서 적용단, DEBUG=True 인 경우 동작 X (개발 단계)추후 배포시 모든 정적파일을 다른 웹 서버가 직접 제공하기 위함 collectstatic 모든 경로를 다 뒤져서, 한 곳에 모아두는 명령어 python manage.py collectstaticSTATIC_ROOT에 모든 정적 파일..
-
Django 회원기능 구현하기Django 2024. 8. 18. 21:32
회원가입 Django는 기본 auth.User를 가지고 있기 때문에, 이를 기반으로한 기본적인 회원가입 ModelForm을 제공하고 있다. UserCreationFormDjango는 OpenSource이다username과 password 로 새로운 user를 생성하는 ModelFormusername, password1, password2를 가진다. 코드 작성하기 (signup) accounts/forms.pyfrom django import formsclass ArticleForm(forms.Form): title = forms.CharField(max_length=10) content = forms.CharField() (signup) accounts/views.pyfrom django.c..