목록분류 전체보기 (210)
jm_p_op
github https://github.com/jmpop97/makesite https://github.com/jmpop97/makesite2 1.패스워드 암호화 안됨 2.패스워드 암호화됨 ERD https://www.erdcloud.com/d/cTCaupCkNfpFxAakw 4/10 15:13 - 회원가입 완료, product 데이터 입력을 위한 ERD 작성중, 회원가입시 비밀번호 암호화 필요
https://stackoverflow.com/questions/67787446/how-to-fix-error-in-django-serializers-py-fields
터미널 python manage.py makemigrations python manage.py migrate user/admin.py from django.contrib import admin from .models import UserModel # Register your models here. admin.site.register(UserModel) user/models에 있는 UserModel을 데이터로 집어 넣는다 admin.site.register(data)
$ pip freeze > requirements.txt 설치방법 pip install -r requirements.txt
django-admin startapp user "user"앱 만들기 1.templates/user/create_user.html 생성 2.user/views.py from django.shortcuts import render # Create your views here. def create_user_view(request): return render(request, 'user/create_user.html') create_user.html로 보내는 함수 만들기 3.user/urls.py 생성 from django.urls import path from . import views # user/views 불러오기 urlpatterns = [ path('create-user/', views.create_u..
import numpy as np false_list = ['', "", [], {}, 0, (), set(), range(0), np.array([0]),None] true_list = ["null", " ", ' ', "asdf"] i = 0 for test in a: if test: print("true") print(i) print(test) else: print("false") print(i) i += 1 int같은 경우는 0제외하고 truthy 값이다.
def solution(array): count = [0] * (max(array)+1) # 요소를 0으로 # 인덱스는 0부터 시작한다. 그래서 +1를 해줬다. for l in array: # array의 요소가 몇 번 기록되는지 세어주기위해 사용 count[l] += 1 # 인덱스는 0부터 시작한다. array을 돌려주기위해 +1 ##################################################################################### r = 0 # 최빈값의 을 0으로 만들고 최대 갯수를 알기위해 사용 for a in count: if a == max(count): # 같은 숫자를 찾기위해 == 를 사용했다. r += 1 # 최댓값과 같은 값이 있으면 if..
class test: def __init__(self): self.hp = 100 def ms(self): self.hp -= 1 a = 0 b = test() try: while a < 100: a += 1 b.ms() if a == 10: raise except: pass c = [a, b.hp] print(c) # [10,90] def test2(a, b): try: while a < 100: a += 1 b.ms() if a == 10: raise except: pass a = 0 b = test() test2(a, b) c = [a, b.hp] print(c) #[0,90] funtion밖에서 try문은 에러가 나올때 그전까지 실행하고 except로 나와서 작동한다. funtion안에서도 try..