#django

/

      • zeus1 joined the channel
      • fikka joined the channel
      • Combined2857
        Hi all, I am trying to get my app to install in heroku and I can't :(. this is the log tail https://pastebin.com/raw/R2jSuwW5 THis is the app in the branch development https://github.com/TheDemocracyFoundation/epito... . Development succeeds, Release phase succeeds, Deploy succeeds, I open the app and it gives me "Application error". any ideas please ? :/ Must be a problem with my heroku configs, I can deploy the app
      • just fine in my computer
      • eperzhand joined the channel
      • fikka has quit
      • eperzhand has quit
      • np i fixed it
      • dimas has quit
      • fr33co joined the channel
      • fr33co has quit
      • Now I'm getting a Server error (500) when I try to open the app... please help ? :(
      • "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1421: RuntimeWarning: DateTimeField Poll.PL_ENDDT received a naive datetime (2018-09-08 15:12:36.505311) while time zone support is active.
      • 2018-09-08T15:12:36.509160+00:00 app[web.1]: RuntimeWarning)
      • aossama has quit
      • aossama joined the channel
      • knbk
        Combined2857: a RuntimeWarning usually doesn't result in a server error
      • (you should still fix it, you're probably using datetime.now instead of django.utils.timezone.now as a default Poll.PL_ENDDT?)
      • riclima_ joined the channel
      • aossama has quit
      • aossama joined the channel
      • Combined2857
        knbk: you are right, the problem is elsewhere
      • I can see the login screen of my app, but when I login it gives me a 500 error. here is the log at=info method=GET path="/dashboard/" host=gadfgadfgadfga.herokuapp.com request_id=dd98c72b-9482-4152-aec4-b69ab8027124 fwd="125.253.57.246" dyno=web.1 connect=0ms service=232ms status=500 bytes=234 protocol=https
      • this is the html of the app in question https://github.com/TheDemocracyFoundation/epito...
      • also other apps don't work, admin page and login page works
      • must be somethign with the static files of those apps? I have debug = False and whitenoise to serve the static files
      • But I just installed whitenoise and trying to make it work, can someone take a look to see if I have configured it incorectly ? I read the official and many other guides and I think I did a good job ?
      • frog3r joined the channel
      • knbk
        you should have a traceback in your log files that tells you what the actual error is
      • jackhum joined the channel
      • crCr62U0 has quit
      • Combined2857
        Turns out i didn't do migrations correctly
      • crCr62U0 joined the channel
      • automatical joined the channel
      • tvm has quit
      • xliiv joined the channel
      • lxer
        in the Admin pages there is this functionality of selecting some records and then start some 'action' for these records. How would I add such functionality in regular templates/views?
      • aossama has quit
      • aossama joined the channel
      • idiocrash joined the channel
      • jtiai
        a modelform with additional checkbox, modelformset_factory, form with select action options and a submit button. Nothing magical.
      • And then piece of code to tie all this together.
      • lxer
        i dont get it. It is a ListView, not a form.
      • jtiai
        What is listview?
      • crCr62U0 has quit
      • lxer
        build in generic view
      • jtiai
        What is?
      • lxer
      • jtiai
        How that relates to your question?
      • lxer
        u trollin?
      • jtiai
        No. I've been doing this 10 years and I still can't read peoples minds.
      • I don't know how that built in generic ListView relates to your question.
      • Admin does have a *list view* but it's completely custom one and has nothing to do with built-in generic ListView.
      • two_tired2 joined the channel
      • lxer
        i'm not using Admin, I just mentioned it as an example to describe the functionality I'm after
      • jtiai
        And I gave you an answer you could use.
      • idiocrash has quit
      • lxer
        you're not making any sense to me.
      • two_tired has quit
      • maks25 joined the channel
      • fission6 joined the channel
      • jtiai
        What part was the unclear one?
      • maks25
        If I wanted to build a simple app like simplenote or bear notes, what would my models look like. Would a Note model point to a file, or would I just save the note in a TextField? I am guessing that saving the notes in a TextField is not a good idea due to the db getting huge very fast.
      • lxer
        jtiai: all. it reads like random words.
      • jtiai
        lxer: Wel I just gave you list of components that you could use. How you do that is really up to you.
      • maks25: How big notes are you expecting?
      • crCr62U0 joined the channel
      • maks25
        jtiai: would be user specific, but probably multiple pages at least
      • jtiai
        maks25: multiple pages of what?
      • maks25
        text notes
      • Like notes for e.g. Biology
      • xliiv has quit
      • jtiai
        but how big size that page would be if written by hand?
      • xliiv joined the channel
      • maks25
        10,000 characters or more
      • eb0t
      • jtiai
        Well that would be ~10kb.
      • eb0t
        is code on line 156 actaully necessary
      • you have just set is staff and is superuser to true
      • why bother checking it
      • riclima_ has quit
      • jtiai
        eb0t: Since it's done by code when you use that.
      • broken code may omit those values.
      • eb0t
        ah thanks jtiai
      • jtiai
        or set them false actually.
      • frog3r has quit
      • maks25
        jtiai: yea but if you have thousands of users, and each user has tons of notes each a few pages long. At what point would I want to take it out of the db and store it in separate files?
      • jtiai
        maks25: When you have more than few terabytes of data.
      • maks25
        jtiai: alright then, textfield it is
      • jtiai
        I bet that most of your notes will be just few lines of text.
      • maks25
        jtiai: yea most likely
      • djapo joined the channel
      • jtiai: I was looking at different note taking software, and all of them were either super bloated, or too simple. Figured it might be fun to make my own
      • jtiai
        That would be very fun. Then allow markdown...
      • maks25
        jtiai: yea def
      • jtiai: I want to add a flashcard type of feature, so it’s easy to review notes and test yourself
      • tdy joined the channel
      • Combined2857 has quit
      • frog3r joined the channel
      • audioburn has quit
      • frog3r has quit
      • foxmask
        except with raw sql, is there a way with a queryset to use something like "with recursive" ?
      • I'd like to retrieve a tree of folders
      • jtiai
        foxmask: Django 2.1 should have window functions that may be able to do that.
      • Can't guarantee though.
      • foxmask
        i've a correct raw SQL but before putting it inside a model.objects.raw() i'd like to find a more django way to do it
      • ok
      • jtiai
        Also you might be able to setup your own window function expression to get the data you want to.
      • zeus1 has quit
      • audioburn joined the channel
      • jackhum has quit
      • lomex joined the channel
      • tonythomas joined the channel
      • aossama joined the channel
      • asimon has quit
      • Haudegen has quit
      • techalchemy has quit
      • mitaka joined the channel
      • eperzhand joined the channel
      • mitaka has quit
      • oxygene joined the channel
      • detseg joined the channel
      • csotelo_ joined the channel
      • govg joined the channel
      • csotelo has quit
      • eperzhand has quit
      • graphene has quit
      • graphene joined the channel
      • CtrlC joined the channel
      • jtiai_ joined the channel
      • graphene joined the channel
      • jtiai has quit
      • enoq joined the channel
      • bluesmonk joined the channel
      • Haudegen joined the channel
      • bluesmonk
        hi! I come from flask, thinking of switching to django. I learn best from books and I am thinking now of tango with django, 2scoops and the testing goat. From what I've read so far people say that 2 scoops is mostly a best practices summary, and the that testing book is the best way to go. Looking at the book, it uses django 1.11, and I've read that django> 2.0 introduces a lot of changes. Will it be okay to
      • use this book?
      • I meant that it introduces a lot of major changes in comparison with previous versions.
      • lxer
        no, mostly some configuration changes
      • basics are all the same
      • bluesmonk
        great
      • what would be an important change to consider?
      • kinda overthinking here, I just don't want to accidentaly learn python 2.7, lol
      • lxer
        url syntax is diferent. and there was something with the way the template folders are defined in the config
      • bluesmonk
        lxer: okay, I will check those out, thanks
      • knbk
        well, 2.0 introduces an additional, simpler url syntax. The old syntax still works
      • lxer
        i doubt the old syntax still works
      • knbk
        why do you doubt that?
      • lxer
        because I had to change it in some apps to make it work
      • adsworth has quit