All Projects → smmoosavi → djcra

smmoosavi / djcra

Licence: MIT License
Django ❤️ create-react-app integration example

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to djcra

Create React App Typescript Todo Example 2020
🚀 Create React App TypeScript Todo Example 2020
Stars: ✭ 255 (+2025%)
Mutual labels:  create-react-app, example
React Redux Typescript Realworld App
RealWorld App implementation based on "react-redux-typescript-guide"
Stars: ✭ 178 (+1383.33%)
Mutual labels:  create-react-app, example
document-server-integration
Examples on how to integrate ONLYOFFICE Document Server into your own website or application
Stars: ✭ 68 (+466.67%)
Mutual labels:  integration, example
ha-rhvoice
Home Assistant integration for RHVoice - a local text-to-speech engine.
Stars: ✭ 19 (+58.33%)
Mutual labels:  integration
work with stagesepx
about how to use stagesepx in production
Stars: ✭ 41 (+241.67%)
Mutual labels:  example
markdown-editor
✏️ A very simple but useful Markdown Previewer and Markdown Editor with CodeMirror, Markedjs, and Create-react-app
Stars: ✭ 25 (+108.33%)
Mutual labels:  create-react-app
UWO
Unity WebGL x WebSocket MMO demo
Stars: ✭ 49 (+308.33%)
Mutual labels:  example
play-scala-anorm-example
Example Play Database Application using Anorm
Stars: ✭ 41 (+241.67%)
Mutual labels:  example
play-scala-secure-session-example
An example Play application showing encrypted session management
Stars: ✭ 54 (+350%)
Mutual labels:  example
graphql-workshop
Hands on workshop about GraphQL with React and Apollo 🚀
Stars: ✭ 43 (+258.33%)
Mutual labels:  create-react-app
nodejs-with-postgres-api-example
k8s course example - node.js app with Postgres, Hapi.js and Swagger
Stars: ✭ 59 (+391.67%)
Mutual labels:  example
integreat-app
React JS and React Native App for Integreat
Stars: ✭ 25 (+108.33%)
Mutual labels:  integration
fetch
Isomorphic Wordpress API client and React hooks - super tiny, super fast.
Stars: ✭ 47 (+291.67%)
Mutual labels:  create-react-app
solana-web3-demo
a quick demo for solana web3
Stars: ✭ 93 (+675%)
Mutual labels:  example
monoreact
📦 React workspaces implementation
Stars: ✭ 13 (+8.33%)
Mutual labels:  create-react-app
graphql-example
Intuitive GraphQL Resolver Example - Application example using RawModel.js as GraphQL rootValue on steroids.
Stars: ✭ 25 (+108.33%)
Mutual labels:  example
Movie Trailers SwiftUI
A simple app which shows the lastest movies trailers based on different genres developed using SwiftUI.
Stars: ✭ 51 (+325%)
Mutual labels:  integration
react-full-stack-starter
🎈Full-stack React boilerplate using `create-react-app`, Babel, Node.js, and express
Stars: ✭ 22 (+83.33%)
Mutual labels:  create-react-app
hello-3d-world
Plot 3d points, lines, and polygon on an svg. A demonstration of what you can do with the BareMinimum3d package
Stars: ✭ 53 (+341.67%)
Mutual labels:  create-react-app
typey-type
Typey Type for Stenographers is a free typing app designed specifically to help steno students practise and rapidly master stenography.
Stars: ✭ 51 (+325%)
Mutual labels:  create-react-app

djcra

Django ❤️ create-react-app integration example

how to run project

In frontend development mode:

  • set FRONTEND_DEV = True in settings.py
  • run servers
$ REACT_APP_PUBLIC_URL=http://localhost:3000 npm start
$ python manage.py runserver
  • open http://localhost:8000

In backend-only development mode:

  • set FRONTEND_DEV = False in settings.py
  • build static files
  • run python server
$ npm run build
$ python manage.py runserver
  • open http://localhost:8000

In production mode

  • set FRONTEND_DEV = False in settings.py
  • build static files
  • collect static files
$ npm run build
$ python manage.py collectstatic

In production with cdn

  • update STATIC_URL and FRONTEND_DEV in settings.py file.
STATIC_URL = 'http://cdn.mysite.com/static/'
FRONTEND_DEV = False
  • build static file
REACT_APP_PUBLIC_URL=http://cdn.mysite.com npm run build

you can see cdn branch of this repo for more detail.

the 💔 parts

problems that need your help.

I hope I see solution in next CRA version with running

PUBLIC_URL=http://localhost:3000 npm run start

hot reload problem

http://localhost:8000/sockjs-node/ not found in django.

images problem

CRA assets starts with /static/. so we need add http://localhost:3000 before them.

import logo from './logo.svg';
console.log(logo); // "/static/media/logo.5d5d9eef.svg"
<img src={(process.env.REACT_APP_PUBLIC_URL || '') + logo} alt="logo" />

what happen until now

create react app named cra-prj

$ create-react-app cra-prj

create django project named djcra

$ django-admin startproject djcra
$ mv djcra django_prj
echo 'Django==1.10.5' > django_prj/requirements.txt

I add some files to projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].