MakeICT / event-creator

0 stars 3 forks source link

All pages 404 when running main.py via python interpreter #34

Closed Rowbotronics closed 2 years ago

Rowbotronics commented 4 years ago

The app works fine when run via the 'flask run' command, but when attempting to run main.py via the python interpreter the app will load successfully, but all pages return 404. Adding print statements at the beginning of each major file shows a different load sequence.

$ python main.py

<<Load: main.py>>
<<Load: main.py>>
<<Load: forms.py>>
<<Load: models.py>>
<<Load: routes.py>>
 * Serving Flask app "main" (lazy loading)
 * Environment: development
 * Debug mode: on
INFO:werkzeug: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
INFO:werkzeug: * Restarting with stat
<<Load: main.py>>
<<Load: main.py>>
<<Load: forms.py>>
<<Load: models.py>>
<<Load: routes.py>>
WARNING:werkzeug: * Debugger is active!
INFO:werkzeug: * Debugger PIN: 236-007-769

$ flask run

 * Serving Flask app "main.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
<<Load: main.py>>
<<Load: forms.py>>
<<Load: models.py>>
 * Debugger is active!
 * Debugger PIN: 194-907-337
<<Load: routes.py>>
<<Load: main.py>>
<<Load: forms.py>>
<<Load: models.py>>
<<Load: routes.py>>
Rowbotronics commented 3 years ago

@sdowens did you say that you were able to fix this issue? I remember talking about this, but I don't remember the details.

sdowens commented 3 years ago

@Rowbotronics Yes I did. I will see if I can figure out exactly what I changed. I know it had to do with the imports. I am not sure if I still have that workspace or not, but I will take a look tonight.

Rowbotronics commented 2 years ago

This is fixed in e766e3435aff0a6de2fc75989b36a22d659adea1

¯_(ツ)_/¯

sdowens commented 2 years ago

Yes, now what I see your change, I was able to check my old files and confirm that this was the original fix.