Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
You should only use the documented, public groups API - anything else will
vary based on the backend you use. You will, indeed, need your own
expiration logic and backend for this process stuff - an easy entry point
would be one of:

- A database row per process with a timestamp bumped using keepalive-style
calls
- A redis key per process with an expiry bumped using keepalive-style calls

This will probably be the most reliable thing as keepalive means that even
if you miss a disconnect event, it'll shut down eventually (the tradeoff
being that you might miss several keepalives and then shut it down early)

Andrew

On Thu, Jun 1, 2017 at 9:26 PM, Brian May 
wrote:

> On Friday, 2 June 2017 14:08:40 UTC+10, Andrew Godwin wrote:
>>
>> I don't have any direct examples to hand - and this sort of thing does
>> come all the time, but much like Django is not in the business of including
>> a full CMS, Channels can't add lots of high-level features without really
>> narrowing the usage - it's a general framework for you to build something
>> on.
>>
>
> I am not sure I can how how to do this expiration myself.
>
> inmemory.ChannelLayer has a _clean_expired() method that looks like it
> will look for all outgoing messages that haven't been sent before expiring.
> However it looks like my application, being a layer on top of groups
> doesn't have access to any of this information.
>
> So maybe I need to put some sort of keep alive mechanism in place, and
> completely ignore this existing expiration mechanism?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/3e22d613-29a3-4dc0-b99d-63db8616f7de%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1upVJVdBhx9i6NkG84TNizP3ii5%3D5Uy156xuqivQuKO2Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django channels group subscriptions

2017-06-01 Thread Brian May
On Friday, 2 June 2017 14:08:40 UTC+10, Andrew Godwin wrote:
>
> I don't have any direct examples to hand - and this sort of thing does 
> come all the time, but much like Django is not in the business of including 
> a full CMS, Channels can't add lots of high-level features without really 
> narrowing the usage - it's a general framework for you to build something 
> on.
>

I am not sure I can how how to do this expiration myself.

inmemory.ChannelLayer has a _clean_expired() method that looks like it will 
look for all outgoing messages that haven't been sent before expiring. 
However it looks like my application, being a layer on top of groups 
doesn't have access to any of this information.

So maybe I need to put some sort of keep alive mechanism in place, and 
completely ignore this existing expiration mechanism?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3e22d613-29a3-4dc0-b99d-63db8616f7de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
I don't have any direct examples to hand - and this sort of thing does come
all the time, but much like Django is not in the business of including a
full CMS, Channels can't add lots of high-level features without really
narrowing the usage - it's a general framework for you to build something
on.

Andrew

On Thu, Jun 1, 2017 at 8:58 PM, Brian May 
wrote:

> On Friday, 2 June 2017 13:04:48 UTC+10, Andrew Godwin wrote:
>>
>> You can't do what you ask with the current Groups system - it is
>> deliberately very simple as anything more complex involves picking scaling
>> tradeoffs that are particular to the thing it's powering. You'll have to
>> layer some of your own code on top of groups (you can keep groups for the
>> broadcast message bit, and then add state management for processes done in
>> the websocket connect/disconnect methods)
>>
>
> I guess this means I need to do my own expiration processing too.
>
> Are there any examples you know of that I can look at for inspiration?
>
> I am surprised this sort of thing doesn't seem to have come up before.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/1d699f5b-441b-455b-9828-2a18326b616f%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1uqerMnasbuqd%3D%3DEY__5ftf%2B82ro8ibk4PWMvePzYiU-7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django channels group subscriptions

2017-06-01 Thread Brian May
On Friday, 2 June 2017 13:04:48 UTC+10, Andrew Godwin wrote:
>
> You can't do what you ask with the current Groups system - it is 
> deliberately very simple as anything more complex involves picking scaling 
> tradeoffs that are particular to the thing it's powering. You'll have to 
> layer some of your own code on top of groups (you can keep groups for the 
> broadcast message bit, and then add state management for processes done in 
> the websocket connect/disconnect methods)
>

I guess this means I need to do my own expiration processing too.

Are there any examples you know of that I can look at for inspiration?

I am surprised this sort of thing doesn't seem to have come up before.

Thanks 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1d699f5b-441b-455b-9828-2a18326b616f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django channels group subscriptions

