I'm not very familiar with Django, but I recently did something similar with PYramid.
The trick *may* be that Django is doing a bunch of its configuration/ discovery dynamically, at run time. That was the case with Pyramid -- essentially is was scanning the code at run time looking for views to include. So when PyInstaller ran, it didn't know that those view files needed to be included, so at run time, they weren't found. You may need to either: change your config so that everything is explicitly imported / included statically. or add the extra modules to PyInstaller (via the spec file) by hand. Sorry to not be more specific, but maybe this will give you some ideas. -CHB On Wed, Mar 4, 2020 at 8:02 AM Shi James <[email protected]> wrote: > I created the most simple Python/Django project following to the standard > procedure: virtual environment => startproject, startapp, simple model with > one Char field. Also I add my model to the admin.py file. Then I ran > makemigrations, migrate, createsuperuser. > > If I run like python manage.py runserver then everything is perfect: I > can view and edit my model. > > But I need to run my program as a single exe-file. For that purpose I use > PyInstaller with default settings. The exe file is generated with no errors. > > And here is the problem: there is no my model at the Admin Panel except > User and User Groups. > > My environment is Python 3.7, Django 2.2, Pyinstaller 3.4, Windows 7. > Everything is under a virtual environment. > > Have anyone run into that problem? Is there any workaround to it? > > Thanks in advance. > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pyinstaller/6a3f4485-1a05-428e-9d25-7f482b534b50%40googlegroups.com > <https://groups.google.com/d/msgid/pyinstaller/6a3f4485-1a05-428e-9d25-7f482b534b50%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected] -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CALGmxEJ6AjxGDDnTZ5%2BCMmZM7fRFBGMLHOstO0VtNnpqCtba-A%40mail.gmail.com.
