text: import os
  from django.conf import settings
  from django.http import HttpResponse
  from django.views.generic import View
  
  
  class FrontendAppView(View):
      """
      Serves the compiled frontend entry point (only works if you have run `yarn
      run build`).
      """
  
      def get(self, request):
          try:
              with open(os.path.join(settings.REACT_APP_DIR, 'build',
                                     'index.html')) as f:
                  return HttpResponse(f.read())
          except FileNotFoundError:
              return HttpResponse(
                  """
                  This URL is only used when you have built the production
                  version of the app. Visit http://localhost:3000/ instead, or
                  run `yarn run build` to test the production version.
                  """,
                  status=501,
              )
  