#django

/

      • TitaniumLeg
        Another important note. It's an intranet site that will run solely on http
      • netscape101
        TitaniumLeg: The security comes down to different things, but if the app is coded poorly from a security point of view then the method of authenticating to the application is irrelevant
      • zeus1 joined the channel
      • jas02 joined the channel
      • JustASlacker
        well, if you submit the passwords in cleartext, why bother
      • Beef_wgtn
        Anyone know how to setup caching with a remote (private networked) database?
      • TitaniumLeg
        netscape101: fair point - let's assume the app is coded well
      • JustASlacker: would that be an argument for using IIS authentication since the Windows Authentication setting avoids clear text passwords?
      • JustASlacker
        TitaniumLeg: no, its an argument against http
      • GraysonBriggs joined the channel
      • bigblind joined the channel
      • doughj3 joined the channel
      • TitaniumLeg
        JustASlacker: I think, could definitely be wrong, that Windows Authentication is meant for intranet sites and authenticates against an active directory account. Which means the password isn't sent on the network, right? And wouldn't Django work the same way?
      • JustASlacker: and I know...my hands are tied on the http piece
      • Lynoure
        Sounds like django-python3-ldap with IIS is more painful than with openldap
      • aditya_r joined the channel
      • TitaniumLeg
        JustASlacker: or rather the passwords are hashed rather than clear text
      • nimomo has quit
      • Lynoure: I couldn't find much info on pairing the two, do you happen to have an article?
      • ThinkTeamwork has quit
      • netscape101
        TitaniumLeg: I havn't much with AD, might be a good question to ask on #windows. What database are you using?
      • Lynoure
        TitaniumLeg: I don't really know IIS, just with openldap one could pretty much just throw in django-python3-ldap and use it
      • JustASlacker
        yes, ask #windows-server
      • not sure but I think they dislike NTLM with IIS
      • also windows hashes are bad
      • thiras joined the channel
      • Lynoure
        JustASlacker: yes, tearingly so
      • TitaniumLeg
        Lynoure: if you're referring to integrating AD with Django, I've already implemented it successfully. I imagine hosting on IIS wouldn't change those settings, although I could be wrong
      • JustASlacker
      • listenmore has quit
      • TitaniumLeg
        netscape101: MS SQL server
      • bigblind has quit
      • listenmore joined the channel
      • I'll ask around over there - thanks! Not sure if they'll know the Django side of things though
      • JustASlacker
        well, from their point of view its just a reason to let IIS run
      • TitaniumLeg
        Just slacker: sorry, I don't quite understand that. Let it run instead of changing default settings?
      • JustASlacker
        nvm, I was just making chitchat
      • Fuyou
        oh, shi~: Invalid field name(s) given in select_related: 'club'. Choices are: user, сlub
      • I think I made a field name with non-latin first letter >_<
      • bkeating has quit
      • TitaniumLeg
        haha I'm dense
      • ThinkTeamwork joined the channel
      • bkeating joined the channel
      • aossama has quit
      • Beef_wgtn
        I'm having some trouble getting celery to recognise GOOGLE_APPLICATION_CREDENTIALS... when I do echo $GOOGLE_APP_CREDS i get the right path, but when I'm running a job in celery it can't find the creds
      • nnscr joined the channel
      • aossama joined the channel
      • awagink has quit
      • Diemuzi joined the channel
      • aditya_r has quit
      • eggstyrone has quit
      • Leeds joined the channel
      • bigblind joined the channel
      • eggstyrone joined the channel
      • n0nam3 has quit
      • tga
        soo how would you combine two view mixins, that rely on different kwargs?
      • I'm having trouble getting the syntax right for passing the right args into each parent class
      • bigblind has quit
      • fleetfox
        pastie the code
      • bkeating has quit
      • Genitrust joined the channel
      • tga
      • something like this
      • or maybe not, give me a sec
      • kakulukia joined the channel
      • I thought I'd give generic views another shot
      • but they are such a mess
      • imho they add way more complexity than they save by being reusable
      • imack joined the channel
      • kakulukia
        hi, could somebody tell me why the tests are failing at travis but working locally? https://travis-ci.org/kakulukia/django-secrets has travis problems with reloading modules? But its working nuder python2. :(
      • listenmore joined the channel
      • k0mpa joined the channel
      • stduolc has quit
      • brainproxy joined the channel
      • tga: depends on what you are trying to do .. i also sometimes just use the old function based views
      • stduolc joined the channel
      • brainpro1 has quit
      • FunnyHeretic has quit
      • chasonchaffin has quit
      • xliiv joined the channel
      • marcosmoyano joined the channel
      • bigblind joined the channel
      • tga
        kakulukia: I use them by default, they are self explanatory
      • vs classes where you have non-obvious flow
      • btw, in this case I had forgot to add a .to_view(), and things were blowing up, nothing to do with inheritance
      • Beef_wgtn
        I'm having trouble with memcached throwing me the following error... no idea what it means: Can't pickle <function result_list at 0x7f3330e9f6a8>: it's not the same object as django.contrib.admin.templatetags.admin_list.result_list
      • jpg has quit
      • bigblind has quit
      • I've been running it successfully previously, so this error is a bit out of left field
      • fleetfox
        tga: you seem to be confused with how multiple inheritance works, nothing to dow with cbvs
      • chasonchaffin joined the channel
      • timograham joined the channel
      • EyePulp joined the channel
      • tga
        mixins count as multiple inheritance, don't they?
      • moldy
        typically
      • fleetfox
        sometimes. your issue is overloading same method only first super is only calling first parent in inheritance chain
      • tga
        Beef_wgtn: that sounds strange, why are you pickling a function?
      • fleetfox
        s/only first//
      • tga
        fleetfox: yeah, I take that pastie back, I thought my problem was with inheritance but I was just passing a class instead of a function
      • moldy
        you can use a mix-in with a class that doesn't inherit from another, then it would not be multi-inheritance
      • tga
        my statement on cbvs vs fbvs stands though
      • bigblind joined the channel
      • fleetfox
        i mostly use cbvs since i tallows for easy and pretty fispatch on HTTP verbs
      • in fbvs it's ugly and imperative
      • kakulukia has quit
      • felixx has quit
      • tga
        atm I'm a bit annoyed at combining context from multiple levels
      • in fbv it's like context = get_foo_context(request, **kwargs), and that calls get_bar_context(), and so on, I can click and follow the chain
      • imack has quit
      • with cbvs it's not that obvious where things come from
      • fleetfox
        yes, you have to be aware on how every mixing works in chain
      • tga
        right, and you can't jump to definition anymore
      • fleetfox
        you can, at least in pycharm
      • it resolves the chain correctly
      • imack joined the channel
      • most of the time*
      • tga
        well you can jump to the mixin, but not to the context directly
      • you have to find get_context_data manually
      • fleetfox
        Also your issue is not with cbvs but generic cbvs.
      • bigblind has quit
      • tga
        I also have my own mixins
      • long story short, I still don't see the benefit
      • in theory it makes some reuse easier because you don't need to do the same legwork in each view, you just go Fo(SettingsView), and the context is all there
      • fleetfox
        well, it's great if works out of the box
      • tga
        in practice though, context = get_settings_context(request, **kwargs) is about it
      • and maybe login_required
      • fleetfox
        if i need something more involved, i just drop down to plain View
      • tga
        right
      • thiras has quit
      • brainpro1 joined the channel
      • geetar joined the channel
      • oh well, enough moaning
      • back to writing views
      • moldy
        ccbv.co.uk is a great resource to understand GCBVs better
      • delizin joined the channel
      • fleetfox
        honestly i prefer this way of composition over something like rails does with code generation
      • brainproxy has quit
      • danner joined the channel
      • delizin
        Hey all. I am trying to perform a bulk update on a date field in a postgres database. Each date needs to be increased by a number of months. I am trying something along the lines of .update(F(date_field
      • .update(F('date_field') + relativedelta(months=3)) but I am getting an error that it can't adapt type relativedelta.
      • What is the proper way to adjust dates using update?
      • fleetfox
        it doesn't know how to cast rleativedelta to interval
      • JustASlacker has quit
      • tbh i'm not even sure there is support for intervals
      • you may need RawSql, Value
      • delizin
        That is unfortunate. I've been trying really hard to just do everything through the ORM
      • fleetfox
        you can do it with ORM, but you may need raw value for interval
      • Kangermu
        delizin timedelta
      • woops
      • delizin
        Thanks fleetfox and Kangermu. I'll give both of those a try