Re: Django Channels, Nginx, Daphne - Not working?

2017-05-03 Thread Andrew Godwin
Well, if daphne is serving you webpages, then the channel layer is working
fine (everything goes over it, including HTTP). However, if you are just
using Daphne for websockets, then it may not be working at all - which is
the case? And are the worker and daphne processes running on the same
machine?

Andrew

-- 
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/CAFwN1uoAA5UKGzvqXkyf_psDH6jv%3D5_VpJj-Jc6-2eHxBPws_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I access obj in admin.py

2017-05-03 Thread Stephen J. Butler
You want to override get_inline_instances:
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inline_instances

On Wed, May 3, 2017 at 12:33 AM, Mike Dewhirst 
wrote:

> I want to adjust inlines based on a property of the object.
>
> class SubstanceAdmin(admin.ModelAdmin):
>
> class SolidInline(admin.StackedInline):
> pass
> class LiquidInline(admin.StackedInline):
> pass
> class GasInline(admin.StackedInline):
> pass
>
> inlines = get_inlines
>
> def get_inlines(self):
> obj = how_do_I_get_this(?)
> if obj.physical_state = None:
> return ((SolidInline), (LiquidInline), (GasInline))
> elif obj.physical_state = 1:
> return ((SolidInline), )
> elif obj.physical_state = 2:
> return ((LiquidInline), )
> elif obj.physical_state = 3:
> return ((GasInline), )
>
> Many thanks for a miracle :)
>
> Mike
>
> --
> 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/ms
> gid/django-users/a138bd6c-46fb-98c7-ba28-69a5959e5fbc%40dewhirst.com.au.
> 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/CAD4ANxWWNxfDSCGUm8GFR_ijGL2WZAC%2Bwz3NCwpA%3DyHyALfWZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: port 80 **** Hit EOF while fetching headers

2017-05-03 Thread James Schneider
Our server has 24 Cores and 192G memory, should be big enough to handle
this kind of load? BTW, one more thing I want to mention is that we are
using host based docker, possible any config or limitation there?


While I'm not familiar with your particular error, it's possible that your
problem is in one of these areas:

1. Your web server is threaded, but your code is not thread safe, and
you're hitting a race condition. The object you are expecting to exist has
been unexpectedly modified or deleted by another thread. Can't comment
further without knowledge of your underlying setup, code, etc.
Alternatively, a file being read/written is modified/removed by a different
process/thread.

2. Your underlying web server is not tuned to utilize the hardware you've
mentioned. A typical Apache install will not spawn enough workers or
threads to use that much horsepower. If your processor, disk, and RAM are
not pegged (or close to), you aren't getting the bang for your buck that
you thought with a large server (or you may not have enough load to tax it).

3. Your database may be congested, causing the Django calls to run slowly,
possibly resulting in timeouts. Check the DB logs for over-subscription.

4. There may also be errant clients who are sending incomplete requests, or
potentially port scanning where no headers are sent, and you are actually
seeing a false-positive log.

Otherwise, you'll need to determine whether the error is coming from Apache
receiving headers from the client, or if it is having issues with Django
sending the needed headers back to Apache.

-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%2BciVT7FiZs6pabj0A03bPL3fThofebUJ_APuxeDFFou3j%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django with generic odbc database

2017-05-03 Thread Diego Gazzo
Good morning,
In the Company i'm working on, we are currently using an Enterprise 
database called ADABAS (Software AG product). 
This database expose a standard ODBC interface.
My question: is there a way to call a generic odbc database from django?
We found the django-pyodbc but seem to be available only for MSSQL, IBM DB2 
or Azure. 
Thanks for your feedback and Kind regards
Diego Gazzo

-- 
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/c8c87780-8737-4bc9-81f2-742e1f8966c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django authentication security check against LDAP

2017-05-03 Thread Uzair Tariq
While studying the Authentication Views in Django I came across some of the 
build in views including password reset view. I got hang of its basic 
working mechanism while reading the documentation I encountered the line 
promoting the use of *set_unusable_password()* in Djagno authentication 
against *LDAP networks*. I googled and found some of the useful links 
defining LDAP networks e.g. 
 but 
I was not able to understand the possible vulnerabilities to the LDAP 
authentication system that may arise when the set_unusable_password flag is 
not set and the system is requested a password change request. Basically 
what I am trying to ask is what kind of misuse can occur in case of LDAP 
authentication and set_unusable_function not being used as said in the 
following context of the password reset view in Django. Can anyone please 
kindly highlight some of the misuses I will be really grateful. The Link 

 to 
