#django

/

      • jessamynsmith joined the channel
      • busla joined the channel
      • astex
        moldy: actually, definitely not
      • moldy: we use quite a few within that template and split_address is the only one that raises an error
      • busla has quit
      • moldy
        astex: then i would look really hard at that templatetag now :p
      • asarch joined the channel
      • Nemus has left the channel
      • asarch
        How do you capture a URL like: /packages/linuxdoc-tools-0.9.68-i486-4/content ?
      • Or should I do: /packages/content?name=linuxdoc-tools-0.9.68-i486-4
      • Genitrust has quit
      • moldy
        asarch: /packages/(?P<package_name>.*/content
      • asarch
        Thank you moldy
      • Thank you very much :-)
      • astex has quit
      • moldy
        asarch: /packages/(?P<package_name>.*)/content/$
      • asarch: something like that...
      • asarch
        Thank you :-)
      • tudmotu has quit
      • fission6
        is there anything in the docs for a registrationview
      • kalhartt joined the channel
      • abhillman has quit
      • mattmcc_ is now known as mattmcc
      • mattmcc
        fission6: Built-in? There's UserCreationForm, but it's pretty basic. See django-registration-redux or allauth/python-social-auth
      • fission6
        ok, i also have a custom User model for AUTH_USER_MODEL
      • is django-registration-redux solid for django 1.3
      • err 1.8
      • aldnav joined the channel
      • mattmcc
        Should; I know it works with 1.7.
      • fission6
        mattmcc: i was looking at out of the box stuff here http://www.obeythetestinggoat.com/using-the-bui...
      • mattmcc
        fission6: If that meets your needs, you're set. But typically for registration people at least want email confirmation.
      • aldnav
        Is there a way where you could do pop up in Django? Like design a special view for that? A mixin? Idk how to do this without much code in the template
      • fission6
        mattmcc: does django-registration let me use a custom User model, how would that work
      • asarch
        What if you have two different apps with two different template with the same name (packages/templates/content.html, books/templates/content.html). How do you specify which one you want in loader.get_template()?
      • mattmcc
        fission6: It respects your AUTH_USER_MODEL setting.
      • fission6
        where did you see that in the docs
      • mattmcc
        asarch: Standard convention is to namespace the templates with another directory. So, packages/templates/packages/content.html and books/templates/books/content.html
      • asarch
        I see
      • Thank you mattmcc
      • Thank you very much :-)
      • mattmcc
        fission6: I didn't, I looked at the RegistrationProfile model. The docs should mention that, yes. http://django-registration-redux.readthedocs.or... says User specifically, which isn't accurate.
      • Boogymanx
        why would send_mail('Test', 'Hey guys! What's up?', , [ '[email protected]';, ], fail_silently=False) give an error on the =?
      • fission6
        thats mattmcc
      • bnmalcabis has quit
      • mattmcc
        Boogymanx: Paste the traceback
      • Boogymanx
        this is from a shell
      • Ohhh
      • the what's up messes it up I think
      • hyperair has quit
      • radez is now known as radez_g0n3
      • Genitrust joined the channel
      • hiitsrob joined the channel
      • radez_g0n3 is now known as radez
      • mattmcc: Now I'm getting an authentication error
      • although I know my settings are correct
      • hiitsrob
        hello, i was wondering what the popular opinion is on deployment tools. I've been looking at fabric, is that still the latest and greatest?
      • mattmcc
        Boogymanx: I'll take your SMTP server's word for it.
      • Boogymanx
      • do you see anything wrong with them?
      • HowardwLo joined the channel
      • laceywill has quit
      • HowardwLo
        weird, I see my .gitignore in my repo, but when i do a git clone and git pull on my server, the .gitignore file doesn’t come through
      • aldnav has quit
      • delgiudices
        Is ther esomething like unique together?
      • anth0ny
        I'm trying to do a filter like: Article.objects.filter(publication__release_date__in=Holiday.objects.filter(... )). Is there a way to do this with one DB lookup?
      • Lobstaman3 has quit
      • SmileyChris
        anth0ny: that will use a subquery, but it is one db lookup
      • Lobstaman3 joined the channel
      • anth0ny
        SmileyChris: ah, cool, didn't know that
      • SmileyChris
      • delgiudices
        SmileyChris: :p thanks
      • HowardwLo has quit
      • mattmcc
        Boogymanx: Are you sure you want SSL, not TLS?
      • Ergo has quit
      • Boogymanx
        I'll try with TLS
      • if i import my project settings in a shell I can send mail from there right?
      • tacohat joined the channel
      • hmm
      • works with TLS
      • anth0ny
        Is there much of a performance gain using psycopg2.execute_many() over Django's .bulk_create()?
      • yassine joined the channel
      • dting joined the channel
      • mattmcc
        anth0ny: If you're not concerned with DB portability, then copy_from would be much faster.
      • anth0ny
        mattmcc: is copy_from a django thing?
      • mattmcc
        No, it's a Postgres thing.
      • atlasloewenherz has quit
      • terryleigh joined the channel
      • anth0ny
        hmmm... thie file-like object part loses me. I'm copying data from one Postgres DB to another
      • I can get the data via a query
      • mattmcc
        Oh, then I wouldn't involve Django at all.
      • yassine has quit
      • kingplusplus has quit
      • cnk
        Speaking of Postgres things - does Django (or an extension) support some of Postgres’s new field types - like json?
      • daniel3_ has quit
      • mattmcc
        cnk: There are a handful of JSONField implementations out there, have been for a couple years now. There isn't a built-in one yet.
      • daniel3 joined the channel
      • There are built-in fields for arrays, ranges, and hstore though.
      • cnk
        Excellent!
      • Boogymanx
        how would I delete my static folder from my git repo on live?
      • cnk
        more amunition for using PG as our database for the ne wproject
      • ybathia has quit
      • mattmcc
        There are reasons to use something other than PG?
      • Sorry, there are good reasons?
      • anth0ny
        mattmcc: I was previously doing "execute_many" to do a db copy (both DBs are made via django and with the same schema). I imagined that Django's bulk_create would have been doing the same. Would you use this "copy_from"?
      • mattmcc
        anth0ny: Are you copying the whole DB?
      • anth0ny
        mattmcc: not exactly, I'm breaking up data from a single DB into multiple DBs based on the client. it's kind of a pain
      • so it requires a bunch of filtering
      • cnk
        mattmcc: reasons, yes (familiarity for the rest of the group) good reasons? not so much
      • Boogymanx
        hmm
      • GoClick joined the channel
      • guys, I'm deploying from a git service and the files I received because of a collectstatic are making my git pull not work
      • I tried git rm -r --cached /static/
      • but that doesn't work
      • TodPunk joined the channel
      • GoClick
        Does Django have any kind of a time limit for views? I have to load 3.5M records into the database and would like to do it with just a single use view. But it's going to take about 20min to run. I can of course get my browser to not timeout but will I have issues with Django?
      • jessamynsmith
        GoClick: that's going to depend on your host, I think
      • mattmcc
        GoClick: Use an asynchronous task manager such as Celery or RQ
      • cnk
        GoClick: I would expect your web server to have an issue with that - but it probablydepends on your hosting set up
      • GoClick
        mattmcc: that's not reasonable for something I need to do once. It'll take me more than 20min to set that up
      • mattmcc
        You do not want to do long-running data processing within the context of an HTTP request.
      • jessamynsmith
        I agree with mattmcc
      • GoClick
        jessamynsmith: I'm using the dev server
      • mattmcc
        GoClick: Then use a command-line script.
      • GoClick
        mattmcc: fine.
      • anth0ny
        mattmcc: I wonder if I could stream copy_from to copy_to...
      • mattmcc
        anth0ny: Another consideration is postgres_fdw.
      • Which lets you set up a bridge between DBs so you can just use CTEs to populate one DB with queries of the other in one step.
      • GoClick
        Timing is still relevant I suppose because I have a view which is going to have to compare 97,000 new records to the existing 3.5M records each month to make a report. Only one person has to use this once a month though
      • mattmcc
        Report generation is also something that almost always benefits from async workers.
      • Run the comparison periodically in a cron job or something and store the result for the view to present.
      • GoClick
        I'm not going to learn celery for the sake of making one report for one person once a month
      • I might as well just write a script that doesn't even use Django it'll be less complicated
      • mattmcc
        Yes, you soundly shot me down the first time. That's why I said _cron job_.
      • Jesus.
      • autrilla joined the channel
      • x1337807x has quit
      • GoClick
        Yes but they need to input those 97k records, the records aren't made available on a schedule they just come along once a month when someone decides it's a good time
      • So I'm thinking of a file upload fom and then process and return the result
      • zfjohnny has quit
      • Back2Basics
        Gunicorn hand's out static files, but what is the point of having a 2nd thing to hand out static files if you have nginx?
      • GoClick
        I guess I can just have the view drop it in a folder and then a cron process it into the db every 5 minutes and send them an e-mail when it's done
      • radez is now known as radez_g0n3
      • mattmcc
        Back2Basics: Gunicorn doesn't serve static files, afaik.
      • autrilla_ has quit
      • ldlework
        not unless the wsgi app its running does
      • Back2Basics
        mattmcc: Good. so I have no more reason to use it then.
      • mattmcc
        Back2Basics: Well, you need a WSGI server.