pyinstaller / pyinstaller

Freeze (package) Python programs into stand-alone executables
http://www.pyinstaller.org
Other
11.8k stars 1.94k forks source link

Django REST support #3914

Open Matias0422 opened 5 years ago

Matias0422 commented 5 years ago

Context:

I've been trying to implement a system using microservices with Django rest following the desktop paradigm along with the electron as the frontEnd of the project.

At one point I needed to package the services that used Django rest using pyinstaller, but with this a notable problem happened when uploading the application server was not found api rest template. With this it was necessary to "remove" the entire django rest interface, removing elements like "ViewSet" or "Response".

sem titulo

Nowadays one of the main tools for microservice architecture is the use of endpoints.

Suggestion:

This way I come with the suggestion of improving the pyinstaller to support django rest. Since microservice architecture is something new and there is nothing that has a related support of this architecture to the desktop paradigm, I see an excellent opportunity for help in this part.

@RochaCarla

heoga commented 4 years ago

In Django you can configure the template search directories. What you probably need to do is tell your spec file to package the files from the rest_framework module and then add the resulting directory in your package to the template configuration settings in Django. You'd have a similar issue if you tried to use any other data files from Python projects and may need to configure any static collection appropriately as well.

I'll have to build a toy project and see if this works, but I don't see why it shouldn't.