4 ms·
Yeah, the current web frameworks on Golang seem to be quite...chaotic to an outsider. And the landscape is constantly changing. It's not like Ruby or Python, w
by victorhooi 12y ago
Yeah, the current web frameworks on Golang seem to be quite...chaotic to an outsider. And the landscape is constantly changing.
It's not like Ruby or Python, which seem to have one clear mature do-everything framework, and some more lightweight ones beneath.
Is there such a thing as a Django-equivalent in Golang at this point in time? Or what's the closest analogue? None of them seem to package an ORM together, so not sure what people tend to do here, to reduce boilerplate code in their models.
- quaunaut 12y agoPart of the issue there is that Golang doesn't have any mature ORM-type packages. The one I've heard the most about is [Gorp](https://github.com/coopernurse/gorp https://github.com/coopernurse/gorp), but none of the current Golang web libraries really sanction anything- but that's part of Go's nature. Go by default doesn't encourage big frameworks. It encourages you to use the rather well-built standard libraries to get most things done, and do the rest of the augmentation yourself. However, as it's being looked at more and more as a great systems language, people are building bigger, more frameworky systems in it all the time, and as a result it's getting friendlier. It's going to be chaotic no matter what for the next year, but that's how new languages, especially popular ones, are. If you're looking for easy choices, it might be better to wait for now. If you want to get your hands dirty, I guarantee you'll find something you want if you keep looking, or you'll get good enough to run with it yourself. (Just be sure you know your web basics to do webdev on it, as no one is going to hold your hand in Goland.)
- crucialfelix 12y agoFor many years in python there were several contenders for webframeworks. Only after many years did Django eventually dominant. I've used Django a lot and personally I would prefer smaller lightweight frameworks where its easier to select packages that provide solutions to specific problems. I'm not looking for the next Django. Something the size of Express would be perfect.
- jarpineh 12y agoI love Django for its docs and sensible defaults to just about everything. I've been reading the Light Weight Django book, now nearing completion at O'Reilly, and Django can be used as lightly as Express. I'd link to source example, but I can't find the code anywhere and the ebook is not on this device... I don't know if it's lighter than regular Django in terms of speed, but by the measure of how much you need to code you can't do much better. Couple of pain points are declaring settings for middleware and template processors, even when you don't really need them, but other than that it is really basic. This is your URL pattern, this is your view function to call when a request comes for such URL. From there you can do what you want with the request, as long as you convert your response to Django's HttpResponse object (which takes a string). For something a bit different, I recommend taking a look into Morepath: http://morepath.readthedocs.org/en/latest/ http://morepath.readthedocs.org/en/latest/ It looks to have some genuine useful parts from Zope, rethought for today's more RESTful, Javascripted world. My next personal project will probably use it as a base.
- BerislavLopac 12y agoThis sounds a lot like Flask.