#django

/

      • xaiphron has quit
      • wuzamarine joined the channel
      • newdimension
        Is there a way to pass url's include() a list called something than urlpatterns? I'm looking at the include() code and from what I can tell it expects it to be called urlaptterns
      • djapo joined the channel
      • codermato joined the channel
      • codermato
        hey, any recommendation for good price/quality ratio django hosting?
      • newdimension
        codermato: Do you wnat to manage the server or have it be managed for you?
      • |oLa| has quit
      • codermato
        newdimension: I don't understand, I think standard VPS will be fine.
      • newdimension: I use my old laptop currently and I am satisfied, but that's not very convenient:)
      • newdimension
        codermato: If it's a VPS you're managing it (updates, backups, security...). I used DigitalOcean, there's a few alternative. But at ~$5/month they're all pretty much the same
      • *I use
      • audioburn has quit
      • audioburn joined the channel
      • codermato
        newdimension: and how many conccurent connections can it handle? To be honest I have no clue whether 1GB ram etc will be enough
      • newdimension
        codermato: When concurrent connections become a problem you can move somewhere else. The 1GB is going to do just fine now if this is a side project. I don't good answer for your question, but the 1gb handles a decent amount
      • codermato
        newdimension: yes, thanks:)
      • wuzamarine
        I've been trying to learn django for years. I can never get past the vhost config. the language is junk without vhost. Always the same dead end, some jacked up permission issue iwth the vhost engine. I tried apache to. same ultimate issue. https://stackoverflow.com/questions/52459703/uw...
      • newdimension
        codermato: It's worth automatic the deployment process with ansible or fabric FYI. It removes the effort from deployment including swtiching somewhere else
      • *automating
      • wuzamarine: That's a not a Django problem FYI.
      • wuzamarine
        newdimension: ultimately it becomes a django issue. if people can't use it....
      • newdimension
        wuzamarine: I get where you're coming from. But that's not really true. You probably learned Django just fine. Now you're having an issue, that's probably linux related.
      • You showed the directory permissions. You sure the socket file inherited those permissions?
      • adsworth joined the channel
      • wuzamarine
        newdimension: I tried every user on the system. it wants web]
      • systemd to? yup
      • newdimension
        What are the socket file's permissions?
      • wuzamarine
        root? yup nobody? yup
      • newdimension
        root can't get permisson error, as far as I know
      • wuzamarine
        it blocks root with an error.
      • newdimension
        What's the error?
      • Jaykay1 joined the channel
      • lorddaed_ joined the channel
      • Can you try moving uwsgi_pass unix:/run/uwsgi/fixdsite.sock to somewhere you know you have permission? I haven't used uwsgi, and I don't know what this run folder is
      • wuzamarine
        root is the wrong answer on any web server
      • lorddaedra has quit
      • newdimension
        wuzamarine: I wasn't suggesting you run it on root. I'm telling you if root is getting an error, you have a different problem that permissions
      • *than
      • Jaykay1 is now known as Jaykay
      • wuzamarine
        newdimension: thats a trail of errors I left 3 weeks ago.
      • GinFuyou
        wuzamarine, just in case: you can run uwsgi through network socket instead of unix. Worse but doens't have permission issue
      • wuzamarine has quit
      • I guess it stays "django problem"
      • newdimension
        GinFuyou: right? It's everything but a Django problem
      • Jaykay has quit
      • GinFuyou
        If you go stretching, you can stretch any problem to be your fault not fixing it.
      • But it surely most easy to stop on being someone's else problem before it
      • lolidunno has quit
      • felixx has quit
      • newdimension joined the channel
      • Combined2857 has quit
      • ciaala joined the channel
      • Buliarous joined the channel
      • mnemonicj has quit
      • tdy joined the channel
      • jhoskins98 joined the channel
      • tdy has quit
      • newdimension
        Where can I put non-app sepcific template tags? (site wide)
      • mnemonicj joined the channel
      • eblip joined the channel
      • def_jam joined the channel
      • eb0t has quit
      • breezy_ joined the channel
      • eb0t_ has quit
      • eblip is now known as eb0t_
      • breezy_
        Hi guys/gals, i have code that is being evaluated in a docker container and i would like to spit that out to the browser when it is done evaluating
      • do i need django channels/websockets for this
      • drodger has quit
      • user submits untrusted code via a form on my site--> code is tested against test suite in docker container--> need user to see output of this
      • drodger joined the channel
      • newdimension has quit
      • wreed joined the channel
      • omenar joined the channel
      • anyone here?
      • wreed has quit
      • optiz0r has quit
      • wreed joined the channel
      • pfcodes joined the channel
      • breezy_ has quit
      • wreed has quit
      • nicolas17
        hmm looks like makemigations creates models in alphabetical order
      • Fr4n joined the channel
      • cryptopian joined the channel
      • so it's creating B, then C, then adding a field to B as a foreign key into C
      • pfcodes has quit
      • I thought it would be smarter and figure out creating B after C is one less operation...
      • greatgatsby joined the channel
      • cryptopian has quit
      • optiz0r joined the channel
      • anddam joined the channel
      • mvanorder joined the channel
      • mvanorder_ joined the channel
      • mvanorder has quit
      • codermato has quit
      • sumitcn has quit
      • rjdp9736 joined the channel
      • I wonder if that was improved in newer versions of django...
      • __marco has quit
      • adsworth has quit
      • cryptopian joined the channel
      • mvanorder_ has quit
      • cryptopian has quit
      • joshy_josh has quit
      • jgadelange has quit
      • newdimension joined the channel
      • hop
        i guess the implementation values stability over efficiency
      • jgadelange joined the channel
      • MarkusH has quit
      • kisasexypantera joined the channel
      • nicolas17
        if I want to get picky, I can rename the model (XExport instead of Export so that table is made last), makemigrations, and edit the migration file to have the right name :P
      • jarshwah has quit
      • BSLang joined the channel
      • miz- has quit
      • jarshwah joined the channel
      • newdimension
        Should I have a slash add the end of all my url patterns?
      • FunkyBob
        it's a good convention to follow
      • there are some corner case issues it can help avoid
      • eperzhand joined the channel
      • omenar has quit
      • moretango joined the channel
      • hop
        nicolas17: not quite sure what would be gained
      • newdimension
        I just went through all my URLs, was I right in added "/$" to all patterns that don't involve an included() ?
      • *adding
      • hop
        newdimension: can't hurt. doesn't do much, either
      • unless you used other mechanisms to get at parts of the path
      • newdimension
        What made me look at URLs is because I one /<project_ID/... defined without "/$" but when the page loads I beleive Django adds a slash. So if I just changed project_id in the URL and pressed enter I would get 404
      • *because I have one
      • hop
        that sounds ominous
      • newdimension
        It was fixed when I added "/$"
      • def_jam
        hey i have a model which has a field of text. on one display i only want to show maybe first few words of this text
      • so i have a queryset and it contains objects and i want to display some of the fields from the object
      • where should i truncate the field. in the model or in the view
      • hop
        def_jam: judgement call
      • newdimension
        def_jam: Do you want to (1) show some of the fields, (2) show parts of one field
      • hop
        def_jam: a custom template filter might be an option as well
      • def_jam
        basically up to now i pass my queryset to the template, and i then display some of the fields
      • for this situation i just want to display some of the fields, but on this one field just truncate it to maybe 100 characters
      • jb0t
        When you add a `prefix` to a form instance, Django handles the creation of elements and appends the prefix then transparently handles it within the form processing machinery. My question is, are there any convenience mechanisms for access. For example, when I get the form errors and put them in to a json response they do not include the prefix for the error keys (field names).
      • def_jam
        you see eventually if a person clicks on the record, i will then take them to a page that shows all the information plus some more from another record
      • newdimension
        def_jam: Truncate the field vcalue in templates
      • FunkyBob
        jb0t: pssst... prepends the prefix, not appends :)
      • jb0t
        FunkyBob: ah yes. good point.
      • hop
        def_jam: there already is a truncatechars filter built into django
      • def_jam
        but newdimension the template is a html document, so how can i truncate a field in that ,? i have seen some basic {%for%}
      • hop
        the template is not a html document
      • def_jam
        yes hop i found one in from django.utils.text import Truncator
      • newdimension
      • def_jam
        but i cant use that in a template which is html
      • ah thanks ill look at that