#django

/

      • rakl
        ok, i'll start with that. thanks!
      • polishnorbi has quit
      • FunkyBob
        if you've already done all the token processing, you won't need to use RequestContext
      • but hey... why do extra work ? :)
      • garryp joined the channel
      • bvlaar has quit
      • bvlaar joined the channel
      • kanja joined the channel
      • rakl
        FunkyBob to be honest, I don't think I'm doing any token processing yet. I also don't know if I'm doing django right, so I just have what feels like haphazard code.
      • czpython joined the channel
      • Amitash has quit
      • samc_ joined the channel
      • czpython
        so how can I access the django dev server from my another computer ? I ran runserver with 0.0.0.0:800 and tried accessing the page with my IP but not luck ?
      • rakl
        FunkyBob here's some context (no pun intended). http://pastie.org/5951451
      • theslow1
        czpython: get the IP address the computer running django dev server
      • rakl
        the first function renders the template that has the form. the second function is handling the submission.
      • still reading, but i'm not sure where RequestContext fits in
      • theslow1
        czpython: for example: I run dev server on DevBot with ip 192.168.0.195, locally, i access using localhost:8000
      • on a diff computer, i specify, 192.168.0.195:8000
      • FunkyBob
        rakl: well, as the form docs show, typically the same view that renders the form handls its submission
      • theslow1
        it that doesn't work, check your firewall settings (on both the dev machine and other)
      • rakl groans
      • rakl
        I knew I was doing something wrong
      • FunkyBob
        rakl: it's not required, it's just a good pattern
      • czpython
        theslow1, my IP is 65.190.0.144 and locally it works fine but in the other computer when trying to access it's not working
      • FunkyBob
        rakl: ... have you done the 4-part tutorial in the docs? only, you seem to be looking for and usign the most complex solutions available
      • bemail joined the channel
      • Boydy joined the channel
      • rakl: it's almost like you _expect_ this to be hard
      • Boydy
        anyone setup instaclone for ios in here?
      • theslow1
        czpython: ping 65.190.0.144 from other computer?
      • rakl
        FunkyBob I think I did 2 parts and made up the rest. We got a project thrown on us with very short notice.
      • definitely made mistakes in the beginning and are looking to get 1.0 off the ground before going back and doing thiings better
      • more idiomatic
      • odarbelaeze
        FunkyBob: I found out what was happening a while ago, it was the django compressor
      • theslow1
        czpython: that doesn't seem like a local lan IP
      • FunkyBob
        rakl: I mean, fuck.. you would have really had to dig to turn up SimpleTemplateResponse
      • rakl
        it was in the code that was handed to me
      • odarbelaeze
        FunkyBob: I'm trying to figure out now, why that app exists :(
      • theslow1
        czpython: are both computers on the same LAN?
      • rakl
        They gave us a 60% done codebase and I assumed the patterns they were using were standard
      • datakid
        if I override clean() on a model, do I need to reference super().clean as well?
      • amagee joined the channel
      • czpython
        theslow1, yes. I ran ifconfig and got http://dpaste.org/VUhax/
      • theslow1
        czpython: 192.168.0.8:8000 from other computer
      • Amitash joined the channel
      • FunkyBob
        rakl: are you using a custom, home-grown auth system?
      • completely eparate from django.contrib.auth ?
      • amagee
        Hey, does 12 seconds to run `for i in range(0, 100): u.set_password("a")` on a medium EC2 instance sound reasonable? Or does that seem really slow?
      • nedbat has quit
      • czpython
        theslow1, nothing.
      • nedbat_ joined the channel
      • rakl
        FunkyBob sort of. The app is hosted on Google App Engine. So admin rights are set by the running instance there
      • I don't see django.contrib.auth anywhere
      • FunkyBob
      • diphtherial has quit
      • md4d joined the channel
      • theslow1
        czpython: $ sudo iptables -L
      • FunkyBob
        rakl: I know little of GAE... but that paste is the "canonical" form handling view
      • theslow1
        ^^ will "List" your firewall rules
      • ldionmarcil joined the channel
      • czpython
      • rakl
        FunkyBob where is that SpeakerEditForm coming from
      • racycle joined the channel
      • FunkyBob
        well, that would be a ModelForm sub-class you'd generate
      • rakl
        we're also a day away from launch, and I just need to get this csrf implemented, so I'm nervous about changing the code with no tests to back it up
      • Rainy-day joined the channel
      • FunkyBob
        rakl: in that case, instead of SimpleTemplateResponse, use render
      • return render(request, template_name, context_data)
      • that code looks nightmarishly overcomplex
      • most likely by Java coders
      • rakl
        that sounds right. but I'm not making it any better, that's for sure
      • FunkyBob
        not so much 'wrong' as 'using entirely the wwrong set of idioms'
      • rakl
        it's the Save function that I need to change up I think
      • I'd like to keep the two separate functions, since we're already doing that all over the plce
      • theslow1
        czpyhton: iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
      • md4d has quit
      • sivy joined the channel
      • Bubo joined the channel
      • FunkyBob
        rakl: that's fine
      • fission6
        am i going to get bit if i try to copy some code for the verbatim template tag from 1.5 to 1.4
      • polishnorbi joined the channel
      • FunkyBob
        fission6: from memory it won't port verbatim, no...
      • theslow1
        czpython: that is non-persistant and will disappear when you restart your computer
      • workkevin has left the channel
      • fission6
        damn
      • so now what
      • amccloud has quit
      • theslow1
        czpython: unless you add it to your config files
      • FunkyBob
        fission6: there's a snippet...
      • fission6
        hmm ok
      • yea i playing with angular.js and i have a bunch of {{}} in my template/page
      • vbabiy has quit
      • brunchpoems joined the channel
      • rakl
        FunkyBob so question remains, how do I confirm the existence/validity of the csrf token in the function that's handling the POST
      • confirmation I can probably check the request
      • datakid has quit
      • FunkyBob
        yeah... we use moustach templates
      • oh, no.. handlebars... same shit
      • atula wrote a custom middleware today. felt good. just wanted to share :P
      • ]\
      • ~.]
      • rakl: well, if GAE works like real Django, you don't have to do anything... the middleware will verify it
      • atula
        our stuff is 100% django and python. I feel like a child on Christmas morning when my unnitest passed...
      • theslow1 christmas sucked
      • then I run fab deploy --> felt even better
      • rakl
        FunkyBob hmm ok. thanks
      • fission6
        thanks FunkyBob trying it out
      • FunkyBob
        fission6: it's working live now
      • fission6
        ?
      • abdostar joined the channel
      • vbabiy joined the channel
      • abdostar
        any one could assist me set up virtualenwarapper
      • phildini has quit
      • phildini joined the channel
      • rogi has quit
      • FunkyBob
        fission6: that is code cut'n'pasted from a live, production app
      • abdostar: never used it
      • hyperair joined the channel
      • fission6
        thanks, yea i am sure it works well
      • just integerating
      • abdostar
        FunkyBob, isn't the best way to dev django
      • czpython
        theslow1, no luck :(
      • FunkyBob
        abdostar: virtualenv sure is
      • but that in no way means virtualenvwrapper is required
      • derek_c joined the channel
      • derek_c has quit
      • derek_c joined the channel
      • derek_c has quit
      • fission6
        yea this is nice thanks FunkyBob got a nice angular.js app for filterting client side
      • abdostar
        FunkyBob, I know is not required, I was just reading virualenvwarapper is better
      • derek_c joined the channel
      • theslow1
        czpython: did you start the server to listen on all interfaces? (ie: python manage.py runserver 0.0.0.0:8000 )
      • derek_c has quit
      • then connect to it via : 192.168.0.8:8000
      • derek_c joined the channel
      • atula
        abdostar: how many projects are you working on?
      • abdostar
        atula, so far just one
      • robbyoconnor has quit
      • nedbat_ is now known as nedbat
      • markalanevans has quit
      • repsaj joined the channel
      • Rainy-day
        hi, if I override CreateView.get_from_kwargs and pass an unsaved instance to modelform using instance= kwarg.. is this kosher? where is the instance being kept between requests?
      • get_from_kwargs/get_form_kwargs
      • scrapper joined the channel
      • atula
        abdostar: yeah… here are my thoughts and you can take it or leave it. I taken that you just got started with django/virtualenv/python etc. The best way to learn is to be specific about your intents. Having a folder where you have: env/ src/ --> virtualenv env/yourproject;source env/yourproject/bin/activate would give you a feeling of knowing where everything is. Virtual environments go into env/ and project source codes go into src/
      • bvlaar has quit
      • vritualenvwrapper does is place the virtualenv in your home directory as far as I know and this help you magically switch between different environments.
      • aberrant has quit