Sunday, March 1, 2015

Re: Python / Django slow ? Deciding my next technological stack

The rest of the uWSGI / gunicorn / whatever workers are available to handle the other requests.

If there are so many uploads that all of the workers are busy then there are ways to upload files directly to Amazon S3 (for example) from the browser without going through your server.

On Sun, Mar 1, 2015 at 12:16 PM, Benj <webkoros@gmail.com> wrote:
Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place. Should this be done in code with things like asyncio, or server with uwsgi workers ?

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <webk...@gmail.com> wrote:
> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfe76a80-af35-4894-a18d-2717c371235c%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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei2bnQi0FxpMTtvZ1OAP%3D_Q2k0XJze06mv7vCKLc%3D%2BTikQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Python / Django slow ? Deciding my next technological stack

Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place. Should this be done in code with things like asyncio, or server with uwsgi workers ?

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <webk...@gmail.com> wrote:
> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cfe76a80-af35-4894-a18d-2717c371235c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Python / Django slow ? Deciding my next technological stack

Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users while the upload is taking place.

On Wednesday, February 25, 2015 at 3:28:34 PM UTC+1, Tom Evans wrote:
On Tue, Feb 24, 2015 at 11:30 PM, Benj <webk...@gmail.com> wrote:
> Hi,
> i'm going to invest lots of time and energy in various web projects (mostly
> community web sites), and want to pick up a language / framework and invest
> heavily on it.
> I've spent a lot of time evaluating the various options, and narrowed my
> choice to 2 stacks: C sharp asp.net  MVC or Python / Django.
>
> I'm more attracted to Python / Django combo, because of the Python language,
> and high level framework Django. I really want to use these.
> My only concern is speed. I read that Python can't run concurrent tasks, is
> this true ? So a multi-processor with hyperthreads won't benefit the stack
> and even slow it down ?
> I have no clue how this translates in reality, but should I expect noticable
> performance difference on a same server, shall I use Python / Django than if
> I had C Sharp Asp.net ?
> I don't want to invest lots of time and efforts only to discover in the end
> that the site is slow.
> You that have real world experiences with running sites, what are your
> conclusions ?
>
>
> I expect sites to be medium traffic: could be handled by a good dedicated
> server or average cloud ressources.
>
> Benj

Unless you are producing web-scale sites (gmail, ebay, instagram), the
speed of your website will depend more upon what you do with a
framework than the framework you choose.

If you are producing web-scale sites, then whatever framework you
choose you will need to make the right design decisions and/or
compromises.

Even with the best framework in the world, if you design the
architecture of a website poorly, the website will be slow.

Even less important than the choice of framework is the choice of
hosting container for your framework. If you ever get to the point
where the speed of your wsgi container is the thing that is holding
you back, well done, now you should spend some time looking at it.
Until then, use the way that is easiest for you.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7e783c1f-2c44-4110-8dd9-933b489ac9ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Free Django Video Tutorials

Hi All

Just a quick shout out to all you guys learning Django!

I have a 11+ hrs FREE tutorial series to get you started here: https://mikesdjangotutorials.co.uk

Check it out, there stuff there for beginners and advanced!

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8683e896-9557-4647-9ffc-68251627228a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, February 28, 2015

Problem installing and using smart_selects


