1. LDAP Authentication for Sentry

    Sentry is an awesome error logging platform for various language platforms and web frameworks. And it also supports several social authentication backends, including Twitter, Facebook, Google, Github, Trello and Bitbucket. However, if you are trying to set up Sentry for a company or an organization, you would probably want to ...

    Tagged as : Python Django Sentry
  2. Python: list assigning(copying)

    >>> a = [1,2,3,4,5]
    >>> b = a
    >>> b[0] = 10
    >>> print a
    [10,2,3,4,5]
    

    在python中,list的assign有點類似c的pointer,改變b的值同時也會改變a的值,要作到 真正的copy有兩種方法:

    slicing

    >>> b = a[:]
    

    這個作法雖然簡單,但是在nested的結構中會有問題,可以改採用第二種方法

    module copy

    >>> import copy
    >>> b = copy.copy(a)
    

    module copy中又有copy與deepcopy,兩者的差別要再研究研究

    Reference:
    python module copy

    Tagged as : Python

Page 1 / 1