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

Quick demo of a possible scenario where a django setup is running on the same domain as a React frontend based on create-ueno-app with an nginx proxy inside docker.

Notifications You must be signed in to change notification settings

ueno-llc/demo-app-django-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-ueno-app + Django + nginx demo

Quick demo of a possible scenario where a django setup is running on the same domain as a React frontend based on create-ueno-app with an nginx proxy inside docker. This is a proof of concept and not in any way productionized.

To start:

docker-compose build
docker-compose up

Runs the react app on http://localhost using the default template from create-ueno-app and the django app on /api.

One new component is on the frontpage (nextapp/src/logged-in/LoggedIn.tsx that checks if the user is logged in by doing a client side fetch to /test which proxies to the django app and checks if the user is logged in via request.user.is_authenticated. Since it's a client side request, all cookies are passed along and authentication is checked with no changes to django's system. Login into django is admin/admin.

Server-side implementation could also be achieved by passing along the cookie to the other app, we have access to them since we're on the same domain.

About

Quick demo of a possible scenario where a django setup is running on the same domain as a React frontend based on create-ueno-app with an nginx proxy inside docker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published