Smart Selects looked so simple and promising for chained selects (https://github.com/digi604/django-smart-selects).  However, no matter how I install it, it doesn't seem to work.  Here is what I've tried:


Attempt #1 - putting it in django.contrib

Copied the smart_selects folder to /django/contrib/smart_selects

Added "django.contrib.smart_selects" to INSTALLED_APPS in settings.py

But within Django shell I got this error:

>>>  from django.contrib import smart_selects
>>>  smart_selects.urls
AttributeError: 'module' object has no attribute 'urls'



Attempt #2 - installed using pip

I removed the smart_selects folder from /django/contrib  folder (above) and then installed using pip... which put smart_selects in the Python site-packages folder.

But then trying to use smart_selects within urls.py produced an ugly "ImportError: cannot import name simplejson" which suggests smart_selects has some outdated dependencies. (I"m using Django 1.7).



Attemp #3 - putting smart_packages in the root folder of my Django project

When smart_selects is placed here, again I can import smart_selects from the Django shell  but not access smart-selects.urls :

Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import smart_selects
>>> dir(smart_selects)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'models']
>>> smart_selects.urls
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'module' object has no attribute 'urls'


Finally it works if i do this:

>>> import smart_selects.urls
>>> smart_selects.urls
<module 'smart_selects.urls' from '/Users/chas/Projects/switch/djangoroot/smart_selects/urls.pyc'>



However, I really don't like putting apps here since they clutter up my own development (and would rather keep 3rd party apps in django/contrib). 

What am I missing about the smart_selects ?
Thank you,

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1034ee57-88fc-417e-a9d6-b5787815ffb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: "ResourceWarning: unclosed" error using mysql-connector-python

I was also getting these errors, upgrading resolved them for me as well.

On Friday, July 4, 2014 at 6:59:03 AM UTC-7, Zemian Deng wrote:
No problem. Thanks for the reply.


On Fri, Jul 4, 2014 at 12:51 AM, cercatrova2 <cerca...@gmail.com> wrote:
On 04/07/14 05:09, Zemian Deng wrote:
Hum... I am surprised that no one has experienced this warning msg yet, or maybe I can't catch anyone to reply.

For those are curious, I do now see mysql-connector-python 1.2.2 is available, and upgrading to this version got rid off these warnings.

On Thursday, June 12, 2014 11:24:40 PM UTC-4, Zemian Deng wrote:
Anyone?

On Tuesday, June 10, 2014 11:26:18 PM UTC-4, Zemian Deng wrote:
Hi there,

I am using mysql-connector-python (1.1.6) with Django (1.6.5) and myapp is working fine. But each SQL call to DB will result the following warning messages:

Exception ignored in: <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 62622), raddr=('127.0.0.1', 3306)>

ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 62622), raddr=('127.0.0.1', 3306)>


Has anyone seen this and know a way to resolve it?

Also, FYI, I am using the following in my settings file.
DATABASES = {
    'default': {
       'ENGINE': 'mysql.connector.django',
       'NAME': 'mydb',
       'USER': 'test',
       'PASSWORD': 'test',
    },
}

Thanks,
Zemian
--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a443d950-fe72-4380-bf61-1fc9c71c9af9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zemian - I saw these warning messages too with 1.1.6 but indeed they went away with 1.2.2 about a month ago so I didn't post anything. Sorry but I didn't know of your message at the time.



--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53B632EE.2080203%40gmail.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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ea575334-f11d-4841-8ac2-1ffb4b278b14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: djangoproject.com https access problems

OK, I will do that,

because even IE 11 doesn't work
(by the way I use FF 36.0 on Win7 64bit).

Anton

James Schneider wrote:

> The proxy is likely forcing a TLS fallback in a way that Firefox doesn't
> like. Ensure you are using the latest version of FF, but even then, unless
> you have control off the proxy, there may not be much you can do except
> open a support ticket with your IT department.
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=1072382
>
> -James
> On Feb 27, 2015 8:58 AM, "anton" <antonxx@gmx.de> wrote:
>
>> Hi,
>>
>> at home it works, but in my company
>> the proxy refuses the connection to:
>>
>> https://www.djangoproject.com
>>
>> and my firefox gives me an error:
>>
>> ssl_error_inappropriate_fallback_alert
>>
>> Question: since when did you switch the website to https
>> (or didn't I notice it)
>>
>> Other sites seems to work, is there anything special
>> with https://www.djangoproject.com ?
>>
>> All the time I had no problems.
>>
>>
>> Anton
>>
>> --
>> 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+unsubscribe@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/mcq7ng%24s55%241%40ger.gmane.org
>> .
>> 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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/mcsnhj%242ob%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.