2017-06-01 Thread Andrew Godwin
You can't do what you ask with the current Groups system - it is
deliberately very simple as anything more complex involves picking scaling
tradeoffs that are particular to the thing it's powering. You'll have to
layer some of your own code on top of groups (you can keep groups for the
broadcast message bit, and then add state management for processes done in
the websocket connect/disconnect methods)

Andrew

On Thu, Jun 1, 2017 at 7:11 PM, Brian May 
wrote:

> Hello,
>
> I would like to be able to create a Django Channels group such that:
>
>1. Websockets can can subscribe and unsubscribe (or disappear) to
>group that the client specifies.
>2. When the first client subscribes to a group, it starts some process
>(e.g. via celery task) that feeds this group with real time notifications
>about a particular event.
>3. When the last client unsubscribes (or expires) from the group, it
>kills the process or marks the process to self-destruct when next
>convenient.
>
> Step 1 is reasonable with this is groups. However not sure about 2 or 3. I
> can't see anyway with the existing groups to find out when the first client
> subscribes or the last client disappears.
>
> I could replace/override ChannelLayer with my own code, but this seems
> unnecessarily intrusive. I could also write my own groups code, this also
> seems maybe excessive.
>
> Any ideas or recommendations?
>
> Regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/20af7f07-3cbe-46a0-a968-e1562f1340ac%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1urpn7S%2B-AXw7oZifHYcJy0pzDG80PzTnguPZe-ZxcPzJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django channels group subscriptions

2017-06-01 Thread Brian May
Hello,

I would like to be able to create a Django Channels group such that:

   1. Websockets can can subscribe and unsubscribe (or disappear) to group 
   that the client specifies.
   2. When the first client subscribes to a group, it starts some process 
   (e.g. via celery task) that feeds this group with real time notifications 
   about a particular event.
   3. When the last client unsubscribes (or expires) from the group, it 
   kills the process or marks the process to self-destruct when next 
   convenient.

Step 1 is reasonable with this is groups. However not sure about 2 or 3. I 
can't see anyway with the existing groups to find out when the first client 
subscribes or the last client disappears.

I could replace/override ChannelLayer with my own code, but this seems 
unnecessarily intrusive. I could also write my own groups code, this also 
seems maybe excessive.

Any ideas or recommendations?

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20af7f07-3cbe-46a0-a968-e1562f1340ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread Melvyn Sopacua
On Thursday 01 June 2017 15:03:34 F. Nikita Thomas wrote:
> Here's the directory listing for my virtual environment:
> (projectenv) [user@echo project]$ ls -al projectenv/bin/

More important is projectenv/lib/site-packages.
But the test to do as James pointed out is to test if your virtualenv is 
correct. I'm 
missing the line where uwsgi tells you it detected a "PEP 405 virtualenv".
So, from /home/user/env/project/, with the virtual env activated:

python manage.py check

If that can't import django either, show an ls of above mentioned site-packages.

If it does work, try starting uwsgi from a different terminal tab, where the 
virtual 
environment is not activated.
If you run into "can't find settings", add --env 
DJANGO_SETTINGS_MODULE=project.settings

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2029946.9iZgSZ1Fv4%40devstation.
For more options, visit https://groups.google.com/d/optout.


Triggering events on model field change

2017-06-01 Thread Lachlan Musicman
Hola,

I have a model with a collection of BooleanFields.

When particular fields change value I'd like to trigger an event (usually
email).

A quick search shows that there are questions like this back to 09.

The two most obvious and recent solutions involve using:

 - django's from_db (
https://docs.djangoproject.com/en/1.11/ref/models/instances/#customizing-model-loading)

