I have 3 folders in a Django web application. The folders are as follows: a folder containing settings.py (project), a folder containing models.py (application), and a folder containing an external interface application created by create-response-app.
I would like to build a reactive front, copy the assembly artifacts to a static folder, and then run the django application on heroku, but they made this process almost impossible with my current folder structure. An alternative is to smooth out the application response and have build, src, node_modules, packagejson, etc. Etc. Etc. Everything is at the root of the project, but it seems very bad.
Some configuration in settings.py:
STATICFILES_DIRS = ( os.path.join(PROJECT_ROOT, 'static'), os.path.join(BASE_DIR, 'front-end/build/static')
)
What I run locally inside the front-end:
npm run build
What I return from views:
def index(request): return HttpResponse(loader.get_template('build/index.html').render())
How to deploy the project described above in Heroku so that it can find all the static resources?
source share