#django

/

      • dali has quit
      • schinckel
        Baylink: You can put a venv anywhere you want.
      • Matadoer has quit
      • tomkinsc has quit
      • ktosiek has quit
      • katylava has quit
      • tomkinsc joined the channel
      • ktosiek joined the channel
      • Ariel_Calzada has quit
      • bwreilly joined the channel
      • amb1s1 joined the channel
      • kartarn joined the channel
      • chrislkeller has quit
      • sw4 has quit
      • sw4 joined the channel
      • Baylink
        Yeah, I just know where I want it, and $HOME wasn't it. :-)
      • twoolie
        Baylink: virtualenv-wrapper is a really nice tool for managing your venvs
      • dencold joined the channel
      • Titanomachy joined the channel
      • Baylink: put this in your shell rcfile http://dpaste.com/1322405/
      • epicowl has quit
      • introspectr3
        what would be a relatively painless way of grabbing a URI string from a template?
      • Titanomachy has quit
      • cyong joined the channel
      • natea joined the channel
      • fission6
        what? introspectr3 ?
      • introspectr3
        fission6: trying to grab URI string from within a template. is that possible?
      • joshfinnie joined the channel
      • fission6
        i don't know what you mean and what you're ultimately trying to do/solve
      • Cheekio
        I'm super confused
      • introspectr3
        hmmm
      • Cheekio
        I can't import the RegistrationView from registration
      • introspectr3
        http://www.mydjangoproj.com/**I NEED TO GRAB THIS STRING***/somestring/someotherstring
      • fission6
        Cheekio: what happens
      • oh you want to grab a parameter in the url pattern introspectr3 ?
      • Cheekio
        hey fission6: my imports never work. "from registration.backends.default.views import RegistrationView" just gives me errors
      • introspectr3
        yes please!
      • eka has quit
      • Cheekio
        it gives me "No module named backends.default.views"
      • fission6
      • bwreilly has quit
      • Cheekio: is it in your installed Apps
      • Cheekio
        django-registration is, yes
      • pip freeze gives me django-registration 1.0 and django-registration-defaults 0.3
      • fission6
        and its in your django installed apps
      • can you do python manage.py shell
      • import registration
      • Cheekio
        no, I can't
      • no wiat
      • I can
      • import registration works
      • and the default registration system works
      • mattmcc
        introspectr3: What are you actually trying to do?
      • rolleiflex has quit
      • Oh, not in templates at all.
      • rolleiflex joined the channel
      • zipper_ has quit
      • fission6
        Cheekio: there is no reason else i can think off
      • of
      • Cheekio
        if I'm in a subdirectory, do I need to write 'import ..registration.backends' or something?
      • d3c0 joined the channel
      • epicowl joined the channel
      • Nervosa joined the channel
      • fission6
        you should be able to import everything with an absolute path
      • you said you were able to import
      • when you did
      • pyton manage.py shell
      • Cheekio
        yes, I can
      • although I'm trying to import the registration backend from within another app
      • Nervosa
        Hey, I want to annotate the division of two Sums, and then be able to order by that. I tried using extra, which gives me the exact SQL I need... apart from a single GROUP BY. http://dpaste.com/1322407/ : I'd rather make a custom aggregate function or something, but I don't think I can get the queryset to do two separate lookups without some changes to the Query class. If I try and edit the queries group_by field, it throws all the aggre
      • gates into the group by...
      • fission6
        are you working in two terminals Cheekio and like don't have your virtualenv active or something silly
      • Cheekio
        no, I'm using the same terminal :D
      • kartarn has quit
      • Titanomachy joined the channel
      • Pandee has quit
      • Pandee joined the channel
      • does the order in settings.py matter?
      • Nervosa
        Only for lists and the like
      • fission6
        yes sometimes
      • Nervosa
        And imports.
      • fission6
        Nervosa how many rows are you aggregating over
      • Nervosa
        fission6: It's an unknown. I'm currently running on fake data until we move to a real system.
      • Lemme get a row count...
      • Cheekio
        still no dice
      • Nervosa
        You can assume lots. Millions.
      • fission6
        ah ok
      • bgraham has quit
      • Cheekio
        the import line works fine in manage.py shell, but doesn't work in-app.
      • denplis has quit
      • cewing
        greetings, djangonauts. The following question references this paste: https://dpaste.de/xeJ2Z/
      • performing what I believe to be an identical query against a mysql database directly and then again using a raw queryset returns different results
      • apologies, bad paste above. Here's the fixed one: https://dpaste.de/m8Ofw/
      • Cheekio
        I think I figured it out
      • I included an import statement in my project/urls.py file
      • fission6
        where is the IN stuff cewing IN ('Elephants', 'French Bread', 'Tonsils'))
      • does it work now cheekio
      • cewing
        fission6: see the updated post, sorry :(
      • Cheekio
        that's probably before the registration app takes hold, because it's not referenced yet
      • haha, no, not at all
      • cewing
        User.objects.raw(sql, [param]) should return five users, but only two are returned
      • the two returned are the two that would be returned if I only used the second subselect
      • it's as if the UNION is not operative
      • schinckel
        cewing: You should be able to do that query using filter, I think.
      • bwreilly joined the channel
      • Cheekio
        it's got to be a matter of circular dependencies
      • thallada joined the channel
      • fission6
        cewing you can also double check the queries by turning on query logging an making sure they are indeed the same query hitting the same tables
      • cewing
        fission6: that's a good idea
      • SmileyChris joined the channel
      • and schinkel, I'll try with a filter. It makes my head hurt even more than that sql, though :)
      • Cheekio
        fission6, do you have any experience with subclassing from django-registration?
      • fission6
        no really but it should be like subclassing anything else
      • jarshwah joined the channel
      • although i do think I've done it with registration before actually
      • BiskitB0y has quit
      • Cheekio
        They moved everything over to class based views in the past few months
      • bwreilly has quit
      • but all the how-to's are using the old django 1.4 compatible registration
      • bwreilly joined the channel
      • bwreilly has quit
      • H25 has quit
      • I just want to add extra stuff to the /accounts/register page, so my url looks like "url(r'^accounts/register/$',MyView.as_view(),name='registration_register')"
      • eka joined the channel
      • but that means I need to import MyView, which subclasses the RegistrationView before it's added to the django environment
      • felixsamora has quit
      • amb1s1 has quit
      • fission6
        ok
      • felixsamora joined the channel
      • d3c0 has quit
      • H25 joined the channel
      • d3c0 joined the channel
      • bgraham joined the channel
      • jroll has quit
      • cewing
        schinckel: thanks, man, for talking me down from using .raw()
      • figured it out
      • Titanomachy has quit
      • luyikei__ joined the channel
      • Cyph0n joined the channel
      • sgambino joined the channel
      • Pandee
        I'm reading a book "Pro Django (2013)", and it says to refer to "The Definitive Guide to Django: Web Development Done Right (2009)" for the basics. I'm a bit confused, I'm told that old material for Django is not a good source, but this book released this year refers to the second book published in 2009. I'm guessing it is safe to assume that a book on Django from 2009 is still relevant and
      • won't develop poor habits?
      • zeograd has quit
      • The above reference from Pro Django is for those who need to learn the basics first
      • __love__
        Pandee: the basics of django don't change *too* quickly
      • Pandee
        so the reasons for the djangobook being a bad learning source is because it was done poorly?
      • __love__
        it's REALLY old ;)
      • Pandee
        oh lol
      • __love__
        and a decent amount of what it covers in detail is now out of date