or
 - django-model-utils (
https://django-model-utils.readthedocs.io/en/latest/setup.html)

Model utils doesn't support 1.11 but that could just be a documentation
oversight.

What does the crowd think?

cheers
L.


--
"Mission Statement: To provide hope and inspiration for collective action,
to build collective power, to achieve collective transformation, rooted in
grief and rage but pointed towards vision and dreams."

 - Patrisse Cullors, *Black Lives Matter founder*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiND41VzsmY1vOjFdwGgWeJU6ERAdDEC-fRQnDBTqJg7DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django bugfix release: 1.11.2

2017-06-01 Thread Bernd Wechner

Any tips on how to install it? Forgive the ignorance please.

Tim Graham wrote:

Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2017/jun/01/bugfix-release/
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45ab39ab-cc38-467d-97bc-c8c39f971c8c%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a2c1ea60-8ef0-3889-5af3-e605f4341770%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
Here's the directory listing for my virtual environment:
(projectenv) [user@echo project]$ ls -al projectenv/bin/
total 84
drwxrwxr-x 3 user user  4096 Jun  1 14:28 .
drwxrwxr-x 5 user user  4096 Jun  1 14:26 ..
-rw-rw-r-- 1 user user  2095 Jun  1 14:26 activate
-rw-rw-r-- 1 user user  1037 Jun  1 14:26 activate.csh
-rw-rw-r-- 1 user user  2191 Jun  1 14:26 activate.fish
-rw-rw-r-- 1 user user  1137 Jun  1 14:26 activate_this.py
-rwxrwxr-x 1 user user   301 Jun  1 14:28 django-admin
-rwxrwxr-x 1 user user   159 Jun  1 14:28 django-admin.py
-rwxrwxr-x 1 user user   268 Jun  1 14:26 easy_install
-rwxrwxr-x 1 user user   268 Jun  1 14:26 easy_install-3.6
-rwxrwxr-x 1 user user   240 Jun  1 14:26 pip
-rwxrwxr-x 1 user user   240 Jun  1 14:26 pip3
-rwxrwxr-x 1 user user   240 Jun  1 14:26 pip3.6
drwxrwxr-x 2 user user  4096 Jun  1 14:28 __pycache__
lrwxrwxrwx 1 user user 9 Jun  1 14:26 python -> python3.6
lrwxrwxrwx 1 user user 9 Jun  1 14:26 python3 -> python3.6
-rwxrwxr-x 1 user user 17776 Jun  1 14:26 python3.6
-rwxrwxr-x 1 user user  2354 Jun  1 14:26 python-config
-rwxrwxr-x 1 user user   247 Jun  1 14:26 wheel


I followed the steps listed here :  
https://www.digitalocean.com/community/tutorials/how-to-use-mysql-or-mariadb-with-your-django-application-on-ubuntu-14-04
 

On Thursday, June 1, 2017 at 5:47:25 PM UTC-4, F. Nikita Thomas wrote:
>
> No such thing as a dumb question, how  do I check? 
>
> On Thursday, June 1, 2017 at 5:36:23 PM UTC-4, James Schneider wrote:
>>
>> *** Operational MODE: single process ***
>>> Traceback (most recent call last):
>>>   File "./project/wsgi.py", line 12, in 
>>> from django.core.wsgi import get_wsgi_application
>>> ModuleNotFoundError: No module named 'django'
>>> unable to load app 0 (mountpoint='') (callable not found or import error)
>>> *** no app loaded. going in full dynamic mode ***
>>> *** uWSGI is running in multiple interpreter mode ***
>>> spawned uWSGI worker 1 (and the only) (pid: 22388, cores: 1)
>>> ^C
>>>
>>> Shouldn't it see the Django installation in the virtualenv? I haven't 
>>> had this much fun since I had my wisdom teeth removed  Thanks again!
>>>
>>
>> Dumb question. Have you verified that Django is installed in the 
>> virtualenv being used by uwsgi? You should be able to enter the virtualenv 
>> and run that specific import command that is outlined. 
>>
>> -James 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c9a3f18-7633-437c-a899-9f84e0df5040%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
No such thing as a dumb question, how  do I check? 

On Thursday, June 1, 2017 at 5:36:23 PM UTC-4, James Schneider wrote:
>
> *** Operational MODE: single process ***
>> Traceback (most recent call last):
>>   File "./project/wsgi.py", line 12, in 
>> from django.core.wsgi import get_wsgi_application
>> ModuleNotFoundError: No module named 'django'
>> unable to load app 0 (mountpoint='') (callable not found or import error)
>> *** no app loaded. going in full dynamic mode ***
>> *** uWSGI is running in multiple interpreter mode ***
>> spawned uWSGI worker 1 (and the only) (pid: 22388, cores: 1)
>> ^C
>>
>> Shouldn't it see the Django installation in the virtualenv? I haven't had 
>> this much fun since I had my wisdom teeth removed  Thanks again!
>>
>
> Dumb question. Have you verified that Django is installed in the 
> virtualenv being used by uwsgi? You should be able to enter the virtualenv 
> and run that specific import command that is outlined. 
>
> -James 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f81ae7ad-03d6-44ea-a17d-4597bcf7f010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread James Schneider
>
> *** Operational MODE: single process ***
> Traceback (most recent call last):
>   File "./project/wsgi.py", line 12, in 
> from django.core.wsgi import get_wsgi_application
> ModuleNotFoundError: No module named 'django'
> unable to load app 0 (mountpoint='') (callable not found or import error)
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI worker 1 (and the only) (pid: 22388, cores: 1)
> ^C
>
> Shouldn't it see the Django installation in the virtualenv? I haven't had
> this much fun since I had my wisdom teeth removed  Thanks again!
>

Dumb question. Have you verified that Django is installed in the virtualenv
being used by uwsgi? You should be able to enter the virtualenv and run
that specific import command that is outlined.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciV5cmRAMNk2pAjbAL4YJ8oYKu9D%2BYqk1dHLa4wcn1e0bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModelFormset Into InlineFormset

2017-06-01 Thread James Schneider
On Thu, Jun 1, 2017 at 1:34 PM, Matthew Pava  wrote:

> Well, that took me on a path to enlightenment.  I learned quite a bit more
> about method resolution order, MRO.  On my journey, I also learned the new
> way of using super() in python 3.  I even stumbled upon type checking using
> mypy.  And I learned that there are stub files available for Django with
> mypy.
>
>
>
> Unfortunately, my CustomModelFormSet still does not work with one
> particular form/view.  It works in other form/views, though, so there’s a
> problem elsewhere to resolve.
>
>
>
> Thank you for your insight, James!  It was most helpful!
>

Good to hear! I sometimes wonder if I'm actually helping people on this
list. I've been wrong more than once. ;-)

Post up the problem view with a description of the problem in a separate
thread and maybe someone can help you out. I haven't needed to work with
form sets so I don't have any general nuggets of wisdom.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXH%2BzpXHQx5%3DYgdniqxYQJrarmwUZEghcMYNxW6BGHdwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
Hi Melvyn,
excuse the late reply. I just tried as you suggested and now I have:
(projectenv) [user@echo project]$ uwsgi --http :8000 --chdir 
/home/user/Env/project/ --module project.wsgi --virtualenv 
/home/user/Env/projectenv/
*** Starting uWSGI 2.0.15 (64bit) on [Thu Jun  1 17:09:34 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 30 May 2017 
20:50:53
os: Linux-3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017
nodename: echo.com
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/user/Env/project
detected binary path: /usr/local/bin/uwsgi
chdir() to /home/atticus/Env/project/
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4096
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 22389)
uwsgi socket 0 bound to TCP address 127.0.0.1:34994 (port auto-assigned) fd 
3
Python version: 3.6.1 (default, May 29 2017, 14:21:37)  [GCC 4.8.5 20150623 
(Red Hat 4.8.5-11)]
Set PythonHome to /home/user/Env/projectenv/
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0x76b6d0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
Traceback (most recent call last):
  File "./project/wsgi.py", line 12, in 
from django.core.wsgi import get_wsgi_application
ModuleNotFoundError: No module named 'django'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 22388, cores: 1)
^C

