Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-02 Thread Andrew Godwin
Yup, any sort of TCP-level proxy with failover will work for this sort of thing, but you'll likely see some errors whenever you failover as Channels loses its blocking connection that it's using to wait for messages - as always, please test a failover before you rely on it! Andrew On Thu, Aug 2,

Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-02 Thread Filbert
Andrew, Just to be clear, there is no reason I can't use haproxy to front end redis sentinel to effectively hide all this from channels 1 or 2 right? Very surprised there isn't anyone running this in production that doesn't need some form of HA. Buried trying to get a product out the door righ

Re: trouble adding variables to URLs in templates... seems some characters get cut out like "?"

2018-08-02 Thread Christian Seberino
Brilliant! You got it! That was right on! cs On Thursday, August 2, 2018 at 4:48:27 PM UTC-5, Matthew Pava wrote: > > I would verify that the view actually assigns to the template variable > what you are expecting it to be assigned to. > > > > *From:* django...@googlegroups.com [mailto: > dj

Re: Channels/Redis fault tolerance with Twemproxy?

2018-08-02 Thread Andrew Godwin
The Sentinel option was removed in the 2.0 rewrite as it didn't have someone to help maintain it (I didn't have the time then and don't right now), so you are right, there's currently no easy HA option for Redis with Channels. If you're interested in one, I can give you some tips on what code need

RE: trouble adding variables to URLs in templates... seems some characters get cut out like "?"

2018-08-02 Thread Matthew Pava
I would verify that the view actually assigns to the template variable what you are expecting it to be assigned to. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Christian Seberino Sent: Thursday, August 2, 2018 3:36 PM To: Django users Subject: trouble

trouble adding variables to URLs in templates... seems some characters get cut out like "?"

2018-08-02 Thread Christian Seberino
Suppose you have a URL built from a variable in a template like so...test. I noticed that parts of some_variable get cut out if they include certain characters. For example... "/search/?search=" seems to get replace with "/search/". What is the part after "?" cut off? (I have same problem eve

How to make a Purchase Order app?

2018-08-02 Thread Alexander Joseph
I've been working on a Purchase Order app but I'm getting a little confused how I'm going to put it all together. I have 3 models - class PurchaseOrder(models.Model): po_number = models.IntegerField(default=get_po_number, unique=True) po_date = models.DateField() invoice_number = mod

Re: GEOSGeometry function dies with error pure virtual method called message

2018-08-02 Thread Saurabh Khanduja
The version of django is 2.0.4 Debugging - Just step into code where the program is crashing in transform function in file ~/anaconda3/envs/py35/lib/python3.5/site-packages/django/contrib/gis/geos/geometry.py On Thursday, 2 August 2018 16:28:43 UTC+2, Tim Graham wrote: > > I'm not sure what you

Django Admin with SQLite3 :memory:

2018-08-02 Thread George Kontridze
Hello, I was wondering if it is possible to use SQLite3 with the :memory: option in conjunction with Django Admin. I have gone as far as creating and running migrations on startup, and I can see that the auth_user table gets created, but when I try to log into the admin web interface, I get an exc

Re: GEOSGeometry function dies with error pure virtual method called message

2018-08-02 Thread Tim Graham
I'm not sure what you mean by "On debugging". Is that the complete code snippet to reproduce the issue? I don't see a crash on my system. Which Django version? On Thursday, August 2, 2018 at 8:29:51 AM UTC-4, Saurabh Khanduja wrote: > > Hi, > This is the piece of code I am working with:- > > po

Re: Server Error on deployment to Digitalocean server

2018-08-02 Thread M Hashmi
You need to do little extra. Login to your DigitalOcean account and follow instructions in the link to add MX records for sendgrid. https://www.digitalocean.com/community/questions/how-to-make-sendgrid-work-on-digitalocean On Thu, Aug 2, 2018 at 7:03 AM, Azeez Akinsola wrote: > Thank you Hashm

Re: Server Error on deployment to Digitalocean server

2018-08-02 Thread Azeez Akinsola
Thank you Hashmi for your help. I am using sendgrid for sending emails Please check my .env and settings.py files I deployed to the server, I am not sure if need to add or remove any variables SEND_GRID_API_KEY = '' EMAIL_HOST_USER = 'xx...@gmail.com' EMAI

RE: i want to save is_staff value true in db but not save in database

2018-08-02 Thread Matthew Pava
You’re adding an attribute (is_staff) to the form and then saving the form, but no method is doing anything with that attribute. When you save a model form, it will return the instance of the model. You can then proceed to change that model, and save it again. if form.is_valid():

Re: Server Error on deployment to Digitalocean server

2018-08-02 Thread M Hashmi
Set your SMTP configurations in settings.py. Make sure to follow wsgi handler properly by adding IP in ALLOWED_HOSTS = ['yourIP']. Make sure you've setup MX records for your domain configuration with DIgitalocean. On Thu, Aug 2, 2018 at 4:42 AM, Azeez Akinsola wrote: > Hello everyone, > > I ne

Re: Do some task using models in a view before a request is executed.

2018-08-02 Thread Jason
DRF viewsets provide default implementations of list (GET resource/) and retrieve (GET resource/id). You can just reimplement those methods and call `rfm_update` in them. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Do some task using models in a view before a request is executed.

2018-08-02 Thread Christian
Hi there, I'm kind of a novice in django and like to call rfm_update before the get request in the RFM Viewset will executed, but no surprise the migrate doesn't work for a new deployment. What is the best practice to do something like rfm_update so that migrate works. Thanks in advance, Chr

GEOSGeometry function dies with error pure virtual method called message

2018-08-02 Thread Saurabh Khanduja
Hi, This is the piece of code I am working with:- poly = GEOSGeometry('Polygon((-951499 -1276279, ' '-951498 -1276279, ' '-951498 -1276278, ' '-951499 -1276278,' '-951499 -1276279))', srid=5514).transform(4326) On debugging, the file geometry.py it crashes on line 475:- capi.destroy_geom(se

Re: ERROR - server - Error trying to receive messages: name 'txredisapi' is not defined

2018-08-02 Thread Hank Chu
Hi Andrew, after update channels to 1.1.5, it's fixed. thanks. Andrew Godwin於 2018年7月14日星期六 UTC+8上午5時27分06秒寫道: > > What version of Channels are you using? It looks like you're trying to use > Channels 1 without Twisted redis support installed - did you try installing > the package it's asking