$ sudo apt update
$ sudo apt install python3-pip python3-dev libpq-dev nginx nano file
$ sudo -H pip3 install --upgrade pip
$ sudo -H pip3 install virtualenv
from rest_framework.response import Response | |
from django.core.exceptions import ImproperlyConfigured | |
""" | |
동일한 패턴에 대한 Mixin 클래스 | |
""" | |
class CreateUpdatePartialUpdateCustomMixin: | |
""" |
dacaddress = { | |
"AAA":[ | |
"0x000000000000000000000000000000000001", | |
"0x000000000000000000000000000000000002", | |
"0x000000000000000000000000000000000001", | |
"0x000000000000000000000000000000000002", | |
], | |
} |
import json | |
import os | |
import requests | |
from datetime import datetime, timedelta | |
from address_list import * | |
import time | |
contractaddress = "{CONTRACT_ADDRESS}" | |
def lambda_handler(event, context): |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie !== '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = cookies[i].trim(); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) === (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | |
break; |
import os | |
import json | |
from .models import friends | |
from ssproject.settings import * | |
def update(request): | |
with open(os.path.join(BASE_DIR, '/data.json')) as f: | |
base = json.load(f) | |
friends = Friends.objects.get(user=request.user) |
// 기본 사용자 구조 | |
{ | |
"id":1, | |
"head":"*", | |
"contents":"test1", | |
"children":[] | |
} | |
// 위 기본 구조를 토대로 2 연결된 부분의 데이터 들이 key가 'children'인 리스트에 들어갑니다. | |
// 여기서 contents 에는 사용자 이름이 들어가고, children 의 리스트엔 ManyToMany 로 연결된 User 데이터가 들어갑니다. |
from .models import Profile | |
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin | |
from django.contrib.auth.models import User | |
from .models import Profile | |
class ProfileInline(admin.StackedInline): | |
"""Define an inline admin descriptor for Profile model""" | |
model = Profile |
20180504 알고리즘 문제 문제출처: https://www.acmicpc.net/problem/15311
답변으로 문제풀이를 올려주세요.
20180504 알고리즘 문제 문제출처: https://www.acmicpc.net/problem/15366
답변으로 문제풀이를 올려주세요.