Shouldn't it see the Django installation in the virtualenv? I haven't had 
this much fun since I had my wisdom teeth removed  Thanks again!

On Thursday, June 1, 2017 at 2:27:28 PM UTC-4, Melvyn Sopacua wrote:
>
> On Thursday 01 June 2017 10:47:05 F. Nikita Thomas wrote:
>
> > Hi!
>
> > I'm having a problem with configuring uWSGI with Django, when I run
>
> > the development server everything 'seems' okay, except that I am
>
> > missing styling on the html, and when I test run uWSGI from the
>
> > command line I get:
>
>  
>
> ...
>
> > chdir() to /home/user/env/project/project/
>
> ...
>
>  
>
> > And I don't know whether it's a path or import thing or what. Thanks.
>
>  
>
> It's a chdir thing. Move up one, so /home/user/env/project.
>
>  
>
> -- 
>
> Melvyn Sopacua
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e083928c-3e99-4110-b4c9-c510a474e89b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: ModelFormset Into InlineFormset

2017-06-01 Thread Matthew Pava
Well, that took me on a path to enlightenment.  I learned quite a bit more 
about method resolution order, MRO.  On my journey, I also learned the new way 
of using super() in python 3.  I even stumbled upon type checking using mypy.  
And I learned that there are stub files available for Django with mypy.

Unfortunately, my CustomModelFormSet still does not work with one particular 
form/view.  It works in other form/views, though, so there’s a problem 
elsewhere to resolve.

