#django

/

      • _mirak_
        I'm using sqlite and I found there is virtual tables with Levenstein score
      • fikka
        max3: but yeah for eg if you use docker, redis is not too much to maintain
      • max3
        like why isn't there just something like green threads
      • schinckel
        _mirak_: Plan on using sqlite in production? I'd suggest postgres, if you can.
      • _mirak_
        schinckel: sqlite is enough
      • schinckel
        There's some really nice full-text-searching stuff in postgres, that some clever cloggs have made work with Django.
      • max3
        i don't have any need for ordering, or coherency, or even response. i just need to a task to be done asynchronously. why is there no way to do this in python
      • wreed joined the channel
      • _mirak_
        schinckel: I can move to postgress easily if it solves the proplem
      • mattmcc
        Well, the short answer is processes that are handling HTTP requests shouldn't also be doing other thigns.
      • max3
        one thread one function sure
      • schinckel
        _mirak_: Have a look at the FTS stuff, and see if that meets your needs.
      • fikka
        yeah actually postgres has gist an gin indexes that are pretty cool for fulltext search
      • max3
        i don't agree one process one function
      • schinckel
      • veebull joined the channel
      • _mirak_
        Doesn't look like there is such feature for postgres out of the box
      • mattmcc
        There are several.
      • _mirak_
        mattmcc: Can you point please?
      • mattmcc
      • https://www.postgresql.org/docs/current/static/... is an extension (distributed by default, just needs to be enabled) with more robust functionality, and it can use indexes.
      • max3
        mattmcc, i guess i can use the ipc backend?
      • czart_ joined the channel
      • czart has quit
      • mattmcc
        I'm probably the wrong one to ask, I haven't used channels yet myself.
      • FunkyBob
        and channels 2.0 is fast approaching! :)
      • rpkilby joined the channel
      • max3
        what does 2.0 promise?
      • mattmcc
        Ponies?
      • FunkyBob
        always ponies :)
      • more efficient single-process solution, for a start, iirc
      • max3
        okay fine: rabbitmq or redis?
      • FunkyBob
      • max3
        well i don't want to run django as a single process in production of course
      • rpkilby has quit
      • negaduck joined the channel
      • mojtaba joined the channel
      • mojtaba
        Hello, I have password_change/done url, and I don't want the user be able to see that page by typing the url. Just when he changes his/her password. Do you know what should I do?
      • In other words, I want it to be accessible to internally.
      • miz- has quit
      • max3
        mojtaba, you mean you want a confirmation page?
      • Debnet has quit
      • mojtaba
        max3: Yes
      • negaduck has quit
      • max3
        why does it matter to you if people can see it before then?
      • no one is going to navigate to that url for fun
      • and even if they do why does it matter?
      • also you could just make your response that template instead of it being a url
      • mojtaba
        max3: Just wanted to look more professional
      • max3
        *that template serialized
      • mojtaba
        max3: Could you please explain more.
      • chachan has quit
      • max3
      • response.write("<p>Here's the text of the Web page.</p>")
      • ahrs has quit
      • ahrs joined the channel
      • mojtaba
        max3: thanks
      • _mirak_
        mattmcc: wouldn't it better to use haystack in the case?
      • sasheto has quit
      • mattmcc
        _mirak_: Depends on your needs. Haystack itself isn't an FTS it just abstracts them.
      • mojtaba
        max3: I am using builtin auth view, PasswordChangeDoneView. So it seems I can not use HttpResponse
      • max3
        mojtaba, just subclass it or something
      • mojtaba
        max3: subclass it in the passwordChange class?
      • sasheto joined the channel
      • shredding joined the channel
      • max3
        i don't know what you mean
      • mojtaba, class mypasswordchangeclass(PasswordChangeDoneView): def get(...): super(mypasswordchangeclass, self).get(...)
      • mojtaba
        max3: How about checking 'HTTP_REFERER'?
      • max3
        checking where/when?
      • mojtaba
        When the user navigates to the confirmation page, if the previous page is not the form to change password, it is not allowed. If it is, it will go through.
      • _mirak_
        mattmcc: in a nutshell I need to filter results from my parser, if there is a similar text it should not be written into db
      • max3
        mojtaba, what do you mean go through? but anyway i recommend you don't use http_referer since it can be spoofed
      • shredding has quit
      • mojtaba
        max3: I meant to show them the confirmation message.
      • max3
        yes i understand what you meant and i still think what i said
      • mojtaba
        max3: Thanks, I will try to implement your method
      • wreed joined the channel
      • max3: So when do people use http_referer?
      • max3
        mojtaba, good question. i don't know
      • mojtaba
        max3: :)
      • drodger has quit
      • fikka has quit
      • drodger joined the channel
      • linuxvorpal has quit
      • tobz joined the channel
      • CorsairX joined the channel
      • CorsairX
        Hi all
      • FunkyBob
        hi
      • fikka joined the channel
      • CorsairX
        I have a model with the following field definition "has_been_synced = models.BooleanField(default=True)"
      • I'm using Postgres
      • FunkyBob
        ok
      • CorsairX
        When I check the table definition, the default value isn't being set
      • FunkyBob
        correct
      • CorsairX
        Checking the docs, I can't seem to find how to set a default value
      • FunkyBob
        Django doesn't send those defaults to the schema, just uses them in models
      • there was another discussion about this recently... the big problem is knowing the state of the DB record after an INSERT
      • CorsairX
        Is there way to do this without having to touch the table after performing the migration?
      • I have a similiar issue with a datetimefield where I want the default value to be now()
      • FunkyBob
        again
      • django doesn't do this
      • the default you specify on model fields is NOT recorded in the DB schema
      • it's only used in the model code
      • and I just explained the main reason for this
      • CorsairX
        Understood; so there is no way to enforce this with Django?
      • fikka has quit
      • FunkyBob
        sure.. it's enforced... in your models
      • is there an actual problem you're having?
      • energizer joined the channel
      • energizer has quit
      • energizer joined the channel
      • CorsairX
        Coming from previous projects, I have a bad habit of bypassing frameworks to achieve results
      • Since I'm starting a new project, I'm trying to avoid this and use Django as it was designed to be used
      • FunkyBob
        well, then, stop planning on bypassing it :)
      • CorsairX
        With this particular project, I have a weather sensor where I retrieve the data over a serial link, then save it to a database
      • FunkyBob
        simple enough
      • fikka joined the channel
      • CorsairX
        It's pretty straightforward for the most part
      • Actually, going into this in a little more detail
      • I have a script that runs on an RPi that retrieves the current values from the weather station
      • darkhanb joined the channel
      • I can then either A) send the data using JSON over a TCP/IP connection to a script running on the server and write the data to the database
      • Or B) have RPI do a GET or POST to Django (also running on the server)
      • FunkyBob
        might as well blend both, and POST JSON data to Django over a TCP link :)
      • CorsairX
        Heh!
      • fikka has quit
      • Being a bit of an experiment, I used Django to create the model to log the weather data (with previous project, the database was already defined and Django had to be made aware of the existing database)
      • darkhanb
        I have a question about Django's logging (or python logging in general I guess). So when I define this: https://dpaste.de/r1J4 on my project settings, does "django" logger override the existing default "django" logger? and the rest default loggers will work?
      • What I'm trying to do, is to have the existing default Django LOGGING but without mailing to the admins feature.
      • _mirak_ has left the channel
      • fikka joined the channel
      • chicocvenancio joined the channel
      • rpkilby joined the channel
      • fremont joined the channel
      • fikka has quit
      • rpkilby has quit
      • fremont has quit
      • techno_x64 has quit
      • fikka joined the channel
      • techno_x64 joined the channel
      • does defining "django" logger effectively overrides the default "django" logger?
      • or are they stacked?
      • eperzhand joined the channel
      • techno_x64 has quit
      • cpd8 joined the channel
      • techno_x64 joined the channel
      • matsaman joined the channel
      • djapo
        any chance that there is a postgres database layer that uses https://github.com/MagicStack/asyncpg
      • fikka has quit
      • I want to use the django orm asyncronously