├── .babelrc ├── app ├── __init__.py ├── templates │ ├── index.js │ ├── app │ │ └── demo.html │ ├── base.html │ ├── index.html │ └── components │ │ ├── LoadingButton.js │ │ └── Demo.js ├── migrations │ └── __init__.py ├── admin.py ├── tests.py ├── models.py ├── apps.py └── views.py ├── docker-compose.yml ├── requirements.txt ├── configs ├── __init__.py ├── wsgi.py ├── urls.py └── settings.py ├── docker-services.yml ├── .dockerignore ├── .DS_Store ├── supervisor-app.conf ├── webpack.config.js ├── uwsgi_params ├── uwsgi.ini ├── manage.py ├── package.json ├── .gitignore ├── Dockerfile ├── nginx-app.conf └── README.md /.babelrc: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/templates/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker-services.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .gitignore 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moosh3/django-react/HEAD/.DS_Store -------------------------------------------------------------------------------- /app/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /app/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /app/templates/app/demo.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | {{ demo }} 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /app/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.db import models 4 | 5 | # Create your models here. 6 | -------------------------------------------------------------------------------- /app/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.apps import AppConfig 4 | 5 | 6 | class AppConfig(AppConfig): 7 | name = 'app' 8 | -------------------------------------------------------------------------------- /supervisor-app.conf: -------------------------------------------------------------------------------- 1 | [program:app-uwsgi] 2 | command = /usr/local/bin/uwsgi --ini /home/docker/code/uwsgi.ini 3 | 4 | [program:nginx-app] 5 | command = /usr/sbin/nginx 6 | -------------------------------------------------------------------------------- /app/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | from react_render.django.render import render_component 4 | 5 | def index(request): 6 | demo = render_component('templates/components/Demo.js') 7 | 8 | return render(request, 'app/demo.html') 9 | -------------------------------------------------------------------------------- /app/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Django, Webpack and ReactJS 5 | 6 | 7 |
8 | {% block content %} 9 | 10 | {% endblock content %} 11 |
12 |