New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change it to Origami
only.
README.md
Outdated
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
|
||
|
||
## Development Setup instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with ### Create a Virtual Environment
api/consumers.py
Outdated
|
||
|
||
def ws_disconnect(message): | ||
print (message.content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove the debug statement here?
api/views.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return a Response()
object.
api/views.py
Outdated
demo.footerMessage = body["footerMessage"] | ||
demo.coverImage = body["coverImage"] | ||
demo.terminal = body["terminal"] | ||
#demo.timestamp = body["timestamp"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this.
api/views.py
Outdated
return HttpResponse("Invalid URL") | ||
|
||
|
||
def getpermalink(request, shorturl): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with get_permalink
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hardcoding the URL like /login
, can we use the name of the URL here using reverse()
?
channel_routing = [ | ||
route("websocket.connect", ws_connect), | ||
route("websocket.receive", ws_message), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a newline here.
No description provided.