#django

/

      • ICheeseYou joined the channel
      • jcda joined the channel
      • anth0ny joined the channel
      • ojh joined the channel
      • dali joined the channel
      • eppa joined the channel
      • dali joined the channel
      • mgrouchy joined the channel
      • JJMalina joined the channel
      • easel joined the channel
      • schinckel
        I would answer you, but you seem to have gone away.
      • See the answer by Josh Smeaton on that page.
      • abisson joined the channel
      • home joined the channel
      • grillermo joined the channel
      • teewuane joined the channel
      • briancray joined the channel
      • grillermo
        the save method of an imagefield needs an object that implements chunks(), the return object from sorl get_thumbnail() only implements read()
      • is there a wrapper in python for this case?
      • pppoe_dude joined the channel
      • pppoe_dude
        Hello
      • darylantony joined the channel
      • natea joined the channel
      • hive-min1 joined the channel
      • I have a somewhat newbie-ish question, but is there a straightforward way to mimic the admin interface filters and lists in a view or template?
      • SoftwareMaven joined the channel
      • teewuane
        pppoe_dude: generic views?
      • jenia_ joined the channel
      • jenia_
        hello everyone
      • when i;m in a view and receive something goes wrong, like an exception is throw. then that same view gets called again with a get request automatically
      • why isnt an error gets throw on the screen
      • pppoe_dude
        teewuane, yeah that seems to be the solution
      • but the admin interface already does it so nicely so i thought maybe there was a faster weay
      • KrauserIII joined the channel
      • ICheeseYou
        jenia_, weird ..
      • jenia_, do you have any third party apps ?
      • jenia_
        ICheeseYou, yea
      • simple captcha
      • ICheeseYou
        are you certain an exception is thrown in your view ?
      • jenia_
        in the beginning of my view i have if request.method=='GET': then return some message
      • yes
      • its the ValueError
      • so, when it gets throw, the view gets executed again, and that if statement is triggered
      • gbel joined the channel
      • ICheeseYou
        jenia_, try this in the if statement
      • majlos joined the channel
      • import traceback; traceback.print_stack()
      • that will tell you who is calling the view... it might help
      • jenia_
        thanks
      • ICheeseYou
        jenia_, also on the browser can you see the GET request occuring in Firebug or Chrome debug console ?
      • jenia_
        let me check
      • five minutes i need to trigger the mistake
      • eppa has left the channel
      • natea joined the channel
      • ICheeseYou
        good luck
      • volk_ joined the channel
      • jenia_
        ICheeseYou, sorry man. the server throws a message on the screen. i guess i wasnt concentrated properly and i didnt see the link in the js debugger. Thanks a lot, sorry for the time waste ;)
      • ICheeseYou
        jenia_, no problem. i guess i helped ;)
      • gbel joined the channel
      • hansy joined the channel
      • Eediot joined the channel
      • jcda joined the channel
      • Eediot has left the channel
      • jenia_
        yes you did.
      • Eediot joined the channel
      • tdrizzy joined the channel
      • bailinphil joined the channel
      • xchu joined the channel
      • if i have a form, that i process in a "POST view" and then when i processed that form, i do return render_to_response('example.html', {'some_context':c}, RequestContext(request))
      • then, the form remain the the context? like it never gets removed from the request?
      • vegeetz2 has left the channel
      • mattmcc
        jenia_: What does your whole view look like?
      • byoung joined the channel
      • bailinphil
        good evening--i'm looking for information about how to configure apache2 and my django site to host most URLs in a particular manner
      • i'll be glad to go rtfm so i don't waste anyone's time in here, but so far i haven't quite found what i'm looking for
      • mattmcc
        Well, what specifically are you after?
      • hypolin joined the channel
      • bailinphil
        to be brief, "/" and "/backlog/" are handled the same, by django... "/" could almost be like a 302 to redirect to "/backlog" but it might be prettier to just render that as my front page
      • i've told apache to just host everything inside of "/static" normally--i think this is typical?
      • mattmcc
        Sounds like you just want to point two urlpatterns at the same view.
      • bailinphil
        yep, and i think i got that working alright the last time i was working on this project
      • here's what i'm stuck on now
      • i've got little image galleries inside of /static, a couple levels deep
      • i'd really like to make... soft links? to them that show up as short urls
      • estebistec joined the channel
      • mattmcc
        How do you know that 'fish' is a valid image? DB data?
      • bailinphil
        but the way i've got my urls.py set up now, django just throws up an error saying "/fish? what is that?"
      • maybe it's easier to just link to what i have
      • if you open that up, then hit the up arrow in the top left, you'll suddenly be navigating apache's auto-generated listings
      • and that URL is long and ugly
      • so i'd like that URL to be bailinphil.com/elicit
      • and when you hit that up arrow, it just goes to bailinphil.com, which django handles like i said before
      • stephenmcd joined the channel
      • when i was just throwing static assets up without django, i got what i wanted by simply soft linking into that deeper directory from my doc root
      • mattmcc
        So what you're describing with the short URLs is basically a catch-all that you want to fall back to if a URL doesn't match one of your urlpatterns.
      • bailinphil
        i think so, yeah
      • briancray joined the channel
      • it didn't seem right to add more and more urlpatterns to handle things that are really just static assets
      • mattmcc
        There's a couple places you can put this, you can define a catch-all urlpattern and put it at the very end of your patterns, or you could write a middleware method that catches 404s and checks the URL against your image gallery.
      • bailinphil
        here's what i have right now
      • kanja joined the channel
      • i'm not sure i follow your second suggestion
      • like i said, i'll be happy to go study, i appreciate your help but don't expect you to "do my homework" as it were
      • would it be a horrible idea to write code in urls.py that goes through my static/images directory and looks for these albums, then just generates the urlpatterns for anything it finds?
      • mattmcc
        Yes. :)
      • You can do it with one view that just takes a string and checks for it.
      • bailinphil
        phooey, i was just seizing on this part
      • where it says, "just python code, have fun kids!"
      • CrypticSquared joined the channel
      • ah, so a last catchall url pattern which goes to a view
      • elkuka joined the channel
      • bradleyayers
        isnt' django book out of date and not recommended?
      • bailinphil
        that view's logic is, "hmm, does this name match any album names in static/images? if so..."
      • google seems to think it's worth a top 5 result
      • i wonder if the way to say "hey go render that piece of static html" is to treat it like a template in my response?
      • this solution does seem suitably clean to me, doesn't involve any crazy shenanigans
      • freakboy3742 joined the channel
      • thanks for helping me get pointed in a good direction
      • napperjabber joined the channel
      • i appreciate that this channel is here, i suspect that was a lot easier than asking for help on stack overflow, because of how much storytelling was involved and how simple the answer will probably be
      • cyphase joined the channel
      • nedbat_ joined the channel
      • phildini_ joined the channel
      • Technodrome
        bailinphil: forums are usually more productive to be honest
      • bailinphil
        this is the second resource recommended (after the faq) on djangoproject.com
      • where's the forum i should be searching first?
      • Technodrome
        bailinphil: sorry i meant like stack overflow
      • gabrielo joined the channel
      • bailinphil: some people spend hours and hours in here begging for help, when a post and waiting a night would get far more answers because the situation would be explained properly
      • bailinphil
        yeah, i can bet
      • dross yawns
      • i'm trying to be as considerate as i can, and understand that it's no one's job to help me out
      • Technodrome
        how long you been using django?
      • CRF_H0M3R joined the channel
      • bailinphil
        um, i got about 3/4 through the tutorial before feeling like i'd learned enough to start to get my hands dirty, the remainder was going to be on forms etc., which i don't need yet
      • dross
        Technodrome: actually you can get help fairly quickly here
      • Technodrome
        depends on the issue dross
      • dross
        Technodrome: if you're a whiner and constantly ask over and over, you're going to get ignored
      • bailinphil
        so i'm an experienced web dev who hates php, loves python, is trying to see how this thing works by building my personal site
      • Technodrome
        dross: yes, but if you sometimes have an issue that is hard, its hard to explain so many times,
      • you would do better explaining it once on a forum of some sort
      • bailinphil
        definitely, there's a time and place for both
      • dross
        Technodrome: then you wait for someone who is knowledgeable
      • noobs who come here expect everyone to be an expert, not everyone here is not
      • *not everyone here is an expert
      • Technodrome
        dross: as you know questions get lost, most people don't back read logs for 3 hours