Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Serve frontend app from Django for production and production testing #136

Open
5 tasks done
antonow opened this issue Sep 24, 2017 · 1 comment
Open
5 tasks done

Comments

@antonow
Copy link
Contributor

antonow commented Sep 24, 2017

For production and testing for production locally, we will want to serve the frontend app index page located at interface/frontend/templates/index.html for requests to '/' on the Django server.

Expected Behavior

Visiting '/' at localhost:8000 renders the compiled frontend app.

Current Behavior

At the moment, visiting '/' at localhost:8000 yields a 404.

Possible Solution

Add a route which serves the compiled frontend app.

Steps to Reproduce

  1. docker-compose -f local.yml up
  2. Visit localhost:8000 in browser

screen shot 2017-09-23 at 9 06 39 pm

Context (Environment)

I was trying to see how the compiled app looks and noticed that the Django server is no longer serving the frontend app. To get the app ready for production, we need to know that the compiled app is working as expected.

Possible Implementation

PR 97 had the compiled app being served from localhost:8000 so it may be able to be used as a reference.

Checklist before submitting

  • I have confirmed this using the officially supported Docker Compose setup using the local.yml configuration and ensured that I built the containers again and they reflect the most recent version of the project at the HEAD commit on the master branch
  • I have searched through the other currently open issues and am confident this is not a duplicate of an existing bug
  • I provided a minimal code snippet or list of steps that reproduces the bug.
  • I provided screenshots where appropriate
  • I filled out all the relevant sections of this template
@isms
Copy link
Contributor

isms commented Sep 26, 2017

One note - the vue devserver is now the one true way to look at the frontend when developing locally. I want to make sure we don't get confused about "production" for this app — almost every meaning of that word is out of scope and we should not waste time on that.

That being said, there is still value in getting a pipeline set up so that Django can serve the built frontend script.

For posterity: my take on a good way to do this is to reuse the same Node/NPM container from the vue service but with a different entrypoint so that the production build creates the minified, static assets and puts them into the Django folder. Still some footwork to figure out how to point Django to these files so they will be served statically and loaded in the base template (?) or something like that.

@isms isms added this to the 1-mvp milestone Oct 11, 2017
@isms isms modified the milestones: 1-mvp, 2-feature-building Oct 29, 2017
@isms isms modified the milestones: 2-feature-building, 3-packaging Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants