#django

/

      • moldy
        nginx is arguably easier unless you already know apache quite well, yeah
      • GinFuyou
        btw apache now used as reverse proxy or still with mod_wsgi too?
      • newdimension
        moldy: The question is what define functionality? It's not one app per model, it's one app per logically related models.
      • moldy
        but apache can also serve a django app very well with 5-10 lines of config. if you know apache well, no reason not to use it.
      • newdimension: yes, that is a good way to structure apps then
      • hop
        GinFuyou: using it as proxy makes the contact surface smaller...
      • GinFuyou: easier to understand. very easy to run gunicorn in a screen session, for example
      • GinFuyou: probably easier to separate prviliges with different system users, although i /could/ be starting a rumour, there
      • moldy
        GinFuyou: both / either [never really understood which term is the right one in english] are fine
      • newdimension: is your app reusable in another project? if not, it doesn't matter much, and you probably should spend your time thinking about different problems
      • GinFuyou
        OK, before I seen only guide where using apache == mod_wsgi
      • hop
        GinFuyou: mod_wsgi => apache
      • Anarchic joined the channel
      • GinFuyou
        nah, that's obvious. I think I just got impression that apache is heavy for just a reverse proxy
      • hop
        only if you install mod-php ;)
      • moldy
        apache is probably super-lightweight compared to modern hardware
      • CAPITANOOO has quit
      • aossama joined the channel
      • graphene has quit
      • graphene joined the channel
      • firefocks
        anyone know why my check_image_size method isnt working? not getting any errors or traceback. My code: https://dpaste.de/o7H3
      • hop
        firefocks: where is it called?
      • mvanorder has quit
      • firefocks
        the view doesnt automatically call it?
      • hop
        why should it?
      • also, what view?
      • moldy
        fission6: how does it fail?
      • PantelicGR has quit
      • fikka has quit
      • firefocks
        oh do i pass it in the model.ImageField?
      • hop
        a form is not a field
      • fikka joined the channel
      • TripFandango joined the channel
      • firefocks
        i mean pass the method in the model.ImageField
      • fission6 has quit
      • FunkyBob
        don't you mean clean_FOO ?
      • firefocks: why would anything call check_image_size? what in the docs told you adding a random method to a Form class would get it called?
      • firefocks
        ya nvm on the model.ImageField
      • where does it called then?
      • matsaman has quit
      • FunkyBob
        what?
      • if you want to add custom validation to your form ... you need to add a clean method
      • like you read about in the docs, right?
      • kenndel joined the channel
      • hop
        firefocks is somewhat right, clean_<fieldname>() is called automatically
      • (on full_clean())
      • firefocks: hence the question, _why_ do you think your method should be called?
      • jsfan joined the channel
      • audioburn has quit
      • andyhoang joined the channel
      • PantelicGR joined the channel
      • audioburn joined the channel
      • fikka has quit
      • kiloreux joined the channel
      • sayan has quit
      • LogoS[ES] joined the channel
      • jessamynsmith has quit
      • jrist has quit
      • acetakwas has quit
      • aossama joined the channel
      • jarshwah joined the channel
      • firefocks
        funky bob, pretty sure i am cleaning the image field with cleaned_data.get('image', False)
      • fikka joined the channel
      • hop, i guess i didnt know i had to call it manually
      • FunkyBob
        firefocks: you missed the actual question
      • if you follow the documentation you won't have to call your clean functions manually
      • instead, you just "made shit up" and asked why it didn't work
      • firefocks
        ok ill read it again, gotta go tho thanks for the help
      • firefocks has left the channel
      • EyePulp joined the channel
      • aossama has quit
      • fikka has quit
      • dangayle has quit
      • fikka joined the channel
      • fikka has quit
      • beeman joined the channel
      • newdimension
        If I delete all Permission objects, is there a way to have Django regenerate them? I wan to get rid of permissoins for models that don't exist anymore
      • FunkyBob
        last I checked django does that itself, when it removes the content-types entries for them
      • fikka joined the channel
      • diek joined the channel
      • newdimension
        FunkyBob: I have migrate app zero and removed the app form INSTALLED. The permissions are still there
      • FunkyBob
        oh, no, that's quite different
      • chronos joined the channel
      • newdimension
        Were you saying that it will re-add the permissions on its own?
      • FunkyBob
        IIRC content-types has a post-migrate hook to clean up... and permissions has one for fixups, too
      • fikka has quit
      • chronos has quit
      • audioburn has quit
      • newdimension
      • Deleted all permissions, and then just ran migrations and the table got populated
      • fikka joined the channel
      • FunkyBob
        I wasn't going to say "yes" without being sure... or you'd lose data [well, you lost data, but it seems youd on't care :)]
      • BPL joined the channel
      • newdimension
        yes, I always test local first
      • aussiejames has quit
      • But in general I haven't reached production yet. Hopefully soon
      • FunkyBob
        of course, if you delete all permissions, you delete any permissions assigned to people
      • aussiejames joined the channel
      • fikka has quit
      • cmgurba has quit
      • kiloreux joined the channel
      • newdimension
        Is there a way to "copy" permissions assigned a group to another? e.g. I'd set up the permissions of one group manually then copy it. I'd add/remove permissions on the new group but it'll be less work because the bulk of them are set
      • I guess I can loop