the topic is here and *Method Link 
*.
 
Thanks in *Advance*.

-- 
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/04815d24-898b-4e03-b50d-24cac2094942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django with generic odbc database

2017-05-03 Thread Jani Tiainen
As long as there exists Python DB-API for your database (maybe there is 
some generic odbc driver) you can use it.


Of course you won't be able to use Django ORM with it.


On 03.05.2017 11:18, Diego Gazzo wrote:

Good morning,
In the Company i'm working on, we are currently using an Enterprise 
database called ADABAS (Software AG product).

This database expose a standard ODBC interface.
My question: is there a way to call a generic odbc database from django?
We found the django-pyodbc but seem to be available only for MSSQL, 
IBM DB2 or Azure.

Thanks for your feedback and Kind regards
Diego Gazzo
--
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/c8c87780-8737-4bc9-81f2-742e1f8966c1%40googlegroups.com 
.

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


--
Jani Tiainen

--
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/bc874c82-ce12-6bfd-cc4a-abb05c4d88d4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Link to download

2017-05-03 Thread Sixtine Vernhes
It's work with the use of media :) 
Thanks for the help ! 

Le mardi 2 mai 2017 18:13:01 UTC+2, Antonis Christofides a écrit :
>
> You cannot get a file outside of your project unless you symlink it inside 
> the project. This is also a Very Bad Thing(TM) as it may allow attackers to 
> request arbitrary files.
>
> You *can* get a file outside your project. Whether this is a bad thing or 
> not depends on why and how. I also don't think this file should be placed 
> in the static directory. The static directory is for files that don't 
> change after the program is installed. The media directory might be more 
> appropriate.
>
> If what you are doing is to dynamically create a csv file for your user to 
> download immediately, one possible way of doing that is (untested):
>
> from tempfile import TemporaryFile
> csvfile = TemporaryFile()
> export_your_data_to_the_file(csvfile)
> file_size = csvfile.tell()
> csvfile.seek(0)
> response = HttpResponse(csvfile.read(), content_type='text/csv')
> response['Content-Disposition'] = 'attachment; filename=whateveryoulike.csv'
> response['Content-Length'] = str(size)
> return response
>
> Regards,
>
> A.
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2017-05-02 17:53, m712 - Developer wrote:
>
> You cannot get a file outside of your project unless you symlink it inside 
> the project. This is also a Very Bad Thing(TM) as it may allow attackers to 
> request arbitrary files.
> What you should do instead is this:
> 1) Put Data/01/export.txt to the static/ folder inside your app (with the 
> same folder structure if you need it that way)
> 2) Build the path to your file with /static/ as prefix, i.e. 
> http://127.0.0.1/static/Data/01/export.txt
> On May 2, 2017 3:44 PM, Sixtine Vernhes   
> wrote:
>
> This is in development. I try to send url of my file in views.py : 
>
>  return render(request, "export.html", {'out': urlOut})
>
> and in my template I have the link : 
>
> Lien du  fichier 
>
> but when I open it I have this link : 
>
> http://127.0.0.1:8000/home/myuser/Data/01/export.txt 
>
> and I want to have this to download the file : 
> /home/myuser/Data/01/export.txt 
>
> Have you any ideas? 
>
> (sorry i'm newbie in django ^^)
>
> Le mardi 2 mai 2017 14:04:05 UTC+2, Antonis Christofides a écrit : 
>>
>> Is this in production or development? What is the url that doesn't work? 
>> What happens when you try the url?
>>
>> Regards,
>>
>> A.
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>> On 2017-05-02 11:28, Sixtine Vernhes wrote:
>>
>> Hi ! 
>>
>> I try to create a link on Django who download a static csv file, but I 
>> have no idea how to do. 
>> In my settings.py :
>>
>> STATIC_URL = '/static/'
>> STATICFILES_DIRS = (
>> os.path.join(BASE_DIR, "static/"),
>> )
>>
>> and my file is in this directory 
>>
>> Would anyone have an idea ? 
>>
>>  -- 
>> 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.
>>
>> -- 
>> 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/j5ftp2xrd2aps3c4mtn66umn.1493736693783%40email.android.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/e12184ad-37ca-446b-83aa-25f4d4ae94a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pass context to overridden templates

2017-05-03 Thread cjdcordeiro
Probably the best would be overriding the app's default class based view, 
but when I look at it 
(https://github.com/django-notifications/django-notifications/blob/master/notifications/views.py#L29)
 
it doesn't have a get_context method or anything I can play with to change 
the default context

ideas? anyone?

On Wednesday, May 3, 2017 at 12:48:42 AM UTC+2, cjdcordeiro wrote:
>
> Hi guys,
>
> I'm using django-notification-hq, so my app's urls.py has:
>
> ...
>url(r'^inbox/', include(notifications.urls, namespace='notifications'
> )),
> ...
>
>
> I've modified those default templates but I am unable to pass context to 
> them. 
>
> I found this: 
> https://github.com/django-crispy-forms/django-crispy-forms/issues/646
>
> It isn't old so I'm afraid this is yet not possible? Any workarounds?
>
> Cheers,
> Cris
>

-- 
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/9d857382-a5a9-4047-93fb-3d688611e5c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to include template

2017-05-03 Thread Thiago Luiz Parolin
I have a project that has a folder structure like this:

Project1 /
--Templates /
Base.html
Error.html
--App1
Templates /
--App1 /
App1.html

How can i include error.html in app1.html?

I am trying using {% include "../../../templates/error.html"%} but get
error on page rendering:

The relative path '"../../../templates/error.html"' points outside the file
hierarchy that template 'app1 / app1.html' is in.


I am totally new to django, python and programming.
Any help will be appreciated.

-- 
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/CACTnJ003Gp27c0g82dzXnLkGcusGgnKVKwijtXZV7EvL3doVAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to include template

2017-05-03 Thread Dartos
Hi,

You need to set the template directories option in your project's settings 
file.

See here:
https://docs.djangoproject.com/en/1.11/topics/templates/#configuration

There's an example in the above link:

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
'/home/html/example.com',
'/home/html/default',
],
},
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': [
'/home/html/jinja2',
],
},
]


