Grand rewrite: Rewriting the web client from Django to Go

Posted on
Page
of 2
Prev
/ 2
  • @Velocio at some point we should have a little thread that explains how conceptually we'll deal with the form submissions.

    Form submits to the controller that will populate the model... the model produces the exact JSON that the API expects... we just POST it and handle the response.

    But yes... I should build one as an example that can be copied.

  • I assume there's some stuff missing like crsf tokens?

  • Yes... I needed to move the cookie to the Gorrilla securecookie first: https://github.com/gorilla/securecookie and that provides the basis for the second part which is https://github.com/gorilla/csrf .

  • Ok, I'll add the CSRF token middleware to my upcoming pull request and a dummy submit endpoint, just to prove it works

  • Merged.

    The PR is good, and this is how I imagined it to be implemented 👍

  • I didn't quite get to the point where I'd check microweb and construct the models from the post payload and send it to the API. It'd be easier if there was a reference endpoint I could copy ... all in good time.

    My next little project will be to remove jQuery from the simpleEditor.js file, although that's a much larger task than the previous files.

  • I was going to do more read-only stuff this afternoon, but it feels like getting comment replies working by writing the comment handler and finishing those models this afternoon would be a good use of my time.

    It won't get attachments working, but it would get comments working.

    (In the back of my head I wonder if that is true... the UI may actually not have an attachment handler and it may be calling the API directly... so it might get attachments working, I would have to check).

    It's lunch time here, am going for a walk and a gawp at the silence of London, will code this afternoon.

  • Note that I haven't accounted for the whole {% if not as_component %} code path. Not sure where that comes in, but figured we can make that work once we get to it.

  • The comment form now works, this resolves https://github.com/buro9/microcosm/issue­s/144

    {% if not as_component %} I'm not sure about this either... but like most things, high re-use means it's likely done somewhere... perhaps part of the Profile page? A Profile is really just a comment on a profile, so perhaps the form behaves differently there.

  • Testing the form!

  • And again

  • I haven't made any good progress this last week 😟

  • I wouldn't worry... I have been swamped this past week with work calls in the evenings for customers. So I've not looked at anything in about 10 days.

  • Deadline for this is end of November guys, so get a move on!

    "Why November?" you ask.

    No reason at all, but I figured you were missing out on the 'arbitrary deadline' dreamed up by people with no idea what you're doing. Enjoy! :)

  • Given that I can't sit much right now due to hip injury I am not contributing much.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Grand rewrite: Rewriting the web client from Django to Go

Posted by Avatar for Velocio @Velocio

Actions