Re: Official Django Docker Container Deprecated

2019-02-28 Thread Kye Russell
Agreed. As someone that Dockerizes all of their Django development I can
speak to how opinionated such an image would HAVE to be.

It can certainly be done, but I don’t think it should.

There is also an implied security / maintenance burden so unfortunately
even if it were appropriate, it’s not exactly work that doesn’t come with a
clear ongoing commitment.

On Thu, 28 Feb 2019 at 9:04 pm, Tom Forbes  wrote:

> I think the point we are trying to make is that it’s fundamentally not a
> good thing to try and distribute a one-size fits all docker image for a
> specific framework.
>
> For reference here is one you can use yourself:
>
> FROM python:3
> COPY requirements.txt .
> RUN pip install -r requirements.txt
> COPY . .
> CMD [ "gunicorn", "my.app" ]
>
> If someone is unable to make an equivalent Dockerfile then they will be
> really confused when they realise that they need to customise it, because
> few projects are as simple as that.
>
> You should also likely not embed Apache inside your app container - it’s
> kind of missing the general idea of Docker.
>
> To re-iterate: The Django project had no hand in creating the ‘official’
> image. The Docker project retired the original Django image for reasons
> that are clearly explained here , and
> those reasons still hold today.
>
> Tom
>
>
>
>
> On 28 February 2019 at 12:56:33, Alexander Lyabah (a.lya...@checkio.org)
> wrote:
>
> I can make a version for production use (in a week or two), for your
> critics.
>
> For example, based on Appache wsgi.
>
> PS: maybe it is also worth to make a docker image for testing changes in
> Django source?
>
> On Wednesday, February 27, 2019 at 4:31:17 PM UTC+2, Jamesie Pic wrote:
>>
>> > most people currently lean towards a microservice architecture and
>> therefore towards flask.
>> "according to the 2018 JetBrains Developer Survey" and some people.
>> Why start a project with flask in 2019 instead of Quart which or
>> Starlette is another question that I suppose is out of the scope of
>> this mailing list.
>>
>> Anyway, the point of Docker is to build your own image that supports
>> both development and production given different runtime parameters.
>> The agile practice with docker is to build your immutable image in CI,
>> test it, deploy it to staging, have on-click deployment to production.
>>
>> The security and best practice documentation from docker are indeed a
>> lot to grasp, and beginners will most of the time start making
>> insecure (running as root) and inefficient (fat) images. Therefore for
>> their security Django might want to document making a docker file,
>> perhaps based on the alpine image that's the most lightweight.
>>
>> --
>> ∞
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/f07ad32e-e74f-4cd3-945a-ed92692c2209%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 developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAFNZOJP5k%3Dsn8VkdwseuVqnMC6X40y349urNMRFZfD7FEypvbg%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 developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANK-ykm7ub21e8Ryn37jc1O7f5sg1PNTAGjoxD_h%2BHVRMs4_1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Official Django Docker Container Deprecated

2019-02-28 Thread Tom Forbes
I think the point we are trying to make is that it’s fundamentally not a
good thing to try and distribute a one-size fits all docker image for a
specific framework.

For reference here is one you can use yourself:

FROM python:3
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD [ "gunicorn", "my.app" ]

If someone is unable to make an equivalent Dockerfile then they will be
really confused when they realise that they need to customise it, because
few projects are as simple as that.

You should also likely not embed Apache inside your app container - it’s
kind of missing the general idea of Docker.

To re-iterate: The Django project had no hand in creating the ‘official’
image. The Docker project retired the original Django image for reasons
that are clearly explained here , and
those reasons still hold today.

Tom




On 28 February 2019 at 12:56:33, Alexander Lyabah (a.lya...@checkio.org)
wrote:

I can make a version for production use (in a week or two), for your
critics.

For example, based on Appache wsgi.

PS: maybe it is also worth to make a docker image for testing changes in
Django source?

