These are chat archives for django/django

13th
Apr 2017
John
@flyboy1565
Apr 13 2017 01:23
Depends on your database. Maybe split the URL first by the ? Then split the split by & then turn into a dictionary
Anish Shrestha
@annshress
Apr 13 2017 04:08
@ikhahmedov Solution would be not making your entire project an SPA. Rather break down your apps into a single SPA.
*Rather break down your apps into SPAs.
ikhahmedov
@ikhahmedov
Apr 13 2017 06:32

@annshress its already breaked down into single SPA's (by design), but each of them heavily relies on REST API, so far in my understanding, I should create an architecture like below:

  • Django handles request
  • if request came from user (determined by User-Agent) then send rendered templates (without touching JS part) after that web page will request data from API using AJAX
  • if request came from bot (google, yahoo, bing,...) logic inside django view creates HTTP request to NodeJS server (or to headless browser like PhantomJS) in the form of http://mydomain.com/requested_url?some_filter_data=x , which in turn NodeJS server will send this request back to Django server to get data from API and fill react components with this data and renders page, then returns to Django view

if this is the case, why should I use Django in the first place? if I must duplicate some logic in both sides (get_context_data but with REST API + AJAX)

can you guys recommend some kind of tutorial where this thing is described in detail, so that I can avoid stupid questions
ikhahmedov
@ikhahmedov
Apr 13 2017 06:49
thanks @teddy-error
Brian A.
@brjadams
Apr 13 2017 13:52
anyone worked with channels?
Miracle Ayodele
@iammiracle
Apr 13 2017 14:23
hi guys, what is the best way to implement comment my blog app
is it to develop a comment_app or integerate a comment system like disqus in my app
Miracle Ayodele
@iammiracle
Apr 13 2017 14:28
since django comment is gone
BosnaZmaj
@BosnaZmaj
Apr 13 2017 15:38
@koderNeptune I always liked to implement my own. But i guess it's personal preference more or less
Anish Shrestha
@annshress
Apr 13 2017 16:55
@brjadams you can always leave your question.
Federico Jaramillo
@federicojm_twitter
Apr 13 2017 23:39
@koderNeptune It is a matter of preference. Personally, I try not to reinvent the wheel, and unless there is a specific reason not to use disqus, I implement it as comment system every time I can. It just makes things easier.
federicojm_twitter @federicojm_twitter
jmfederico @jmfederico