#django

/

      • jennifer
        Why isn't it... protected? :|
      • Koterpillar
        jennifer: where?
      • jennifer: finish part 4 of the tutorial before doing any upload stuff
      • jennifer
      • lol
      • Koterpillar
        that's not Django
      • jennifer
        Finish tutorial this man says
      • Koterpillar
      • cybo_
        jennifer, because people aren't security conscious
      • jennifer
        I know, I'm following a different tutorial because I just need to get this going with
      • cybo_, I'm doing this for a security class, so it's really just hw
      • My professor said to use php so she can show us how to find bugs but I insisted on python because I said in the real world I'd never lower myself to working with php grubs
      • She said "okay"
      • So here I am trying to learn Django in a hour
      • It's actually a lot of fun
      • I can see some security problems with some of these codes on github
      • cybo_
        jennifer, it probably won't be all the beneficial to do it in django then
      • jennifer
        Whether it's Amazon API code or some other crap
      • cybo_
        it does a lot for you out of the box
      • jennifer
        cybo_, why not? I just wanna get this homework done with, which is create a simple upload website
      • isthmian has left the channel
      • ...
      • What are you suggesting sir?
      • cybo_
        if the point of the class is to learn about different security issues, then you won't learn them by not dealing with them directly
      • jessamynsmith joined the channel
      • jennifer
        Oh no
      • I will learn
      • Don't you worry your little heart
      • jennifer rubs grubby hands.
      • cybo_
        which is possibly why you were suggested to use php ;)
      • jennifer
        I hate php and would rather starve than work with php
      • cybo_
        have you ever used it?
      • jennifer
        I'm already starving too hm
      • yeah
      • I have a few small project in php when I first started out
      • Php taught me a lot but security isn't one of the,m
      • Did you see the link or did I send the wrong one?
      • cybo_
        the spec? yes
      • jennifer
        here
      • Have fun
      • Gonna need 30 min to focus on making this magic work
      • Where can I read about {% I see stuff here %}?
      • FunkyBob
        templates
      • like you saw in the tutorial
      • you did do the tutorial, right?
      • jarshwah_
        she's half way through
      • FunkyBob
        ah
      • jarshwah_
        (assuming she)
      • jessamynsmith has quit
      • FunkyBob
      • jennifer
        I did the tutorial halfway as said, then I went onto another tutorial that focused on what I needed, I got most of the idea heh
      • Koterpillar
        those things between {% %} are called template tags
      • EyePulp joined the channel
      • ironfroggy joined the channel
      • jennifer
        Oh cool this tutorial uses / teaches csrf_token
      • Why does a few of these line have double {{}}?
      • andrew9184 joined the channel
      • Koterpillar
        {{ }} is variable interpolation
      • {% %} run Python code from a register of functions (template tags)
      • jennifer
        Oh
      • Literal string
      • Got it
      • jarshwah_
        variable
      • Koterpillar
        {{ }} print the value of an object referenced inside, can't run arbitrary code
      • ironfroggy has quit
      • the precise syntax of what can be used inside {{ }} are explained somewhere in the docs, the point being is that it's intentionally limited
      • s/are/is/
      • bambanx
        why people love jinja templates?
      • jennifer
        ya
      • Koterpillar
        bambanx: because they think Python code in templates are fine, probably?
      • jennifer
        It's not that magical
      • Koterpillar
        s/is/are/ grrrrrrrrr
      • jennifer
        Bambanx do you have an alternative?
      • Koterpillar
        jennifer: default Django templates
      • jennifer
        Btw I can delete pyc files when uploading for my professor, yeah?
      • She doesn't need the pyc files I think
      • Koterpillar
        jennifer: correct, but how do you expect them to run your code?
      • jennifer
        I give them the py files
      • The source code
      • Koterpillar
        It's just they'll have to download Django and all
      • jennifer
        oh
      • bambanx
        Koterpillar, what do you think? its good practice to use python on templates? what are your thoughts?
      • jennifer
        heh
      • Koterpillar
        bambanx: no
      • jennifer: and Python
      • jennifer
        I dunno why I cackled at that but I guess it's funny
      • bambanx
        hello jennifer
      • dashdanw
        what would be the best way to migrate a set of tags from a taggit TagableManager field from one model to another?
      • Koterpillar
        bambanx: I consider Hamlet a good templating system (warning: not Python)
      • bambanx
        Koterpillar, its kinda pug(jade) ?
      • Koterpillar
        mmm, not familiar with those. It's more about the type safety
      • bambanx
        ok
      • thanks for share your wisdom Koterpillar
      • Koterpillar
        but then again, I'm not good enough with Web design
      • jennifer
        Koterpillar, what do you use Django for?
      • Koterpillar
        web apps
      • but our team has a total of 2 people whose job is to suffer CSS
      • moldy_ joined the channel
      • moldy has quit
      • asadjb joined the channel
      • jennifer
        Hm this is new
      • bambanx
        guys what is the way to act if some guy stole your database of some apps ? if this database have all password of your users? those are encrypted?
      • jennifer
        Class inside of a class? that's pretty rare in C++
      • What does that do in python?
      • Koterpillar
        jennifer: introduces a class
      • jennifer: only visible inside the scope
      • jennifer
        bambanx, you freak out, you scold your security team, then you figure out damage control
      • Then you get some paperwork done, talk to your lawyer
      • Get everybody to assess the damage done and figure out how to prevent in the future
      • Notify customers
      • If those passwords are poorly hashed, you're in trouble
      • Koterpillar
        jennifer: classes are dynamic, like everything else in Python
      • jennifer
        Send out a mass email to get those users to change their pw asap
      • Um I forgot what else you can do
      • Koterpillar, okay
      • ty
      • Koterpillar
        jennifer: you can introduce functions inside classes inside functions...
      • bambanx
        ok but in terms of programming what you can do? the password are encrypted on the database?
      • Koterpillar
        bambanx: whatever you _could_ do is already irrelevant
      • FunkyBob
        bambanx: yes, passwords are encrypted
      • Diemuzi has quit
      • hashed, in fact... so there's no decryption possible
      • jennifer
        Koterpillar, I know about functions inside of a functiojn
      • But not class inside of a class
      • asadjb has quit
      • FunkyBob, it can be broken
      • Hashed doesn't mean shit nowadays
      • bambanx
        what is the diference of hashed with encrypted?
      • jennifer
        bambanx, if it's hashed, it's usually one way
      • FunkyBob
        bambanx: hash isn't reversible
      • Koterpillar
        jennifer: a class is just a function that takes constructor arguments and returns *something* with methods
      • jennifer
        If it's encrypted, it can be decrypted
      • Koterpillar
        jennifer: it will be costly
      • FunkyBob
        jennifer: well, the default hashing in django's auth is salted and iterated 20,000 times or more
      • jennifer
        FunkyBob, don't say, it's usually not easily reversible, but that's a false sense of security
      • Somebody with enough time and knowledge will crack it open
      • well
      • okay
      • So that just means django's hashing is decent
      • bambanx
        thanks guys
      • jennifer
        I'm curious as to how Django would hold up against various attack vectors out there that could, on nation-state level crack passwords like nobody
      • FunkyBob
        it should be upped to about 100,000 iterations in 2.0, iirc
      • it's upped every release to compensate for improved hardware
      • jennifer
        Good job
      • Ariel_Calzada has quit
      • Like Drupal, they try to keep up to date then