How to deploy Django rest framework and reactjs app to aws?

I made an app using Django rest framework as the backend and reactjs as the frontend.

It works on localhost.

Now I am trying to deploy the app to aws.

When I follow the tutorial for deploying the django app on aws beanstalk it worked for the api. I am able to use postman and access the api endpoints.

When I go to the url, I get 404, debug is on:

Using the URLconf defined in dca.dca.urls, Django tried these URL patterns, in this order:

    ^api/dcasetting/$ [name='dcasetting-list']
    ^api/dcasetting\.(?P<format>[a-z0-9]+)/?$ [name='dcasetting-list']
    ^api/dcasetting/(?P<pk>[^/.]+)/$ [name='dcasetting-detail']
    ^api/dcasetting/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='dcasetting-detail']
    ^$ [name='api-root']
    ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
    api/auth/logout [name='knox_logout']

The current path, index.html, didn’t match any of these.

Then I tried one of the paths being tried above:


This gives me error:

Request Method:     GET
Request URL:
Django Version:     4.0.6
Exception Type:     TemplateDoesNotExist
Exception Value:    


Exception Location:     /var/app/venv/staging-LQM1lest/lib/python3.8/site-packages/django/template/, line 19, in get_template
Python Executable:  /var/app/venv/staging-LQM1lest/bin/python
Python Version:     3.8.5
Python Path:    


The folder structure:

   | db.sqlite3
| .babelrc
| package-lock.json
| package.json
| pipfile
| pipfile.lock
| requirements.txt
| webpack.config.js

I am not sure what to try next. If someone can point me to a tutorial or a solution to this?


Back to Top