Thank you for your insight, James!  It was most helpful!


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of James Schneider
Sent: Wednesday, May 31, 2017 6:24 PM
To: django-users@googlegroups.com
Subject: Re: ModelFormset Into InlineFormset



On Wed, May 31, 2017 at 3:13 PM, Matthew Pava 
mailto:matthew.p...@iss.com>> wrote:
I have a class CustomFormSet that inherits from BaseModelFormSet.  I would like 
to have another formset class that does everything CustomFormSet does but 
instead inherits from BaseInlineFormSet.  What is the best pythonic/Django way 
of doing that?


I would take the same approach that abstract model classes use. Collect the 
common functionality into a separate class, and mix the forms together with the 
desired inheritance hierarchy.

Since your inheritance hierarchy includes the Base*FormSet classes, your 
abstract form mixin can simply inherit from object to keep from adding 
unintended behavior.

-James

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciX9xDt3moEQPGdgy3SBt3xvPV3z3eUGun6eq%3DMSPKh_hQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d83bd1d4275c4abd921469c6271097b6%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread Melvyn Sopacua
On Thursday 01 June 2017 10:47:05 F. Nikita Thomas wrote:
> Hi!
> I'm having a problem with configuring uWSGI with Django, when I run
> the development server everything 'seems' okay, except that I am
> missing styling on the html,  and when I test run uWSGI from the
> command line I get:

...
> chdir() to /home/user/env/project/project/
...

> And I don't know whether it's a path or import thing or what. Thanks.

It's a chdir thing. Move up one, so /home/user/env/project.

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2976734.dj2r02JMKk%40devstation.
For more options, visit https://groups.google.com/d/optout.


uWSGI ModuleNotFoundError Django 1.11

2017-06-01 Thread F. Nikita Thomas
Hi!
I'm having a problem with configuring uWSGI with Django, when I run the 
development server everything 'seems' okay, except that I am missing 
styling on the html,  and when I test run uWSGI from the command line I get:

(projectenv) [user@echo project]$  uwsgi --http :8000 --chdir 
/home/user/env/project/project/ --module project.wsgi --virtualenv 
/home/user/env/projectenv/
*** Starting uWSGI 2.0.15 (64bit) on [Thu Jun  1 13:37:09 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 30 May 2017 
20:50:53
os: Linux-3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017
nodename: echo.com
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/user/env/project
detected binary path: /usr/local/bin/uwsgi
chdir() to /home/user/env/project/project/
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4096
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 22015)
uwsgi socket 0 bound to TCP address 127.0.0.1:38735 (port auto-assigned) fd 
3
Python version: 3.6.1 (default, May 29 2017, 14:21:37)  [GCC 4.8.5 20150623 
(Red Hat 4.8.5-11)]
Set PythonHome to /home/user/env/projectenv/
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0x175a660
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ModuleNotFoundError: No module named 'project'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 22014, cores: 1)


And I don't know whether it's a path or import thing or what. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a803aabc-28fa-4c64-b5f4-c4ca084d4c29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread Andrew Godwin
OK, can you try using the Redis one instead and seeing if that's faster?
Docker for Mac has a bit of an odd filesystem and kernel and it's possible
the IPCLayer is not working well underneath it.

Andrew

On Thu, Jun 1, 2017 at 10:11 AM, qnub  wrote:

> Yes, because it's dev environment with single node but with `rundelay` we
> use `asgi_ipc.IPCChannelLayer`
>
> On Thursday, June 1, 2017 at 11:03:09 PM UTC+6, Andrew Godwin wrote:
>>
>> Can I ask what channel layer you are using? That's what affects the speed
>> of messages being transported.
>>
>> Andrew
>>
>> On Thu, Jun 1, 2017 at 1:36 AM, qnub  wrote:
>>
>>> Not sure what exactly wrog here, but installing pyinotify not helps to
>>> lower CPU usage in docker on mac OS. As i understand after googling
>>> installing of `pyinotify` helps in case of running dev server with
>>> `runserver` manage command for general django configuration (without
>>> channels, but i not checked it because i need channels), but looks like
>>> it's changes nothing when you use `runserver` with `channels`.
>>>
>>> What i've made — i've created docker (using latest docker for mac)
>>> container with image ubuntu/xenial x64 to execute project. And each page
>>> (even in admin panel) loads extremely long (about couple of minutes). If i
>>> use `--noreload` option it works fast (couple of seconds or less for page
>>> load). I mean loading without cache. I've checked in docker container with
>>> `inotifywait` and looks like signals works correctly for file changes, but
>>> project works slow even with installed `pyinotify` globally and in project
>>> virtual environment.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/61650182-e93b-4a68-ade8-58c3ea18ef31%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/937cb35a-8e97-450d-9e0c-c2ce766d7e78%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1updLAHtP5xrUMKPW7h2qEe%3DM0Fk9BzBF%2B2PCa2B5hoP0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread qnub
Yes, because it's dev environment with single node but with `rundelay` we 
use `asgi_ipc.IPCChannelLayer`