Once Django is aware of where to search for templates, you can include 
templates from your project's templates directory as follows:
{% include "Error.html" %}

And you can include app templates as follows:
{% include "App1/App1.html" %}



Also, pay attention to capitalization of filenames, as "Error.html" and 
"error.html" are different files on many systems. I use all-lowercase to 
avoid issues.

Dartos

On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>
> I have a project that has a folder structure like this:
>
> Project1 /
> --Templates /
> Base.html
> Error.html
> --App1
> Templates /
> --App1 /
> App1.html
>
> How can i include error.html in app1.html?
>
> I am trying using {% include "../../../templates/error.html"%} but get 
> error on page rendering:
>
> The relative path '"../../../templates/error.html"' points outside the 
> file hierarchy that template 'app1 / app1.html' is in.
>
>
> I am totally new to django, python and programming.
> Any help will be appreciated.
>

On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>
> I have a project that has a folder structure like this:
>
> Project1 /
> --Templates /
> Base.html
> Error.html
> --App1
> Templates /
> --App1 /
> App1.html
>
> How can i include error.html in app1.html?
>
> I am trying using {% include "../../../templates/error.html"%} but get 
> error on page rendering:
>
> The relative path '"../../../templates/error.html"' points outside the 
> file hierarchy that template 'app1 / app1.html' is in.
>
>
> I am totally new to django, python and programming.
> Any help will be appreciated.
>

On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>
> I have a project that has a folder structure like this:
>
> Project1 /
> --Templates /
> Base.html
> Error.html
> --App1
> Templates /
> --App1 /
> App1.html
>
> How can i include error.html in app1.html?
>
> I am trying using {% include "../../../templates/error.html"%} but get 
> error on page rendering:
>
> The relative path '"../../../templates/error.html"' points outside the 
> file hierarchy that template 'app1 / app1.html' is in.
>
>
> I am totally new to django, python and programming.
> Any help will be appreciated.
>

On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>
> I have a project that has a folder structure like this:
>
> Project1 /
> --Templates /
> Base.html
> Error.html
> --App1
> Templates /
> --App1 /
> App1.html
>
> How can i include error.html in app1.html?
>
> I am trying using {% include "../../../templates/error.html"%} but get 
> error on page rendering:
>
> The relative path '"../../../templates/error.html"' points outside the 
> file hierarchy that template 'app1 / app1.html' is in.
>
>
> I am totally new to django, python and programming.
> Any help will be appreciated.
>

On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>
> I have a project that has a folder structure like this:
>
> Project1 /
> --Templates /
> Base.html
> Error.html
> --App1
> Templates /
> --App1 /
> App1.html
>
> How can i include error.html in app1.html?
>
> I am trying using {% include "../../../templates/error.html"%} but get 
> error on page rendering:
>
> The relative path '"../../../templates/error.html"' points outside the 
> file hierarchy that template 'app1 / app1.html' is in.
>
>
> I am totally new to django, python and programming.
> Any help will be appreciated.
>

