- asp.net core swagger
- ViewData
- asp ftp
- 맥 오라클설치
- 말줄임표시
- 404에러페이지
- php 캐쉬제거
- ASP.Net Core 404
- ViewBag
- 하드 윈도우 복사
- SSD 복사
- 원격ftp
- Mac Oracle
- asp.net Select
- 하드 마이그레이션
- 타임피커
- XSS PHP
- javascript redirection
- 강제이동
- 바코드 스캔하기
- javascript 바코드 생성
- TempData
- asp.net core Select
- 바코드 생성하기
- asp.net dropdownlist
- XSS방어
- swagger 500 error
- simpe ftp
- jquery 바코드생성
- django 엑셀불러오기
목록python (90)
웹개발자의 기지개
csrf 방식을 간단히 해제 시키는 전처리기이다. 특히 API 만들때 @csrf_exempt 이런식으로 간단히 삽입해서 이용한다. 1 2 3 4 5 6 7 from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt @csrf_exempt def my_view(request): return HttpResponse('Hello world') Colored by Color Scripter cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 from django.http import JsonResponse from django.views import Vie..

template tag 중에서 forloop.counter 에 대한 사항이다. for 문으로 돌릴때, 짝수 / 홀수로 구분하는 코딩을 할때 사용할 수 있다. forloop.counter 는 index가 1부터 forloop.counter0 은 index는 0부터 시작 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 {% for p in post_list %} {{ forloop.counter }} {{ p.created_at }} {{ p.title }} {{ p.content }} Read more → {% if forloop.counter|divisibleby:2 %} {% endif %} {% endfor %} Colored by Color Scripter cs 참고..

이 에러에 원인은 간단하다. get('user') 인데 get['user'] 형태로 첨자사용이 맞지 않아서 나타나는 에러이다. 참고 : https://www.pythonpool.com/method-object-is-not-subscriptable/

Exception Type : DoesNoExist Exception Value : Fcuser matching query does not exist. fcuser = Fcuser.objects.get(username=username) 에서 fcuser 의 객체가 없어서 나오는 에러 아래와 같이 예외처리하면 된다. [fcuse 앱의 views.py 소스 일부 참고] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 from django.shortcuts import render, redirect from django.ht..
1 2 3 4 5 year = int(input("연도를 입력하세요")) if ((year % 4 == 0 and year % 100 != 0) or year % 400 == 0): print(year, "년은 윤년입니다.) else: print(year, "년은 윤년이 아닙니다.") Colored by Color Scripter cs

글 저장시 찾아볼수 있는 에러메세지이다. CSRF 토큰을 생성하지 않아서 나오는 에러이다. 1 2 3 {% csrf_token %} Colored by Color Scripter cs

요점은 random.ranrange(1,6) 은 1에서 5까지라는 점이다. 참고로 random.sample 함수로 로또번호도 만들어보자.