On Wednesday, February 27, 2019 at 4:31:17 PM UTC+2, Jamesie Pic wrote:
>
> > most people currently lean towards a microservice architecture and
> therefore towards flask.
> "according to the 2018 JetBrains Developer Survey" and some people.
> Why start a project with flask in 2019 instead of Quart which or
> Starlette is another question that I suppose is out of the scope of
> this mailing list.
>
> Anyway, the point of Docker is to build your own image that supports
> both development and production given different runtime parameters.
> The agile practice with docker is to build your immutable image in CI,
> test it, deploy it to staging, have on-click deployment to production.
>
> The security and best practice documentation from docker are indeed a
> lot to grasp, and beginners will most of the time start making
> insecure (running as root) and inefficient (fat) images. Therefore for
> their security Django might want to document making a docker file,
> perhaps based on the alpine image that's the most lightweight.
>
> --
> ∞
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/f07ad32e-e74f-4cd3-945a-ed92692c2209%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 developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFNZOJP5k%3Dsn8VkdwseuVqnMC6X40y349urNMRFZfD7FEypvbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Official Django Docker Container Deprecated

2019-02-28 Thread Alexander Lyabah
I can make a version for production use (in a week or two), for your 
critics.

For example, based on Appache wsgi.

PS: maybe it is also worth to make a docker image for testing changes in 
Django source?

On Wednesday, February 27, 2019 at 4:31:17 PM UTC+2, Jamesie Pic wrote:
>
> > most people currently lean towards a microservice architecture and 
> therefore towards flask. 
> "according to the 2018 JetBrains Developer Survey" and some people. 
> Why start a project with flask in 2019 instead of Quart which or 
> Starlette is another question that I suppose is out of the scope of 
> this mailing list. 
>
> Anyway, the point of Docker is to build your own image that supports 
> both development and production given different runtime parameters. 
> The agile practice with docker is to build your immutable image in CI, 
> test it, deploy it to staging, have on-click deployment to production. 
>
> The security and best practice documentation from docker are indeed a 
> lot to grasp, and beginners will most of the time start making 
> insecure (running as root) and inefficient (fat) images. Therefore for 
> their security Django might want to document making a docker file, 
> perhaps based on the alpine image that's the most lightweight. 
>
> -- 
> ∞ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f07ad32e-e74f-4cd3-945a-ed92692c2209%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Filterable subqueries ...

2019-02-28 Thread Bernd Wechner
I have a problem I've only been able to solvewhich bugs me. I've posted on 
the Django users list (to stunning silence) and on stackoverflow:

https://stackoverflow.com/questions/54388936/using-django-window-functions-on-a-filtered-queryset

to comparable silence.  I'm rather convinced this can't be done in Django 
without raw SQL and that it is an integral part of Window function utility 
so I'd like to propose a native ORM based solution to the problem.

To understand the context it will be necessary to read the post on Stack 
Overflow above, there seems little point in copying the text here. 

The proposal though is simple enough. It is that django.db.models.Subquery 
support the methods that django.db.models.QuerySet does, specifically SQL 
constructing methods like annotate() and filter() - I'm sure there are 
more. 

The idea is to make easily available a way of selecting from a subquery 
such that something akin to:

SQ = Subquery(model.objects.filter(...))   

produces SQL in the form:

SELECT ... FROM model WHERE ...

and now:

Q = SQ.filter(---)

would produce SQL in the form:

SELECT * FROM (SELECT ... FROM model WHERE ...) AS SQ WHERE ---

Essentially permitting us to filter on the results of a Subquery. 

Again, this is crucial when using Window functions like LAG and LEAD over a 
filtered list of objects. The reasons for this are explained on Stack 
Overflow with samples of code and SQL.

Of course, in spite of the stunning silence on the Django users list and 
Stackoverflow, there's a chance we can already do this in Django in a way 
that does not involve Raw SQL that I have not found yet, in which case 
apologies, this really is a support question for the Django users list. But 
I have looked hard and asked hard and searched hard and experimented hard 
and delved into the Django code quite hard and I'm fairly convinced it's 
not possible at present ... without constructing Raw SQL.

Regards,

Bernd.




-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/214d7770-ecc0-41ef-b4ce-c80e831473a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.