-- 
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/a61f65d2-5506-4750-a0c6-eb1be9663211%40googlegroups.com.
For more options, visit https://groups.google.c

Re: Django Channels, Nginx, Daphne - Not working?

2017-05-03 Thread Alex Elson
I am trying to only use Daphne for websockets  I believe, following the 
deployment tutorial in the Channel documentation. And yes I am running both 
processes on the same machine. 

-- 
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/75ecc3b4-1564-47a3-bcf9-e7926e05a290%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels, Nginx, Daphne - Not working?

2017-05-03 Thread Alex Elson
Here is my nginx default configuration if that could be it.

server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;
charset utf-8;

index index.html index.htm index.nginx-debian.html;

server_name _;

location / {

proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
try_files $uri $uri/ =404;
}
}

-- 
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/75667dd1-2d00-494c-997c-e6754b46b633%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django with generic odbc database

2017-05-03 Thread JHeasly
I've had a good experience with the mxODBC Django Database Engine 
. (The web page says 
you can use the ORM, but elsewhere it clarifies that's only if you're using 
MS SQL Server 2005, 2008 and 2012.) But as Jani says, you do have to do all 
the querying, updating in raw SQL.

 — John

-- 
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/983eb4a3-636e-409b-bbca-e929e06720f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to include template

2017-05-03 Thread Thiago Luiz Parolin
Thank you...
All is working now
i was seeing in the wrong page of documentation..


2017-05-03 12:01 GMT-03:00 Dartos :

> Hi,
>
> You need to set the template directories option in your project's settings
> file.
>
> See here:
> https://docs.djangoproject.com/en/1.11/topics/templates/#configuration
>
> There's an example in the above link:
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [
> '/home/html/example.com',
> '/home/html/default',
> ],
> },
> {
> 'BACKEND': 'django.template.backends.jinja2.Jinja2',
> 'DIRS': [
> '/home/html/jinja2',
> ],
> },
> ]
>
>
> Once Django is aware of where to search for templates, you can include
> templates from your project's templates directory as follows:
> {% include "Error.html" %}
>
> And you can include app templates as follows:
> {% include "App1/App1.html" %}
>
>
>
> Also, pay attention to capitalization of filenames, as "Error.html" and
> "error.html" are different files on many systems. I use all-lowercase to
> avoid issues.
>
> Dartos
>
>
> On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>>
>> I have a project that has a folder structure like this:
>>
>> Project1 /
>> --Templates /
>> Base.html
>> Error.html
>> --App1
>> Templates /
>> --App1 /
>> App1.html
>>
>> How can i include error.html in app1.html?
>>
>> I am trying using {% include "../../../templates/error.html"%} but get
>> error on page rendering:
>>
>> The relative path '"../../../templates/error.html"' points outside the
>> file hierarchy that template 'app1 / app1.html' is in.
>>
>>
>> I am totally new to django, python and programming.
>> Any help will be appreciated.
>>
>
> On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>>
>> I have a project that has a folder structure like this:
>>
>> Project1 /
>> --Templates /
>> Base.html
>> Error.html
>> --App1
>> Templates /
>> --App1 /
>> App1.html
>>
>> How can i include error.html in app1.html?
>>
>> I am trying using {% include "../../../templates/error.html"%} but get
>> error on page rendering:
>>
>> The relative path '"../../../templates/error.html"' points outside the
>> file hierarchy that template 'app1 / app1.html' is in.
>>
>>
>> I am totally new to django, python and programming.
>> Any help will be appreciated.
>>
>
> On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>>
>> I have a project that has a folder structure like this:
>>
>> Project1 /
>> --Templates /
>> Base.html
>> Error.html
>> --App1
>> Templates /
>> --App1 /
>> App1.html
>>
>> How can i include error.html in app1.html?
>>
>> I am trying using {% include "../../../templates/error.html"%} but get
>> error on page rendering:
>>
>> The relative path '"../../../templates/error.html"' points outside the
>> file hierarchy that template 'app1 / app1.html' is in.
>>
>>
>> I am totally new to django, python and programming.
>> Any help will be appreciated.
>>
>
> On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>>
>> I have a project that has a folder structure like this:
>>
>> Project1 /
>> --Templates /
>> Base.html
>> Error.html
>> --App1
>> Templates /
>> --App1 /
>> App1.html
>>
>> How can i include error.html in app1.html?
>>
>> I am trying using {% include "../../../templates/error.html"%} but get
>> error on page rendering:
>>
>> The relative path '"../../../templates/error.html"' points outside the
>> file hierarchy that template 'app1 / app1.html' is in.
>>
>>
>> I am totally new to django, python and programming.
>> Any help will be appreciated.
>>
>
> On Wednesday, May 3, 2017 at 10:00:37 AM UTC-4, Thiago Luiz Parolin wrote:
>>
>> I have a project that has a folder structure like this:
>>
>> Project1 /
>> --Templates /
>> Base.html
>> Error.html
>> --App1
>> Templates /
>> --App1 /
>> App1.html
>>
>> How can i include error.html in app1.html?
>>
>> I am trying using {% include "../../../templates/error.html"%} but get
>> error on page rendering:
>>
>> The relative path '"../../../templates/error.html"' points outside the
>> file hierarchy that template 'app1 / app1.html' is in.
>>
>>
>> I am totally new to django, python and programming.
>> Any help will be appreciated.
>>
> --
> 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.
> 