On Thursday, June 1, 2017 at 11:03:09 PM UTC+6, Andrew Godwin wrote:
>
> Can I ask what channel layer you are using? That's what affects the speed 
> of messages being transported.
>
> Andrew
>
> On Thu, Jun 1, 2017 at 1:36 AM, qnub > 
> wrote:
>
>> Not sure what exactly wrog here, but installing pyinotify not helps to 
>> lower CPU usage in docker on mac OS. As i understand after googling 
>> installing of `pyinotify` helps in case of running dev server with 
>> `runserver` manage command for general django configuration (without 
>> channels, but i not checked it because i need channels), but looks like 
>> it's changes nothing when you use `runserver` with `channels`.
>>
>> What i've made — i've created docker (using latest docker for mac) 
>> container with image ubuntu/xenial x64 to execute project. And each page 
>> (even in admin panel) loads extremely long (about couple of minutes). If i 
>> use `--noreload` option it works fast (couple of seconds or less for page 
>> load). I mean loading without cache. I've checked in docker container with 
>> `inotifywait` and looks like signals works correctly for file changes, but 
>> project works slow even with installed `pyinotify` globally and in project 
>> virtual environment.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/61650182-e93b-4a68-ade8-58c3ea18ef31%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/937cb35a-8e97-450d-9e0c-c2ce766d7e78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread Andrew Godwin
Can I ask what channel layer you are using? That's what affects the speed
of messages being transported.

Andrew

On Thu, Jun 1, 2017 at 1:36 AM, qnub  wrote:

> Not sure what exactly wrog here, but installing pyinotify not helps to
> lower CPU usage in docker on mac OS. As i understand after googling
> installing of `pyinotify` helps in case of running dev server with
> `runserver` manage command for general django configuration (without
> channels, but i not checked it because i need channels), but looks like
> it's changes nothing when you use `runserver` with `channels`.
>
> What i've made — i've created docker (using latest docker for mac)
> container with image ubuntu/xenial x64 to execute project. And each page
> (even in admin panel) loads extremely long (about couple of minutes). If i
> use `--noreload` option it works fast (couple of seconds or less for page
> load). I mean loading without cache. I've checked in docker container with
> `inotifywait` and looks like signals works correctly for file changes, but
> project works slow even with installed `pyinotify` globally and in project
> virtual environment.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/61650182-e93b-4a68-ade8-58c3ea18ef31%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1urYQUcXuEA%2BHjCo8QC2A79Not0dYrVgaadU5FbVYk0A0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django bugfix release: 1.11.2

2017-06-01 Thread Tim Graham
Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2017/jun/01/bugfix-release/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45ab39ab-cc38-467d-97bc-c8c39f971c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-admin makemessages PermissionError [WindError 32] and OsError [Errno 22]

2017-06-01 Thread np
Hi,

I am using custom fabric script to make .po-files for i18n.

The problem is, "django-admin makemessages" keeps on crashing. It also 
leaves undeleted .html.py files. I can reproduce this error also by using 
plain "django-admin makemessages -l pt". 

I think this problem in Windows-specific. I am using 64-bit Windows 10, 
Django 1.11, Fabric3 1.13.1.post1, and Windows Powershell 5.1.14393.1198.

Any help would be appreciated.

Br,

np

*"Minimal working example":*
 - Crashed on third try. Sometimes it complains about "locale\django.pot" 
being used by another process, too. Fourth try worked fine.

() PS 
C:\Users\\Dropbox\\site\src\\templates\bases> 
django-admin makemessages -l pt
processing locale pt
() PS 
C:\Users\\Dropbox\\site\src\\templates\bases> 
django-admin makemessages -l pt
processing locale pt
() PS 
C:\Users\\Dropbox\\site\src\\templates\bases> 
django-admin makemessages -l pt
Traceback (most recent call last):
  File "C:\Users\\Miniconda3\Lib\runpy.py", line 184, in 
