#django

/

      • MarkusH
        I have USE_TZ=True everywhere
      • doismellburning
        I think, approximately, you never want USE_TZ=False
      • lxer
        MarkusH: I just did and it seems to work
      • MarkusH
        lxer: until it doesn't :-P
      • doismellburning: +1
      • ciurkut joined the channel
      • cramm joined the channel
      • SmileyChris_ has quit
      • lxer
        using USE_TZ=True is creating other problems for me. like the format of datetime.datetime.now() is different, so I cant just do a compare with the timestamps I have in the DB
      • doismellburning
        ..."format"?
      • lxer
        it looks different :)
      • doismellburning
        and that stops you comparing how?
      • MarkusH
        lxer: you want to use django.utils.timezone.now() anyways
      • doismellburning
        "do a compare"?
      • gp
      • Audioburn has quit
      • greg_f joined the channel
      • madsj joined the channel
      • lxer
        hey I just started using django about a week ago. how would I know :P
      • MarkusH
        lxer: Didn't you read through the entire code base as everybody else? *justkidding*
      • the_rat joined the channel
      • jazzzu joined the channel
      • tricoder joined the channel
      • Mississauga joined the channel
      • Mississauga
        So many control files in django to keep track of, pls suggest some graphical tools to manage them
      • jaykay joined the channel
      • tyfighter joined the channel
      • dodobas
        Mississauga: what are control files '
      • ?
      • underthehill joined the channel
      • Mississauga
        manage.py urls.py settings.py etc.
      • jaykay
        hey, i was about to write a test that checks whether a migration should be added. first question, how can i do that? second question, is there a reason why "makemigrations --dry-run --noinput" asks for input?
      • i would have done that but i don't know how i can handle the input with call_command.
      • MarkusH
        jaykay: the latter is a bug
      • FunkyBob
        Mississauga: you never alter manage.py ... settings.py is the root of your project... urls.py is whatever and wherever you want it to be [since you specify it in settings.py]
      • jaykay
        MarkusH: a known one or should i report it?
      • FunkyBob
        Mississauga: in fact, manage.py is just a convenience wrapper for django-admin.py
      • Left_Turn joined the channel
      • MarkusH
        jaykay: looking for the ticket
      • FunkyBob
        Mississauga: so... what trouble are you having in "managing" these files?
      • jaykay
        MarkusH: thanks.
      • lxer
        So now I have USE_TZ=True and TIME_ZONE='Europe/Berlin', but my time timestamps are still UTC . ( my timestamp is added automatically set in the model models.DateTimeField(auto_now_add=True, auto_now=False) )
      • doismellburning
        lxer: yes
      • lxer: s/but/and/
      • jaykay
        so, can anyone tell me how i can test whether there are model changes that don't have a migration yet?
      • lxer
        thats fucked up :P
      • MarkusH
        jaykay: have a look at the runserver component
      • doismellburning
        lxer: why?
      • MarkusH
        that does a check for missing migrations
      • FunkyBob
        Mississauga: a better question, I guess, is what are you using as a basis for comparison?
      • jaykay
        MarkusH: if you are referring to the "there are unapplied migrations" message, that's not what i want. the problem is not unapplied migrations, but migrations that don't exist yet
      • bmispelon has quit
      • MarkusH
        jaykay: ah, ok
      • BPL joined the channel
      • lxer
        doismellburning: because now if I want to check when something was created (and if it is older then now(), in my case ) I always have to add +1 hour..
      • MarkusH
      • doismellburning
        lxer: ...why?
      • lxer: demonstrate this in a gist please?
      • MarkusH
      • doismellburning
        lxer: (this sounds like you misunderstand timezones)
      • limbera
        in django-rest-framework, if i am using token-auth, will request.user automatically be the user who has authenticated via the token?
      • jaykay
        MarkusH: well, yes... that's a lot of code i'd have to copy to get to that line... :) it's quite unhandy that this is one large block of code
      • gener1c joined the channel
      • gener1c
        is there a way to connect django 1.7 to mongodb?
      • greg_f joined the channel
      • i could only find django-norel for 1.5
      • FunkyBob
        gener1c: sure... pick whatever python mongodb driver you want, and use it
      • gener1c: in what way do you want to "connect" django to it?
      • doismellburning
        gener1c: ^ re "in what way"
      • (mongoengine was good last I looked)
      • FunkyBob
        gener1c: do you want to plaster layers of crap on top of it to make it look like a relational store, so you can access it via the ORM?
      • or do you want ways to make forms work nicely with mongo documents?
      • keimlink joined the channel
      • limbera
        is there a more elegant way to roll back a migration?
      • i just made a migration, but i'd like to go back to the way it was before
      • should i just migrate again?
      • jaykay
        limbera: you can do "migrate <migrationname>" to migrate back to some other migration. or did i get the question wrong?
      • gener1c
        FunkyBob: why not both?
      • roger-gordon-old joined the channel
      • keimlink has quit
      • limbera
        thanks
      • MarkusH
        limbera: if you haven't applied the migration _AND_ it is the last one in that app: remove the .py file
      • FunkyBob
        gener1c: because trying to make a dog quack is silly
      • PaulN joined the channel
      • gener1c: why would you use mongo if you actually want a relational store?
      • apollo13
        so I'd actually prefer a quacking dock :þ
      • roger-gordon-old
        Hi all. Django and IRC newbie here…
      • gener1c
        that is true, it looks like mongo's native language is a lot more like orm already
      • apollo13
        (over a barking one that is ;))
      • roger-gordon-old
        Got a question if I may…
      • FunkyBob
        gener1c: it's nothing to do with the query language
      • MarkusH
        roger-gordon-old: just ask :)
      • FunkyBob
        it's the fact the ORM is an Objed -> Relational Mapper... and Mongo is quite specifically a non-relational store
      • gener1c
        i dont want a relational store i just want to use django without needing to care what database is behind the orm abstraction
      • FunkyBob
        gener1c: well, you already have that
      • roger-gordon-old
        I have a project that I created a while back using django 1.5. I want to upgrade to 1.7 now. What should I do?
      • FunkyBob
        Django can already more or less transparently use several DBMS out of the box
      • and there are a number of high quality 3rd party libs to support more
      • MarkusH
        roger-gordon-old: go through the release notes and change what's necessary.
      • mattmcc
        gener1c: Sounds more like you want to require precisely one database (mongo)..
      • roger-gordon-old
        OK, that sounds straightforward. Thanks!
      • jaykay
        roger-gordon-old: what i did is: got test coverage up to 90% and run that with "python -Wall". it will tell you most of the features that you use and that are deprecated. maybe first upgrade to 1.6, then repeat that process before upgrading to 1.7.
      • underthehill has quit
      • roger-gordon-old
        Thanks MarkusH.
      • PaulN has quit
      • doismellburning
        roger-gordon-old: I'd recommend going via 1.6
      • roger-gordon-old
        I’d also like to upgrade Python to 3.4 is this recommended?
      • jessamynsmith joined the channel
      • PaulN joined the channel
      • FunkyBob
        roger-gordon-old: can't see many reasons not to
      • tricoder has quit
      • gener1c
        FunkyBob: so ill have to disable the authentication, admin and sessions components if i want to use mongo and there is no going around it?
      • keimlink joined the channel
      • roger-gordon-old
        Thanks FunkyBob, doismellburning and jaykay.
      • armicron joined the channel
      • FunkyBob
        gener1c: something like that... at least the Django supplied ones - except sessions, it has pluggable storage backends
      • jessamynsmith has quit
      • trivialanalog joined the channel
      • gener1c: must admit I'm curious what it is you're doing that will benefit from using an unreliable document store like mongo...
      • tyfighter has quit
      • doismellburning
        gener1c: "i just want to use django without needing to care what database is behind the orm abstraction" - if "database" -> "relational database" then this holds
      • gener1c
        i am using the database as a backend for celery to do a lot of intensive tasks, the configuration of the tasks is done from a web interface and i wanted it to reside on the same db
      • AndyRez joined the channel
      • doismellburning
        ...and?
      • gener1c
        got a better idea
      • ?
      • doismellburning
        use postgres
      • (oh and don't use it as a celery broker)
      • gener1c
        so i need 2 seperate databases, there is no escaping it
      • different*
      • doismellburning
        gener1c: no, you need a database and a queue
      • (fsvo "need" ("want with a high probability"), "database" ("relational database"))
      • mattmcc
        One of these days when I have free time, I'll check out PGQ.
      • gener1c
        i use rabbitmg as the broker
      • doismellburning
        fair enough
      • gener1c
        but i need some sort of persistency in the backend so i chose mongo
      • FunkyBob
        gener1c: if you're using rabbitmq, what's the bullshit about using mongo?
      • MarkusH
        mattmcc: you mean in your next life?
      • FunkyBob
        oh, mongo is relibly persistent now?
      • gener1c
        hehehe
      • mattmcc
        MarkusH: Something like that, yeah. :P
      • FunkyBob
        gener1c: why pick mongo, again?
      • doismellburning
        gener1c: or, pick postgres, and have an easier life
      • apollo13
        cause it's the new (old) cool (but not so cool) shit out there
      • Hairy joined the channel
      • and marketing!
      • FunkyBob
        for a bit there, it seemed you were saying you were using it for the job queue...
      • apollo13: marketing which tended to be "it's just as trustable as mysql, but not as slow!" ... wasn't it?