Re: Link to download

2017-05-03 Thread Tim Chase
On 2017-05-02 19:11, Antonis Christofides wrote:
> response = HttpResponse(csvfile.read(), content_type='text/csv')

Beware that, if your content can get huge (some of our reports can
run to hundreds of megabytes), you might want to investigate
something like the "sendfile" alternatives or spew it out as generator
instead of doing .read() to suck the whole thing into memory.

-tkc



-- 
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/20170503133519.05365d67%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


Re: Link to download

2017-05-03 Thread Dan Tagg
You might want to check out WhiteNoise (
https://whitenoise.readthedocs.io/en/stable/) perhaps in conjunction with a
CDN

On 3 May 2017 at 19:35, Tim Chase  wrote:

> On 2017-05-02 19:11, Antonis Christofides wrote:
> > response = HttpResponse(csvfile.read(), content_type='text/csv')
>
> Beware that, if your content can get huge (some of our reports can
> run to hundreds of megabytes), you might want to investigate
> something like the "sendfile" alternatives or spew it out as generator
> instead of doing .read() to suck the whole thing into memory.
>
> -tkc
>
>
>
> --
> 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/20170503133519.05365d67%40bigbox.christie.dr.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Wildman and Herring Limited, Registered Office: Sir Robert Peel House, 178
Bishopsgate, London, United Kingdom, EC2M 4NJ, Company no: 05766374

-- 
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/CAPZHCY5FnmudhJSV5k2FBptiK1EdGk1%3D7vhyXicbJZf1uD3j3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Channels] Recommended quantity of workers

2017-05-03 Thread Renato Oliveira
Hi

Is there any recommendation on how many `runworker` processes should we run
on production?

I'm having many 403 responses on frontend and ChannelFull on backend. Saw
here on the mailing list that adding new workers might help. Indeed it
helped, tested already with 10 for now, but would like to know if there is
any side effect doing this.

Thanks!


Renato Oliveira

Co-founder & Software Engineer

+55 81 987855061
www.labcodes.com.br

-- 
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/CAGPLouWycQAfpJDAimYbxTUcoZkNMx3RGDgGf3FheHSyZYQ6yQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Channels] Recommended quantity of workers

2017-05-03 Thread Andrew Godwin
The number you need depends on the kind of site you have and the type of
traffic - much like "how many WSGI servers should I run?" there is no right
answer. You'll need to look at how different numbers of workers affect your
median response times and number of timeouts and adjust appropriately.

There is no downside to running multiple workers, though; in fact, it's
encouraged.

Andrew

On Wed, May 3, 2017 at 12:45 PM, Renato Oliveira <
renatooliveira@gmail.com> wrote:

> Hi
>
> Is there any recommendation on how many `runworker` processes should we
> run on production?
>
> I'm having many 403 responses on frontend and ChannelFull on backend. Saw
> here on the mailing list that adding new workers might help. Indeed it
> helped, tested already with 10 for now, but would like to know if there is
> any side effect doing this.
>
> Thanks!
>
>
> Renato Oliveira
>
> Co-founder & Software Engineer
>
> +55 81 987855061
> www.labcodes.com.br
>
> --
> 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/CAGPLouWycQAfpJDAimYbxTUcoZkNM
> x3RGDgGf3FheHSyZYQ6yQ%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/CAFwN1up6_56kxBFJ-p3b2Enz5nP-MiDxsQB0%2BeNi9phrNsmrbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Channels] Recommended quantity of workers