_run_module_as_main
"__main__", mod_spec)
  File "C:\Users\\Miniconda3\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File 
"C:\Python\VirtualEnv\\Scripts\django-admin.exe\__main__.py", 
line 9, in 
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\__init__.py",
 
line 363, in execute_from_command_line
utility.execute()
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\__init__.py",
 
line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\base.py",
 
line 283, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\base.py",
 
line 330, in execute
output = self.handle(*args, **options)
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 360, in handle
potfiles = self.build_potfiles()
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 402, in build_potfiles
self.process_files(file_list)
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 499, in process_files
self.process_locale_dir(locale_dir, files)
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 594, in process_locale_dir
build_file.cleanup()
  File 
"c:\python\virtualenv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 157, in cleanup
os.unlink(self.work_path)
PermissionError: [WinError 32] The process cannot access the file because 
it is being used by another process: '.\\base.html.py'
() PS 
C:\Users\\Dropbox\\site\src\\templates\bases>

*Real-usage example*

*Fabric code:*
def translate(appfolder=None):
"""
Use django-admin makemessages to make .po files

INPUTS:
folder: pathlib.Path object for the folder where to start.
Used for recursion. (in normal usage, no 'folder' parameter
is provided.)
"""
forbidden = ('__pycache__', 'migrations', 'locale', 'utils', 'static')
if not appfolder:
appfolder = Path(__file__).parent.parent / ''
for item in appfolder.iterdir():
if item.is_dir() and (item.name not in forbidden):
if not (item / 'locale').exists():
(item / 'locale').mkdir()
print('Created {}'.format(str((item / 'locale'
print('Running makemessages in {}'.format(str(item)))
os.chdir(str(item))

os.system("python {django_admin} makemessages -l fi".format(
django_admin = django_admin
))

translate(appfolder=item)

*Traceback:*
- Some files before and after these errors did not produce any errors.

Running makemessages in 
C:\Users\\Dropbox\\site\src\\templates
Traceback (most recent call last):
  File "C:\Python\VirtualEnv\\Scripts\django-admin.py", line 5, 
in 
management.execute_from_command_line()
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\__init__.py",
 
line 363, in execute_from_command_line
utility.execute()
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\__init__.py",
 
line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\base.py",
 
line 283, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\base.py",
 
line 330, in execute
output = self.handle(*args, **options)
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line 360, in handle
potfiles = self.build_potfiles()
  File 
"C:\Python\VirtualEnv\\lib\site-packages\django\core\management\commands\makemessages.py",
 
line

Possible bug - Incorrect escaping in Django SQL query

2017-06-01 Thread Roshan Raghupathy
Hi,
I came across an issue yesterday. Post on stackoverflow 


On further investigation today, I think I found the source of the issue. 
It's this line 
.
 
The parameters which are escaped here are never reverted back to the 
original form.
I tested a dirty fix by converting all '%%s' to '%s' and the query worked. 
Should I submit a bug? Has it been submitted already?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aa6fee76-1d7f-4b17-a540-4384ca23e595%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: duplicate key value violates unique constraint "django_admin_log_pkey"

2017-06-01 Thread Tech-Harvester
Helped me too. Thanks.

On Thursday, October 14, 2010 at 8:54:30 PM UTC+5:30, 
glob...@iamsandiego.com wrote:
>
> Hi Folks, 
>
> After updating a postgres db for my django app Iam getting this error 
> when I try and save new data to the db: 
>
> Request Method:  POST 
> Request URL: http://10.50.253.200/admin/survey/gps/add/ 
> Django Version: 1.2 beta 1 
> Exception Type: IntegrityError 
> Exception Value: 
>
> duplicate key value violates unique constraint "django_admin_log_pkey" 
>
> Is there any way to correct this? 
>
> Thanks 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1245de5c-d8fb-4930-a6f2-a273b2d38739%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pyinotify and runserver performance with django channels in docker for mac

2017-06-01 Thread qnub
Not sure what exactly wrog here, but installing pyinotify not helps to 
lower CPU usage in docker on mac OS. As i understand after googling 
installing of `pyinotify` helps in case of running dev server with 
`runserver` manage command for general django configuration (without 
channels, but i not checked it because i need channels), but looks like 
it's changes nothing when you use `runserver` with `channels`.

What i've made — i've created docker (using latest docker for mac) 
container with image ubuntu/xenial x64 to execute project. And each page 
(even in admin panel) loads extremely long (about couple of minutes). If i 
use `--noreload` option it works fast (couple of seconds or less for page 
load). I mean loading without cache. I've checked in docker container with 
`inotifywait` and looks like signals works correctly for file changes, but 
project works slow even with installed `pyinotify` globally and in project 
virtual environment.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61650182-e93b-4a68-ade8-58c3ea18ef31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to swap 1.8 and 1.10/1.11 Admin static files

2017-06-01 Thread Melvyn Sopacua
On Wednesday 31 May 2017 12:15:31 Mike Dewhirst wrote:
> Haven't actually communicated our decision but I'll just see if they
> are willing to fund the development involved in staying on an
> out-of-date and soon-to-be-unsupported system we'll hire someone to
> do that.
> 
> I think.
> 
> Haven't done any research on best practice in this area. Happy to let
> you know what happens ;)

I would start with the financials involved. Then provide two alternatives:
1) Address the usibility concerns he has, using template overrides.
2) Opt to install a completely different, well-maintained admin theme free of 
charge. 
It is less annoying to start fresh, then to adjust to slightly different 
placement / look 
of something that looks like the old. The latter triggers muscle memory that no 
longer works.

-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2157342.3mq4l4VrL2%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: django.db.utils.OperationalError: server closed the connection unexpectedly

2017-06-01 Thread Bobby Paul
Thank you Antonis,
Yeah, We have installed postgresql-8.4.20-7.el6.x86_64

Now we are checking the permission. Will touch you once it done.

Thanks,

Bobby Paul
On Wednesday, May 31, 2017 at 5:14:29 PM UTC+5:30, Bobby Paul wrote:
>
> Dear All,
>
> I am getting this error message while trying to install psql database.
>
>  File "setup.py", line 18, in 
> execute_from_command_line(['manage.py','migrate'])
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 354, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 346, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/core/management/base.py", 
> line 394, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/core/management/base.py", 
> line 445, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
>  
> line 93, in handle
> executor = MigrationExecutor(connection, 
> self.migration_progress_callback)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/executor.py",
>  
> line 19, in __init__
> self.loader = MigrationLoader(self.connection)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/loader.py", 
> line 47, in __init__
> self.build_graph()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/loader.py", 
> line 191, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 59, in applied_migrations
> self.ensure_schema()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 49, in ensure_schema
> if self.Migration._meta.db_table in 
> self.connection.introspection.table_names(self.connection.cursor()):
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", 
> line 162, in cursor
> cursor = self.make_debug_cursor(self._cursor())
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", 
> line 135, in _cursor
> self.ensure_connection()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", 
> line 130, in ensure_connection
> self.connect()
>   File "/usr/local/bin/lib/python2.7/site-packages/django/db/utils.py", 
> line 98, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", 
> line 130, in ensure_connection
> self.connect()
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", 
> line 119, in connect
> self.connection = self.get_new_connection(conn_params)
>   File 
> "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py",
>  
> line 176, in get_new_connection
> connection = Database.connect(**conn_params)
>   File "/usr/local/bin/lib/python2.7/site-packages/psycopg2/__init__.py", 
> line 130, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> ==
> DATABASES_DEFAULT = {
>
> 'ENGINE': 'django.db.backends.postgresql_psycopg2',
> 'NAME': 'litdb',
> 'USER': 'root',
> 'PASSWORD': '',
> 'HOST': 'localhost',
> 'PORT': '80',
> }
>
> How to sort this issue?
>
> Kind Regards
> Bobby Paul
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/92514ce1-503c-4904-8da7-857dd70e10cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: count from multiple tables in a single query?

2017-06-01 Thread Melvyn Sopacua
On Wednesday 31 May 2017 12:13:48 'Abraham Varricatt' via Django users 
wrote:

> If I want to get the total count from both tables it can be done like
> this,
> 
> author_count = Author.objects.count()
> publisher_count = Publisher.objects.count()
> 
> My concern is that this results in two different queries to the
> database. Can it be done with a single query call?

Why is that a concern? This isn't the kind of thing to optimize. Query 
optimization is about loops and relations. Not about getting information 
you need - it comes at a price. Have you timed what you could save?
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3906536.yyyTSluoAH%40devstation.
For more options, visit https://groups.google.com/d/optout.