I am working on a app using BeeWare (front-end python app framework) and Django. I'm using a cookie cutter template. My issue is with two files: settings.py and urls.py in the following repo structure.
When I run python manage.py runserver inside the webapp dir, the server runs perfectly. But when I want to run the app development in the main app directory, named positron, I use briefcase dev. With this command, I get import errors that are fixed by changing the import statements in settings.py and urls.py from webapp.urls to webapp.webapp.urls and webapp.views to webapp.webapp.views respectively.
I would like to not have to change these import statements based on whether I am developing my Django backend or my front end BeeWare code. What would standard practice be? Should I do a try statement or maybe some sort of custom package install? I'm not really sure what the most robust way to do it is.
Thank you so much!
The
srcdirectory in a Briefcase app is the root of the package hierarchy, so if you want your package to be calledwebapprather thanwebapp.webapp, just get rid of the the outerwebappdirectory and move its content directly underneathsrc.