2017-05-03 Thread Renato Oliveira
Andrew*



Renato Oliveira

Co-founder & Software Engineer

+55 81 987855061
www.labcodes.com.br


On Wed, May 3, 2017 at 5:09 PM, Renato Oliveira <
renatooliveira@gmail.com> wrote:

> Thanks Andrews!
>
> Also thanks for your hard work on channels! Awesome piece of software.
>
>
>
>
>
> Renato Oliveira
>
> Co-founder & Software Engineer
>
> +55 81 987855061 <(81)%2098785-5061>
> www.labcodes.com.br
>
>
> On Wed, May 3, 2017 at 5:06 PM, Andrew Godwin  wrote:
>
>> The number you need depends on the kind of site you have and the type of
>> traffic - much like "how many WSGI servers should I run?" there is no right
>> answer. You'll need to look at how different numbers of workers affect your
>> median response times and number of timeouts and adjust appropriately.
>>
>> There is no downside to running multiple workers, though; in fact, it's
>> encouraged.
>>
>> Andrew
>>
>> On Wed, May 3, 2017 at 12:45 PM, Renato Oliveira <
>> renatooliveira@gmail.com> wrote:
>>
>>> Hi
>>>
>>> Is there any recommendation on how many `runworker` processes should we
>>> run on production?
>>>
>>> I'm having many 403 responses on frontend and ChannelFull on backend.
>>> Saw here on the mailing list that adding new workers might help. Indeed it
>>> helped, tested already with 10 for now, but would like to know if there is
>>> any side effect doing this.
>>>
>>> Thanks!
>>>
>>>
>>> Renato Oliveira
>>>
>>> Co-founder & Software Engineer
>>>
>>> +55 81 987855061 <(81)%2098785-5061>
>>> www.labcodes.com.br
>>>
>>> --
>>> 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/ms
>>> gid/django-users/CAGPLouWycQAfpJDAimYbxTUcoZkNMx3RGDgGf3FheH
>>> SyZYQ6yQ%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/ms
>> gid/django-users/CAFwN1up6_56kxBFJ-p3b2Enz5nP-MiDxsQB0%2BeNi
>> 9phrNsmrbA%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/CAGPLouVRDM9AzHZNggCUN3toFfaHv9%2B3wfFTkv1qdMTyzXwegQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Channels] Recommended quantity of workers

2017-05-03 Thread Renato Oliveira
Thanks Andrews!

Also thanks for your hard work on channels! Awesome piece of software.





Renato Oliveira

Co-founder & Software Engineer

+55 81 987855061
www.labcodes.com.br


On Wed, May 3, 2017 at 5:06 PM, Andrew Godwin  wrote:

> The number you need depends on the kind of site you have and the type of
> traffic - much like "how many WSGI servers should I run?" there is no right
> answer. You'll need to look at how different numbers of workers affect your
> median response times and number of timeouts and adjust appropriately.
>
> There is no downside to running multiple workers, though; in fact, it's
> encouraged.
>
> Andrew
>
> On Wed, May 3, 2017 at 12:45 PM, Renato Oliveira <
> renatooliveira@gmail.com> wrote:
>
>> Hi
>>
>> Is there any recommendation on how many `runworker` processes should we
>> run on production?
>>
>> I'm having many 403 responses on frontend and ChannelFull on backend. Saw
>> here on the mailing list that adding new workers might help. Indeed it
>> helped, tested already with 10 for now, but would like to know if there is
>> any side effect doing this.
>>
>> Thanks!
>>
>>
>> Renato Oliveira
>>
>> Co-founder & Software Engineer
>>
>> +55 81 987855061 <(81)%2098785-5061>
>> www.labcodes.com.br
>>
>> --
>> 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/ms
>> gid/django-users/CAGPLouWycQAfpJDAimYbxTUcoZkNMx3RGDgGf3FheH
>> SyZYQ6yQ%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/CAFwN1up6_56kxBFJ-p3b2Enz5nP-MiDxsQB0%
> 2BeNi9phrNsmrbA%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/CAGPLouVQBgSX2QFJSJFpnnM9SS_rZQ_jpsE6rUoKHci3%3Ddm4Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Channels] Recommended quantity of workers

2017-05-03 Thread James Schneider
Is there any recommendation on how many `runworker` processes should we run
on production?


There is no real guideline to provide. The "correct" number is a function
of hardware, traffic, and the amount of processing needed to fulfill
requests. That number may change over time as the app is further developed.

