My impression reading over the problem a little yesterday was that we could
work to provide a common "get me a resource" abstraction in Django that
papers over the couple of different ways it has to work, though I haven't
looked super far into things that require directory listing (e.g.
migrations) rather than direct file access (like templates).

It would be nice to investigate this a bit more, though. If we can get
Django compatible, or work with PyOxidiser if we find a reasonable
workaround they could implement, it would be great.

Andrew

On Thu, Jun 27, 2019 at 12:39 PM Markus Holtermann <i...@markusholtermann.eu>
wrote:

> Hi Peter,
>
> PyOxidizer looks indeed super interesting. Talking about templates and
> specifically Jinja2 templates, they are internally converted to the Python
> AST if I'm not mistaking. Turning them into Python modules that a new
> Jinja2ModuleTemplateLoader could load doesn't seem like that far fetched.
>
> Similarly for Django's migration files. Swapping out the MigrationLoader
> would already be sufficient.
>
> I'd definitely be interested to see what's needed to change in core to
> have a 3rd party package provide the necessary support.
>
> Cheers,
>
> Markus
>
> On Thu, Jun 27, 2019, at 9:09 PM, Peter Baumgartner wrote:
> > I'm interested in using PyOxidizer [1] to create single-file executable
> > Django projects. This currently isn't possible because of all the
> > places Django assumes it is operating on a proper filesystem. I haven't
> > done a full audit, but templates, migrations, and static files come to
> > mind. Python has full support this scenario (aka resource loading), but
> > it would require some changes to Django internals to use it. One of the
> > biggest hurdles I see on the surface is that you can only load a
> > resource from a Python module (not from a sub-directory). That being
> > said, I have a feeling resource loading could be added such that users
> > could opt-in or backwards compatibility is maintained with the current
> > implementation.
> >
> > Some additional reading/watching on the subject:
> >
> > * Topic overview:
> >
> https://pyoxidizer.readthedocs.io/en/latest/packaging_pitfalls.html#reliance-on-file
> > * Barry Warsaw talk on resource loading:
> > https://www.youtube.com/watch?v=ZsGFU2qh73E
> >
> > I'm posting here to see if there is general support for this and to
> > discuss what sort of changes would be required. Thanks!
> >
> > [1] https://pyoxidizer.readthedocs.io/
> >
> >  --
> >  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/b6229b20-0647-4e0a-b9e6-31136a774e13%40googlegroups.com
> <
> https://groups.google.com/d/msgid/django-developers/b6229b20-0647-4e0a-b9e6-31136a774e13%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
> >  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/2faec64a-da9f-4d55-9378-a3cb6a308d53%40www.fastmail.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/CAFwN1ur36dYm7xohN0PQRkY3Y8H5m8-Ws307Wo-u%2B3xMtjLBKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to