Skip to content

Instantly share code, notes, and snippets.

View jkhosla's full-sized avatar

Jatin Khosla jkhosla

View GitHub Profile
@stripathi669
stripathi669 / settings.py
Last active March 4, 2019 04:05
Slack Error logger for Django
...
# Slack error handling
from django.utils.log import DEFAULT_LOGGING
LOGGING = DEFAULT_LOGGING
LOGGING['handlers']['slack_admins'] = {
'level': 'ERROR',
'filters': ['require_debug_false'], # Remove this fileter (make empty array) to test on debug
import React from 'react';
import { connect } from 'react-redux';
import { push, replace } from 'redux-router';
export function requireLoggedIn(Component) {
// a wrapper that requires a user be logged in. You can decide what 'logged in' means - in this example,
// a user is considered to be logged in if usersStore.meta.self !== null
class AuthComponent extends React.Component {
@steve-chavez
steve-chavez / django_hasher.py
Created July 1, 2014 18:22
Use django hasher to make password
./manage.py shell
from django.contrib.auth.hashers import make_password, HASHERS
make_password('test')
'pbkdf2_sha256$10000$vkRy7QauoLLj$ry+3xm3YX+YrSXbri8s3EcXDIrx5ceM+xQjtpLdw2oE='
make_password('test', 'abc')
'pbkdf2_sha256$10000$abc$MqJS5OAgSmf9SD9mfoY8fgLo8sSKmEcef0AjjMp1Q7w='