Skip to content

Commit 13cdebb

Browse files
committed
LICENSE and README
1 parent 3833c6a commit 13cdebb

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Adi Luhung Suryadi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# django-react-ssr-demo
2+
Django project backed React.js SPA with server-side rendering enabled
3+
4+
Django parts that might interest you are `greet/view.py` and `greet/urls.py`.
5+
6+
The react.js SPA code are inside `client` directory, it uses webpack to make the bundle. The part that being use to render the generated code are `client/server.js` and `client/ServerRenderer.js`
7+
8+
The project inspired by this [article](https://www.beaconreader.com/beacon-engineering-blog/rendering-react), but instead of uses Tornado, this project uses Django, and more recent React + React-Router API that changed quite a bit.
9+
10+
## Django part
11+
```pip install -r requirements.txt``` - install python packages (use virtualenv is recomended)
12+
13+
```python manage.py runserver``` - run django server in localhost:8000
14+
15+
## React + SSR parts
16+
17+
```cd client``` - generate bundle and output it in /static for django
18+
19+
```npm install``` - install node packages dependencies
20+
21+
```npm run build``` - update generate bundle and output it in /static (if needed)
22+
23+
```npm start``` - run node.js server for server-rendering (localhost:8081)
24+
25+
Go to localhost:8000, view source and Voila!
26+
27+
## How it work in details
28+
TODO

0 commit comments

Comments
 (0)