Increase the number of available processes/threads across some amount of
time (perhaps a few days or a week to account for bursts). Be sure to
monitor CPU, RAM, and disk I/O. If any of those reach 100% utilization
during regular operation (or your response times drop), back it off
slightly to account for bursts. Keep in mind that you may also need to tune
the number of database listeners or connections, and/or RAM allocated to
the DB cache, etc. Other dependent pieces of your infrastructure may need
modification as well, such as caches.



I'm having many 403 responses on frontend and ChannelFull on backend. Saw
here on the mailing list that adding new workers might help. Indeed it
helped, tested already with 10 for now, but would like to know if there is
any side effect doing this.


No bad side effects until you exceed RAM, CPU, or disk limits. In many
cases, your DB is the bottleneck, so be sure to tune those settings along
with the web service processes.

It's a bit strange to receive a 403, since that generally has to do with
authorization, and not operational issues. Seems like a 5XX error would be
more appropriate for a ChannelFull situation, but that may be just the way
it works.

-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%2BciXxUXCF0U7qesTevk6wv1q1owOnRxbKCFWLTDswrZddHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error was: cannot import name 'GDALRaster in Window 8.1

2017-05-03 Thread Prashant Verma
Hey Mate, 

I am trying to get over by this error. Although, It's little complicated 
to work in the windows environment. 
By the way, I am trying to follow this process 
https://libregis.org/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/,
 
however, I am stuck at the raster2pgsql process. 

After run this code : "raster2pgsql.py -r image.tif -t tablename -o 
image.sql" 

It has thrown an Error: Could not process -t. 

After that change code : raster2pgsql -s 4236 -I -C -M *.tif -F -t 100x100 
public.demelevation > elev.sql 

Error : ERROR: Unable to read raster file: *.tif

Can you please me with? Or should I change my windows environment to ubuntu?

On Monday, 1 May 2017 22:43:23 UTC+5:30, Tim Graham wrote:
>
> It looks like GDAL isn't installed on your system.
>
> Looking at 
> https://docs.djangoproject.com/en/stable/ref/contrib/gis/install/#spatial-database,
>  
> I believe it's a required dependency -- perhaps we should try to improve 
> the error message.
>
> On Sunday, April 30, 2017 at 10:20:01 AM UTC-4, Prashant Verma wrote:
>>
>> C:\User\.\Desktop\Geolocation>*python manage.py makemigrations*
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\utils.py",
>>  
>> line 115, in load_backend
>> return import_module('%s.base' % backend_name)
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
>>  
>> line 126, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 978, in _gcd_import
>>   File "", line 961, in _find_and_load
>>   File "", line 950, in 
>> _find_and_load_unlocked
>>   File "", line 655, in _load_unlocked
>>   File "", line 677, in exec_module
>>   File "", line 205, in 
>> _call_with_frames_removed
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\base.py",
>>  
>> line 7, in 
>> from .operations import PostGISOperations
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\gis\db\backends\postgis\operations.py",
>>  
>> line 7, in 
>> from django.contrib.gis.gdal import GDALRaster
>> ImportError: cannot import name 'GDALRaster'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 22, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
>>  
>> line 363, in execute_from_command_line
>> utility.execute()
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\core\management\__init__.py",
>>  
>> line 337, in execute
>> django.setup()
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\__init__.py",
>>  
>> line 27, in setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\registry.py",
>>  
>> line 108, in populate
>> app_config.import_models()
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\apps\config.py",
>>  
>> line 202, in import_models
>> self.models_module = import_module(models_module_name)
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\importlib\__init__.py",
>>  
>> line 126, in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>>   File "", line 978, in _gcd_import
>>   File "", line 961, in _find_and_load
>>   File "", line 950, in 
>> _find_and_load_unlocked
>>   File "", line 655, in _load_unlocked
>>   File "", line 677, in exec_module
>>   File "", line 205, in 
>> _call_with_frames_removed
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\models.py",
>>  
>> line 4, in 
>> from django.contrib.auth.base_user import AbstractBaseUser, 
>> BaseUserManager
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\contrib\auth\base_user.py",
>>  
>> line 52, in 
>> class AbstractBaseUser(models.Model):
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
>>  
>> line 124, in __new__
>> new_class.add_to_class('_meta', Options(meta, app_label))
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\base.py",
>>  
>> line 330, in add_to_class
>> value.contribute_to_class(cls, name)
>>   File 
>> "C:\Users\Prashant\Desktop\Geolocation\casino_locater\lib\site-packages\django\db\models\options.py",
>>  
>> line 214, in contribute_to_class
>> self.db_table = truncate_name(self.db_table, 
>> connection.ops.max_name_length())
>>   File 
>> "C:\Users\

