Django Channels + React along with API translation#46
Conversation
…igami into socket-translate-api
| let socket = this.socket; | ||
| socket.send( | ||
| JSON.stringify({ | ||
| event: "fetchcurrentport" |
There was a problem hiding this comment.
Can we change fetchcurrentport to fetchCurrentPort? Basically please follow the camel casing.
README.md
Outdated
| @@ -0,0 +1,52 @@ | |||
| # Origami Webapp | |||
There was a problem hiding this comment.
Let's change it to Origami only.
README.md
Outdated
| [](https://github.com/prettier/prettier) | ||
|
|
||
|
|
||
| ## Development Setup instructions |
There was a problem hiding this comment.
Replace with ## Development setup instructions
README.md
Outdated
|
|
||
| **This application requires node v5+ and Python 2.7/3.4+** | ||
|
|
||
| ### Create a Virtual Environment: |
There was a problem hiding this comment.
Replace with ### Create a Virtual Environment
api/consumers.py
Outdated
|
|
||
|
|
||
| def ws_disconnect(message): | ||
| print (message.content) |
There was a problem hiding this comment.
Can you please remove the debug statement here?
| demo = Demo.objects.get(id=demo_id) | ||
| base_comp_id = body["baseComponentId"] | ||
| props = [] | ||
| for prop in body["props"]: |
There was a problem hiding this comment.
Use serializers to serialize the data.
api/views.py
Outdated
| try: | ||
| component = model.objects.get(userid=userid, demo=demo) | ||
| except Exception as e: | ||
| return JsonResponse({}) |
There was a problem hiding this comment.
Please send a json to frontend instead of blank dict.
api/views.py
Outdated
| coverImage=coverImage, terminal=terminal, timestamp=timestamp, | ||
| token=token, status=status) | ||
| serialize = DemoSerializer(demo) | ||
| return JsonResponse(serialize.data) |
api/views.py
Outdated
| demo.footerMessage = body["footerMessage"] | ||
| demo.coverImage = body["coverImage"] | ||
| demo.terminal = body["terminal"] | ||
| #demo.timestamp = body["timestamp"] |
api/views.py
Outdated
| return HttpResponse("Invalid URL") | ||
|
|
||
|
|
||
| def getpermalink(request, shorturl): |
| tmp.save() | ||
| acc.user = tmp | ||
| acc.save() | ||
| return HttpResponseRedirect('/login?status=passed&token=' + token.token + '&username=' + tmp.username + '&user_id=' + str(tmp.id)) |
There was a problem hiding this comment.
Instead of hardcoding the URL like /login, can we use the name of the URL here using reverse()?
django_server/routing.py
Outdated
| channel_routing = [ | ||
| route("websocket.connect", ws_connect), | ||
| route("websocket.receive", ws_message), | ||
| ] No newline at end of file |
No description provided.