#django

/

      • pembo13
        it is
      • just a one time thing
      • fission6
        id use the orm
      • pembo13
        okay, but that wasn't really my question though
      • zeograd
        pembo13, don't you want to set the password field to '!' in sql ?
      • pembo13
        zeograd: is that what that function does?
      • zeograd
        password is usable if set and different from '!'
      • which is a constant (UNUSABLE_PASSWORD) which can't be a valid hash
      • pembo13
        zeograd: that's the answer to my question then, thanks
      • the_rat_ has quit
      • zeograd
        you're welcome
      • garretraziel joined the channel
      • pembo13
        another issue I have is that I am getting "Unknown password hashing algorithm" against the built-in authentication backend if a user's password is wrong
      • the_rat joined the channel
      • i have a custom auth backend
      • mlavin has quit
      • but if the password is wrong, it seems like the contrib.auth default backend is used, but that is consistently throwing a "Unknown password hashing algorithm"
      • it's using the password itself as the hash
      • garretraziel
        Hi, I have problem with logout view. I'm using django.contrib.auth.views.logout, I created my own template, set LOGOUT_URL in settings, but still, if I go to address associated with logou view, it shows "django admin" logout.
      • jdunck has quit
      • ehazlett joined the channel
      • epiloque has quit
      • savid has quit
      • b3free joined the channel
      • pembo13
        i see the problem, looks like i missed a step in my read of the docs, I was setting user.password directly instead of using make_password
      • Ixbidie has quit
      • houssein has quit
      • the_rat has quit
      • ovnicraft has quit
      • b3free has quit
      • fission6
        garretraziel: post some code, urls.py specifically
      • keimlink joined the channel
      • garretraziel
        url(r'^logout/$', 'django.contrib.auth.views.logout')
      • mikef has quit
      • foundatron has quit
      • matthearn777 has quit
      • fission6
        garretraziel: i use ?next=/ on my logout link
      • to redirect to thepage
      • i want
      • https://github.com/django/django/blob/master/dj... <- you can see you can overide template_name if you'd like
      • m0n5t3r has quit
      • garretraziel
        thanks, I'll look at it
      • ryanisnan joined the channel
      • fission6
        garretraziel: can you paste your logout.html too, i assume its in templates/registration/logout.html
      • garretraziel
        hm, I have templates/registration/logged_out.html
      • fission6
        tbaxter: what was that seo link i lost it?
      • thiagoss joined the channel
      • right ok
      • garretraziel
      • tbaxter
        fission6: "SEO for non-dicks"
      • fission6
        thnaks
      • ender979 has quit
      • garretraziel: and templates is being loaded, like you can use other templates in that folder?
      • ikirudennis has left the channel
      • is templates inside an app you have installed garretraziel
      • ShuffleBox has quit
      • mgrouchy joined the channel
      • kristianroebuck joined the channel
      • garretraziel
        yep, templates folder is inside app folder and I am using login.html to log user in
      • gawry joined the channel
      • fission6
        yea i think its because you are hitting the registration folder for admin first in installed apps https://github.com/django/django/tree/master/dj...
      • gawry has quit
      • i'd rename it to registraion/logout.html and pass that in your url {'template_name':'registration/logout.html'}
      • leetrout joined the channel
      • or again use ?next=/logout or whatever
      • quake_guy has quit
      • wittgenstein has quit
      • j_syk has quit
      • gawry joined the channel
      • atula has quit
      • sivy joined the channel
      • ehazlett has left the channel
      • garretraziel
        ok, thanks, will try
      • trang has quit
      • ok, now it works, thank you
      • wenzhixue has quit
      • juliaelman has quit
      • kristianroebuck has left the channel
      • fission6
        yep
      • foundatron joined the channel
      • bak1an has quit
      • natea joined the channel
      • brainwarped
        in my views, if I have a "def done", and I do an if statement and call "return", does that return end the "def done" script(ie, no further lines are executed within the def)?
      • FunkyBob
        return exits the function.... unless it's within a "finally" clause of a try
      • sorry, within a try block wityh a finally clause, I mean
      • brainwarped
        FunkyBob: Thanks! that explains a lot:)
      • FunkyBob
        basic Python
      • if it's in a ftry block with a finally... it exectures the finally, _then_ exits the function
      • brainwarped
        FunkyBob: I tried to do the dive into python training, but I never found the time:(
      • joshfinnie has quit
      • thiagoss
        Hi, I'm having a user login successfully and at the next page access request.user points to anonymous user
      • brainwarped
        FunkyBob: but now that you mention "finally", I recall reading about this before, but it hasn't come up in a couple months (since I started with django).
      • thiagoss
        I can confirm that at the end of the login view function the session has the user login info correctly and request.user points to the user
      • jdunck joined the channel
      • jspiros has quit
      • __love__ joined the channel
      • mgrouchy has quit
      • tbaxter
        thiagoss: does the next page have request context?
      • dan_johnsin
        anyone have any experience with django_rq?
      • mengu has quit
      • lapilofu has quit
      • mengu joined the channel
      • tocf has quit
      • rideh joined the channel
      • bluepnume has quit
      • bforbes has quit
      • thiagoss
        tbaxter, the login page returns a redirect (302), should it need to do anything else? This code used to work on another computer.
      • bluepnume joined the channel
      • dbrgn
        does someone in here have experience with django-rulez? i can't get it to work with django-admin :/ i want members of a group to be able to edit only their own objects via admin. is that possible?
      • tbaxter
        thiagoss: the login page is almost surely fine. My bet is either the page it's going to doesn't have requestContext, or there's a cookie problem.
      • caleb_smith has quit
      • aezell has quit
      • tbaxter has quit
      • areski has quit
      • napperjabber has quit
      • garretraziel has quit
      • zoumpis has quit
      • maZtaiR has quit
      • twikz joined the channel
      • lapilofu joined the channel
      • jspiros joined the channel
      • JJMalina has quit
      • wstearns has quit
      • smcoll has left the channel
      • ryanisnan
        This may not be a very well formulated question, so apologies in advance. I have a model which uses a `GenericRelation` to an object - let's call them Likes, for example. I also have a Tastypie endpoint setup to allow POSTing to that resource. I'd like to set up a system where users can only 'Like' an object who's class has a corresponding `likes` GenericRelation. How can something like this be achieved?
      • nedbat has quit
      • frequant has quit
      • neosergio has quit
      • svetlyak40wt has quit
      • foundatron has quit
      • hell_razer joined the channel
      • FunkyBob
        ryanisnan: so, you want ti limit what can be Liked?
      • ryanisnan
        FunkyBob: Essentially, yes :)
      • FunkyBob
        you could use a limit_choices_to on the content-type fkey
      • ryanisnan
        FunkyBob: Ah… I would like to do this programatically, if possible.
      • beacon joined the channel
      • FunkyBob: I'm envisioning a system where, if a model has a GenericRelation to the Like object, it'd be allowed, for example.
      • FunkyBob
        so, not so much "programatically", as declaratively
      • ryanisnan
        FunkyBob: Imagine something like this: http://dpaste.com/838648/
      • FunkyBob: It becomes slightly problematic when I want to open source this app I'm working on - if I have limit_choices_to in my model, that's only as useful to myself.
      • FunkyBob
        yeah... basically a "I'll only love you if you love me back" scenario
      • vakaras has quit
      • ryanisnan
        Basically :)
      • FunkyBob
        so... a registration pattern?
      • ryanisnan
        Hmm… Perhaps. I'll be honest, I'm not entirely sure what you mean.
      • FunkyBob
        like with admin....
      • things have to register if they want to be "in it"
      • likes.register(myclass)
      • ryanisnan