Skip to content

Instantly share code, notes, and snippets.

@jrog612
jrog612 / simple_excel.py
Last active September 12, 2018 03:04
Simple Excel maker for python
"""
How to use:
dependency:
xlsxwriter (pip install xlsxwriter)
python code:
excel_data = [
['Name', 'Birth', 'Email', 'Gender'],
['John Doe', '1980-02-03', 'j-doe@mail.com', 'male' ],
['Jane Doe', '1995-01-15', 'prettyjane@mail.com', 'female' ],
"""
Need Django and CProfile.
Just append this middleware class in MIDDLEWARE in django settings.
"""
from django.core.exceptions import MiddlewareNotUsed
from django.utils.deprecation import MiddlewareMixin
from django.conf import settings
import cProfile
import pstats
@jrog612
jrog612 / secure.py
Last active December 5, 2020 06:21
장고의 Secret Key 를 이용한 암호화
import base64
import hashlib
from Crypto.Cipher import AES
from django.conf import settings
__all__ = ['Secure']
class Secure: