memory leak in django app?

2017-12-06 Thread Etienne Robillard
Hi all, I'm struggling to understand how django/python may allocate and unallocate memory when used with uWSGI. I have a Debian system running Python 2.7 and uwsgi with 2GB of RAM and 2 CPUs. Is that enough RAM memory for a uWSGI/Gevent based WSGI app running Django? I'm running uWSGI with

Re: Enable https for a production django application

2017-12-06 Thread Tim Chase
Sorry, forgot to mention OV ("Organization Validation") certs. There's a good comparison here https://www.ssl.com/article/dv-ov-and-ev-certificates/ Additionally, you *can* self-sign your own cert but it will throw up an "untrusted cert" warning to your users. This used to be a viable option for

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
Hello, the amount of memory you need depends on what Django does and how many workers (instances of Django) you run (which usually depends on how many requests you are getting and how I/O intensive your Django application is). For many applications, 512 MB is enough. Why are you worried? The only

Re: memory leak in django app?

2017-12-06 Thread Etienne Robillard
Hi Antonis, Thank you for your reply. I installed the htop utility and found that 2 of my 4 uWSGI processes are using 882M (42.7%) of resident memory each. Theses two processes takes about  (85%) of the available RAM memory! That can explain why I get "out of memory" errors when no more memory

Re: Strange query when using annotate and count

2017-12-06 Thread Cristiano Coelho
After testing for a while, there really doesn't seem to be a good way to do this. . Annotation is required since the query is filtered based on the annotated value, so any attempt to clear annotations would fail. Although a lookup could be used for the filtering. But a custom lookup is not poss

RE: django 2.0 url to path

2017-12-06 Thread Matthew Pava
Is settings.DEBUG set to True? From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of ??? Sent: Tuesday, December 5, 2017 9:00 PM To: Django users Subject: django 2.0 url to path i try to use path instead of url but there are some problem following is my code

RE: django 2.0 url to path

2017-12-06 Thread Matthew Pava
Oh, and it looks like you need to add a “/” to the end of your 'application/register' path. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matthew Pava Sent: Wednesday, December 6, 2017 8:26 AM To: 'django-users@googlegroups.com' Subject: RE: django 2.0 u

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
Does this happen only in production? What about when you run a development server? What is the memory usage of your development server? Antonis Christofides http://djangodeployment.com On 2017-12-06 15:05, Etienne Robillard wrote: > Hi Antonis, > > Thank you for your reply. I installed the htop

Re: memory leak in django app?

2017-12-06 Thread Etienne Robillard
Hi Antonis, My development server appears unaffected by this problem. Plus I can get heap stats using guppy, which is pretty cool. :) Both my production and development servers have __debug__ enabled in Python 2.7.13. However when using ab -c 100 to benchmark my nginx server I get: SSL han

Re: Strange query when using annotate and count

2017-12-06 Thread Cristiano Coelho
Update. Found a work around that gets rid of the unnecessary group by (and hence speeds up the query, from ~200ms to ~100ms in my use case). Simply adding a .values('pk'). Bad thing, every model needs a custom manager and it will still use an inner query, still trying to figure out the side effe

Re: Polls website from documentation

2017-12-06 Thread Langton Chikukwa
It worked thank you On Wed, Dec 6, 2017 at 2:22 AM, Langton Chikukwa wrote: > Thank you let me try that > > > > > > *From: *yingi keme > *Sent: *Wednesday, December 6, 2017 2:19 AM > *To: *django-users@googlegroups.com > *Subject: *Re: Polls website from documentation > > > > Your url is not p

Django - Paginate with another GET request; not working with just pagination page number

2017-12-06 Thread Jack
I'm building a page with pagination and a filter form (2 GET requests). If the URL includes both pagination and filter results, something like `/questions/?page=2&all_questions=on`, it works fine. It also works if it just has filter results, something like `/questions/?all_questions=on`. Howe

Re: memory leak in django app?

2017-12-06 Thread Antonis Christofides
The "SSL handshake failed" doesn't seem related to the alleged memory leak. Now, you say you have this problem only in production. If you restart uwsgi, does memory usage go immediately up? Does it go after a few requests? How many requests? Do you have the same data in development and production?

Re: memory leak in django app?

2017-12-06 Thread Etienne Robillard
Hi Antonis, Le 2017-12-06 à 16:23, Antonis Christofides a écrit : The "SSL handshake failed" doesn't seem related to the alleged memory leak. Correct. I forgot to specify which SSL protocol to use. Using ab -f TLSV1 solved that problem. Now, you say you have this problem only in production.

ValueError source code string cannot contain null bytes

2017-12-06 Thread Rajeshwaran
Hi All, I am facing this "ValueError: source code string cannot contain null bytes" error when i create a sqlite3 database and run the application. Steps that i do : 1. Create database using db browser for SQLITE3 2. Create model by running "python manage.py inspectdb > models.py" 3.

ValueError: source code string cannot contain null bytes

2017-12-06 Thread Rajeshwaran
Hi All, I am facing this "ValueError: source code string cannot contain null bytes" error when ever i create a splite3 database and use it. Below are the steps i follow. 1. Create the database using db browser. 2. Run python "manage.py inspectdb > models.py" 3. I run the server with "p