Re: How can I access obj in admin.py

2017-05-03 Thread Mike Dewhirst

On 3/05/2017 5:12 PM, Stephen J. Butler wrote:
You want to override get_inline_instances: 
https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inline_instances


Many thanks Stephen - works nicely.

And thanks again to all you Django devs :)

M


On Wed, May 3, 2017 at 12:33 AM, Mike Dewhirst > wrote:


I want to adjust inlines based on a property of the object.

class SubstanceAdmin(admin.ModelAdmin):

class SolidInline(admin.StackedInline):
pass
class LiquidInline(admin.StackedInline):
pass
class GasInline(admin.StackedInline):
pass

inlines = get_inlines

def get_inlines(self):
obj = how_do_I_get_this(?)
if obj.physical_state = None:
return ((SolidInline), (LiquidInline), (GasInline))
elif obj.physical_state = 1:
return ((SolidInline), )
elif obj.physical_state = 2:
return ((LiquidInline), )
elif obj.physical_state = 3:
return ((GasInline), )

Many thanks for a miracle :)

Mike

-- 
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/a138bd6c-46fb-98c7-ba28-69a5959e5fbc%40dewhirst.com.au

.
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/CAD4ANxWWNxfDSCGUm8GFR_ijGL2WZAC%2Bwz3NCwpA%3DyHyALfWZQ%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/d59748f2-02c0-d331-52a1-75e0f37eb7a6%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: port 80 **** Hit EOF while fetching headers

2017-05-03 Thread zhenwuhe0611
Thanks James for your help.

Yeah, you are right, Python is not multi-thread supported, but, I felt it 
should be thread safe in this scenario.

I did further dig and found error message in apache error log showing 
[mpm_event:error] 
[pid 36398:tid 139973512394496] AH00485: scoreboard is full, not at 
MaxRequestWorkers

What does this mean? I googled and people saying that this is apache crash 
and I did check my wsgi log and noticed that each time I saw 500 error, I 
did see crashing happening in apache, but one thing I could not understand 
is that even I saw at certain time all are returning 200, I still see this 
error message in apache log. then only possible explanation is that maybe 
all those 200 returned are the threads not crashed. 

No matter what, I upgraded apache to 2.4.25, I was using 2.4.17, now, I did 
not see crash anymore, and neither 500 response, will monitor the system 
for more time to see it is really fixed.

thanks again for all your help



On Wednesday, May 3, 2017 at 3:18:07 AM UTC-7, James Schneider wrote:
>
>
> Our server has 24 Cores and 192G memory, should be big enough to handle 
> this kind of load? BTW, one more thing I want to mention is that we are 
> using host based docker, possible any config or limitation there?
>
>
> While I'm not familiar with your particular error, it's possible that your 
> problem is in one of these areas:
>
> 1. Your web server is threaded, but your code is not thread safe, and 
> you're hitting a race condition. The object you are expecting to exist has 
> been unexpectedly modified or deleted by another thread. Can't comment 
> further without knowledge of your underlying setup, code, etc. 
> Alternatively, a file being read/written is modified/removed by a different 
> process/thread.
>
> 2. Your underlying web server is not tuned to utilize the hardware you've 
> mentioned. A typical Apache install will not spawn enough workers or 
> threads to use that much horsepower. If your processor, disk, and RAM are 
> not pegged (or close to), you aren't getting the bang for your buck that 
> you thought with a large server (or you may not have enough load to tax it).
>
> 3. Your database may be congested, causing the Django calls to run slowly, 
> possibly resulting in timeouts. Check the DB logs for over-subscription.
>
> 4. There may also be errant clients who are sending incomplete requests, 
> or potentially port scanning where no headers are sent, and you are 
> actually seeing a false-positive log.
>
> Otherwise, you'll need to determine whether the error is coming from 
> Apache receiving headers from the client, or if it is having issues with 
> Django sending the needed headers back to Apache. 
>
> -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/d55a50b6-dded-42f2-8430-45e18aadbb9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django project similar to "Upwork"

2017-05-03 Thread Wilfred Gutierrez
 

Hi all, I have to develop in Django a web application similar to 
"Freelancer" or "Upwork" to be used in my region, please could you 
recommend some packages or apps that help me to make my project faster and 
/ or give me help on this topic .

Thanks in advance.

-- 
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/73aac9f3-5731-49e5-949a-7a689b2aaab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.