Skip to content

Instantly share code, notes, and snippets.

View legitYosal's full-sized avatar
🥭
Internally fused

yosef sl legitYosal

🥭
Internally fused
View GitHub Profile
@legitYosal
legitYosal / cookie_parser.py
Last active August 20, 2020 14:50
python header cookie parser
@legitYosal
legitYosal / app.vue
Created May 21, 2020 17:37
passing props to components created by vue-router
<template>
<div id="some-thing">
<router-view :some-value-to-pass="localValue"></router-view>
</div>
</template>
@legitYosal
legitYosal / backends.py
Created May 12, 2020 15:44
Django custom authenticate backend for login user by username or email
class EmailandUsernameAuthBackend(object):
def authenticate(self, request, username=None, password=None):
try:
user = User.objects.get(Q(username=username) | Q(email=username))
if user.check_password(password):
return user
except User.DoesNotExist:
return None
def get_user(self, user_id):