Django Pyinstaller

359 views
Skip to first unread message

Pierre

unread,
Aug 30, 2022, 3:31:25 AM8/30/22
to PyInstaller
Does anyone have  a .spec file or example of a django implementation of pyinstaller? Currently I have to run:

mysite.exe runserver localhost:8000 --noreload

Where as I would like to be able to set that as the default behavior if a user clicks the executable. Even better would be to be able to run migrate before runserver. The client that will be receiving the file is not savvy and I would like to simplify the package installation as much as possible. 

Thank you!

Eric Fahlgren

unread,
Aug 30, 2022, 4:41:19 PM8/30/22
to pyins...@googlegroups.com
So, from the '.exe' I'm assuming a Windows environment?  If so, you have a couple ways to do this.  You can create a Windows shortcut to the executable that contains those arguments, the shortcut's "Target" would look exactly like your specified command line.  On the other hand, you can add an (or modify the existing) argument parser to supply those defaults in mysite.py's main.  Neither of these requires that you do anything to your PyInstaller spec  (and I'm having a hard time seeing where you would do this at the PyInstaller phase of deployment).

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/bda92104-09b8-4fb3-ae6f-7c172ddb3caen%40googlegroups.com.

Chris Barker

unread,
Aug 31, 2022, 2:17:30 AM8/31/22
to pyins...@googlegroups.com
On Tue, Aug 30, 2022 at 1:41 PM Eric Fahlgren <ericfa...@gmail.com> wrote:
On the other hand, you can add an (or modify the existing) argument parser to supply those defaults in mysite.py's main.  Neither of these requires that you do anything to your PyInstaller spec  (and I'm having a hard time seeing where you would do this at the PyInstaller phase of deployment).

I agree -- the trick is to provide PyInstaller with a startup script that doesn't require any command line args. I'm not sure what startup script you're using -- but you can either alter it to have the defaults you want, or write a little wrapper that provides those defaults, and use that wrapper as your main script for PyInstaller.

-CHB



 

On Tue, Aug 30, 2022 at 12:31 AM Pierre <fendy...@gmail.com> wrote:
Does anyone have  a .spec file or example of a django implementation of pyinstaller? Currently I have to run:

mysite.exe runserver localhost:8000 --noreload

Where as I would like to be able to set that as the default behavior if a user clicks the executable. Even better would be to be able to run migrate before runserver. The client that will be receiving the file is not savvy and I would like to simplify the package installation as much as possible. 

Thank you!

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/bda92104-09b8-4fb3-ae6f-7c172ddb3caen%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov
Reply all
Reply to author
Forward
0 new messages