한국어 기본 설명 https://www.youtube.com/playlist?list=PLVNY1HnUlO24D77bSgHoGkRxSh_lpXAWv

영어 설명 30분 분량 https://youtu.be/SWYqp7iY_Tc

작업흐름 15분 분량 branch merge push –set-upstream-to 

 https://youtu.be/oFYyTZwMyAg

branch , merge, delete 

https://youtu.be/oFYyTZwMyAg

git credential set

https://www.freecodecamp.org/news/how-to-fix-git-always-asking-for-user-credentials/

https://stackoverflow.com/questions/35942754/how-to-save-username-and-password-in-git-gitextension

구글 드라이브에 cheat sheet 있음

required form field를 위한 model field 설정

https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/#field-types

https://stackoverflow.com/a/27036431

p103 Model EmailField()

p104 null=True , blank=True

p105 model verbose_name option

p106-7 admin.py admin.ModelAdmin을 통해 admin 에서 볼수 있는 model들의 설정을 바꿀수 있다.

p107 admin.py admin.ModelAdmin 를 통해서 admin 화면 customizing이 가능하다.

p120 HttpRequest.META 안에 각종 header정보가 있다.

p124- 126 basic form GET 사용법

p133 basic form POST 작동원리 and 에러 

forms.ModelForm customizing하기

p136 forms.Form의 다른 widget으로 바꾸기

p138 forms.Form의 기본 validation 규칙 , 기본값 설정하기 

p139 custom validation 설정하기, label바꾸기

p140 field별로 html tag , message 출력하기

p147 공통된 url prefix를 설정하기

p162 wrapper를 이용해 여러 view들에 사전 작업을 처리할수 있다. (ex login wrapper) decorator와 같은 원리 이다.

p163 urls include

p174 template autoescape off 하는 방법

p176 {{data | default:”3 < 2”}} template에서 기본값설정하는데 special character escaped

p256 cookies에 접근하는 법

p258 session 이용

p261 session check

p264 request.user

p265 request.user.is_authenticated()

p277 auth.authenticate() 와 auth.login()와 auth.logout()

p269 login_required decorator

p270 permission_required decorator

user_passes_test()

p271 creating user, set password , check password

  • User.objects.create_user(), User.set_password(), User.check_password()

p273 template에서 authentication data 사용하기

django docs Form 기본

django docs ModelForm

Using the Django authentication system

https://docs.djangoproject.com/en/3.0/topics/auth/default/#module-django.contrib.auth.forms

creating form from model

https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/#django.forms.ModelForm

working with form

https://docs.djangoproject.com/en/3.0/topics/forms/

modelform customizing

https://colinkingswood.github.io/Model-Form-Customisation/

customizing UserCreationForm

https://stackoverflow.com/a/5745488

adjusting height with bootstrap

https://www.w3schools.com/bootstrap4/bootstrap_utilities.asp

https://getbootstrap.com/docs/4.0/utilities/sizing/

(input 의 높이를 지정하는 방법으로 percentage사용불가)

PasswordInput() 사용예시

https://www.programcreek.com/python/example/107521/django.forms.PasswordInput

message framework (ontime message to next view)

https://docs.djangoproject.com/en/2.0/ref/contrib/messages/

using authentication system in django

https://docs.djangoproject.com/en/3.0/topics/auth/default/

AuthenticationForm 수정 custom customizing하기

https://stackoverflow.com/a/12333660

AuthenticationForm수정 custom customizing하기

https://stackoverflow.com/a/12333660

original source: https://github.com/divanov11/crash-course-CRM/blob/Part-7-Database-Queries/crm1_v7_database_queries/accounts/queryDemos.py

#***(1)Returns all customers from customer table
customers = Customer.objects.all()

#(2)Returns first customer in table
firstCustomer = Customer.objects.first()

#(3)Returns last customer in table
lastCustomer = Customer.objects.last()

#(4)Returns single customer by name
customerByName = Customer.objects.get(name='Peter Piper')

#***(5)Returns single customer by name
customerById = Customer.objects.get(id=4)

#***(6)Returns all orders related to customer (firstCustomer variable set above)
firstCustomer.order_set.all()

#(7)***Returns orders customer name: (Query parent model values)
order = Order.objects.first() 
parentName = order.customer.name

#(8)***Returns products from products table with value of "Out Door" in category attribute
products = Product.objects.filter(category="Out Door")

#(9)***Order/Sort Objects by id
leastToGreatest = Product.objects.all().order_by('id') 
greatestToLeast = Product.objects.all().order_by('-id') 


#(10) Returns all products with tag of "Sports": (Query Many to Many Fields)
productsFiltered = Product.objects.filter(tags__name="Sports")

'''
(11)Bonus
Q: If the customer has more than 1 ball, how would you reflect it in the database?
A: Because there are many different products and this value changes constantly you would most 
likly not want to store the value in the database but rather just make this a function we can run
each time we load the customers profile
'''

#Returns the total count for number of time a "Ball" was ordered by the first customer
ballOrders = firstCustomer.order_set.filter(product__name="Ball").count()

#Returns total count for each product orderd
allOrders = {}

for order in firstCustomer.order_set.all():
	if order.product.name in allOrders:
		allOrders[order.product.name] += 1
	else:
		allOrders[order.product.name] = 1

#Returns: allOrders: {'Ball': 2, 'BBQ Grill': 1}


#RELATED SET EXAMPLE
class ParentModel(models.Model):
	name = models.CharField(max_length=200, null=True)

class ChildModel(models.Model):
	parent = models.ForeignKey(Customer)
	name = models.CharField(max_length=200, null=True)

parent = ParentModel.objects.first()
#Returns all child models related to parent
parent.childmodel_set.all()

original source : https://youtu.be/N5vscPTWKOk

pip

   Pip is a package management system used to install and manage software packages, such as those found in the Python Package Index.

vitualenv : 

virtualenv is used to manage Python packages for different projects. Using virtualenv allows you to avoid installing Python packages globally which could break system tools or other projects. You can install virtualenv using pip. 각각의 project별로 필요한 dependencies가 다르므로 각기 다른 환경에서 작업 할수 있게 해주는 도구이다. 

image
image
image
image
image
image
image
image

참고사항 : https://youtu.be/nxOPY1eFL9A