#django

/

      • k_89
        but i guess would have to go the validator route
      • Stavros
        has anyone used a user model with a non-integer id? did password resets work?
      • mattmcc
        How much more 'by default' would it get? :)
      • k_89
        :)
      • Stavros
        mattmcc: DateTimeField(greater_than=now())? :P
      • k_89
        heh, that could work
      • phuzion joined the channel
      • Stavros
        ugh, this password thing is pissing me off, i can't even find it in the source
      • hubx joined the channel
      • mattmcc
        Well, you can always subclass the field and make your own FutureDateTimeField with the validator added by default.
      • k_89
        hmm, cool
      • japandroid joined the channel
      • geekeasy joined the channel
      • geekeasy
        Has anyone had any experience (positive or negative) with Django-chartit?
      • k_89
        Stavros, you using contrib.auth ?
      • Stavros
        k_89: yeah
      • BiskitB0y joined the channel
      • with AbstractBaseUser, i removed the username
      • k_89
        i hve no clue about best practices in django-land, but what's the opinion on rolling a simple user-roles system and ditching contrib.auth
      • using bcrypt for password hashing
      • and this is for an api, so won't need any admin
      • japandroid has quit
      • Stavros
        k_89: contrib.auth is just simpler
      • tolmun joined the channel
      • bytephilia joined the channel
      • k_89
        really, hmm
      • i should dig into it
      • this is what the User model looks like atm
      • Stavros
        that's pretty much the default user model
      • k_89
        hmm, cool
      • nedbat has quit
      • Stavros
        so it looks like django just doesn't support non-integer id models: https://github.com/django/django/blob/master/dj...
      • lightstrike has quit
      • wenzhixue has quit
      • hubx has quit
      • knite
        are there any unexpected consequences if my urlconf has '^foo/?', include(foo.urls)? note the /? instead of the usual /
      • maroloccio joined the channel
      • Kk2 has quit
      • dray3 is now known as daaray_away
      • jpadilla joined the channel
      • seagreen has quit
      • mattmcc
        Stavros: That's specific to the default user model. Non-integer models work just fine.
      • Stavros
        mattmcc: well, they don't work with the admin
      • mattmcc
        I use UUID models all over the place in the admin. They work fine.
      • Stavros
        oh i can override it, right
      • thanks
      • didn't notice that
      • mind pasting your password-changing code?
      • mattmcc
        Oh, we still have just the default user. But replacing that one method should suffice.
      • kanahee
        how do install group_messaging? I cant find it :(
      • mattmcc
        I won't have 1.5 in production for probably another 4-5 months.
      • Stavros
        mattmcc: oh, so you don't have a UUID-based user model, right
      • i misunderstood
      • what do you use for uuids, by the way?
      • mattmcc
        Universal uniqueness? :)
      • It's a quasi-multi-tenant environment.
      • Stavros
        haha, no, i mean to generate them
      • just the uuid module?
      • mattmcc
        Oh. There are a handful of UUIDField implementations floating around.
      • Ours I think started out as a copy of the one in django-extensions, with some tweaks for native Postgres support.
      • Stavros
        ah, i see, thanks
      • i generally use a textfield defaulting to the shortuuid module, is there any advantage to a dedicated uuidfield?
      • mattmcc
        This is where SmileyChris chastises me for not using his version.
      • daaray_away has quit
      • dray3 joined the channel
      • maroloccio has quit
      • NaOH has quit
      • diphtherial
        mattmcc: er, sorry to bother you about cloud hosting again, but have you used ec2?
      • i apparently signed up for an ec2 account a long time ago, so i think my free year has expired; does that mean i'll get billed just for using it, even if i stay within the micro tier limitations?
      • they seem purposefully vague about it in the documentation
      • mattmcc
        Well, AWS docs tend to suck across the board.
      • diphtherial
        indeed :x much of it reads like a sales pitch
      • i'm afraid that i'm running up a monster bill without any means of being able to tell
      • er, and on a more django-specific front, is there a nice way to write a management command that monitors the db for changes without having to be constantly polling it?
      • mattmcc
        Stavros: Postgres' native data type validates and stores them more efficiently than a text field.
      • diphtherial
        (right now, i do a query for pending jobs in some table, and process them one at a time if i find any; if i don't, i sleep for a little bit and then try the query again)
      • Dex26354 has quit
      • Stavros
        mattmcc: interesting
      • i'm using user-facing ones, so i prefer the uuids being as short/readable as possible, so i guess they're different use cases
      • mattmcc
        Yeah.
      • For user-facing stuff, I just use a fairly basic url shortener.
      • Stavros
        a module, you mean, or something like bit.ly?
      • stantonk has quit
      • mattmcc
      • Stavros
        oh, so it encodes numbers using a random alphabet to make it hard to reverse?
      • couchsurfer joined the channel
      • mattmcc
        Yeah.
      • Stavros
        that's pretty clever
      • couchsurfer
        hey guys! just a quick question, is there a way to use a forms.ModelForm for authenticating a user with username/password?
      • mattmcc
        But since it is reversible, it works nicely for obscuring links to stuff that has an integer PK.
      • margle joined the channel
      • Stavros
        couchsurfer: you could probably use the user modelform and just include username/password and then run the authenticate function on it...
      • mattmcc: yeah, that's pretty nifty for that
      • couchsurfer
        Stavros how would i just include those fields?
      • Stavros
        i'm mostly interested in object ids in an API not being sequential, so that wouldn't work very well
      • pjs
        couchsurfer of course you could. it's still a form. but the question is, why would you?
      • mattmcc
        couchsurfer: contrib.auth already has an AuthenticationForm.
      • Stavros
        couchsurfer: include = ("username", "password"), but it's easier to just make a form
      • oh interesting
      • couchsurfer
        mattmcc thanks! i never knew...
      • mattmcc
        It has a login view, too..
      • diphtherial
        seconding using the built-in views; they're highly customizable
      • _colinwilliams_ has quit
      • you just provide a template file in a known location and it works
      • jpadilla has quit
      • vbabiy has quit
      • jscott1989 has quit
      • the_rat has quit
      • ineedarobot has quit
      • Turn_Left joined the channel
      • Joost has quit
      • Left_Turn has quit
      • the_rat joined the channel
      • v0lksman joined the channel
      • samuel_ joined the channel
      • v0lksman
        anyone know what magic I need to submit a polygon drawn with google maps to a PolygonField/
      • zerick has quit
      • ?
      • samuel_ is now known as samuel
      • the_rat_ joined the channel
      • foist joined the channel
      • simme has quit
      • simme joined the channel
      • foist has quit
      • Stavros
        yay, finally, my first templates are done: https://github.com/skorokithakis/django-project...
      • the_rat has quit
      • vbabiy joined the channel
      • batisteo has quit
      • ojh joined the channel
      • abe_music has quit
      • epicowl joined the channel
      • kjagiello has quit
      • rideh has quit
      • MARKUSH is now known as MarkusH
      • JJMalina has quit
      • Siecje
        Stavros: how do project templates work?
      • Stavros
        Siecje: what do you mean?
      • epicowl has quit
      • rideh joined the channel
      • Siecje
        I don't quite get how you use them
      • also there are no .html files in that repo
      • Stavros
        you use them when setting up a new project, instead of the default one
      • why would there be .html files?
      • MicahCarrick joined the channel
      • Siecje
        oh I see, where to put templates and apps etc
      • kristallpirat has quit
      • Stavros
        yeah
      • nedbat joined the channel
      • skeet70 has quit