Django or Anvil? Which One Should I Pick?

I am starting a new web development project. Should I learn Django which has multiple components or something like Anvil which is strictly Python? Which one would be faster in terms of loads? Is Anvil scalable? Not sure how to approach this. Let me know if anyone has done this or has any insight. Thanks.

Hi,

What kind of web application are you building? This might allow folks to be more specific with their answers.

People around here feel that Anvil is pretty hard to beat. Anvil is a paradox: easy to use and incredibly powerful.

ā€¦cue the outpouring of love for Anvil :heart:.

1 Like

Letā€™s just say, Iā€™ve written a few django apps in my time (and Ruby on rails and .Net apps too). I even once gave a talk at DjangoCon Europe on why I thought it was the best choice available to me at the time.

I wonā€™t be going back to any of them any time soon!

3 Likes

Ditto on the question about the type of web application.

Iā€™d pick Anvil over anything else for a web app that doesnā€™t need to be indexed by search engines, hands-down. My level of productivity is far higher with Anvil than with any other framework Iā€™ve tried, in any language.

If I needed more of a CMS site with public pages that should be indexed by search engines, Iā€™d go with something other than Anvil. Anvilā€™s lack of non-hash based URLs makes that sort of site problematic, at least for me.

My current project is a combination of a site that must be indexed and a web app that does not. The site doesnā€™t need to be modified by anyone but me, so doesnā€™t need a web based CMS, so Iā€™m using a static site generator for it. Then Anvil is being used for the web app.

4 Likes

If you know how to manage a server, administer a database, are an expert in security, css, html, javascript and have experience building sites with Django, I strongly advise you to use Anvil to create a proof of concept / prototype. Then, once you have a working site, if you realize that Anvil has limitations, you can go the full stack way to build the few pieces that will get you were Anvil will not (see @jshaffstallā€™s answer) .

If you are not an expert in all the things listed above, I strongly advise you to start with Anvil and stay with Anvil.

Trying to be a full stack developer without being an expert on all the steps is fun (thatā€™s why I tried it), but has a long learning curve (thatā€™s why I use Anvil, I like to use my time being productive rather than managing all the moving parts), and cutting corners can be dangerous (knowing that a team of experts is keeping the Anvil framework secure feels safer than trying to keep up with the vulnerability of the day)

4 Likes

The web application would be based on algorithmic trading of different asset classes (stocks, bonds, commodities, crypto, etc.) using machine learning and AI to predict direction and rank those assets according to probabilities.

Wow, a lot of great replies from everyone.

@owen.campbell very powerful statement you made about Anvil.

@jshaffstall the site would not be indexed so Anvil should fit the bill.

My only concern is Anvil does the conversions for you (HTML, CSS, Javascript, etc.). It is not Python only. Just leaves the complexities of the web to the tool. Am I misinterpreting that statement? I feel like I need to know exactly how all the pieces fit and work together especially where security is concerned.

Browsers speak html, css and javascript.
Servers speak http(s).
Databases speak sql.
Etc,etc, you get the gist.

You drag and drop UI components and write python code, Anvil translates your drag and drops and your python bits to whatever language / protocol / technology each bit needs to be translated to.

In other words you canā€™t get html, css, sql, http, javascript, etc. out of your web app, but using Anvil you donā€™t need to deal with them.

I definitely understand that impulse. My difficulty in following it lies in the sheer number of layers, and the complexity of the connections between them. Ultimately you end up at the hardware level, only to discover that, since SPECTRE et al, even that canā€™t be guaranteed.

As a practical matter, there is usually some horizon beyond which we have to trust the infrastructure weā€™re using, to some extent ā€“ or not use it. Mostly, that horizon is defined by the time available for learning those ins and outs, in depth. Then, thereā€™s the cost of keeping up with it, because itā€™s constantly changing.

If you want (or need) to head down that rabbit hole, Anvil is based, in large measure, on a Python-to-Javascript transpiler named Skulpt. The Anvil folks contribute to it on a semi-regular basis, so itā€™s one of those ā€œconstantly changingā€ elements.

This statement in a " Django or Anvil?" post makes very little sense.

If the post was ā€œDjango + Skulpt or Anvil?ā€ then I would list all the goodies that come with Anvil and not with Django: graphic form editor, hosting, security, user management, etc. Yes, all those goodies are available in a way or the other in Django too, and with Django you can do much more than what you can do with Anvil, but you have to do it. In Anvil all of those things are there for you to use. It just works.

So, please donā€™t think of Anvil as a Django with Skulpt. Itā€™s much much more than that.

Youā€™re right, of course. There is much more to Anvil. I meant only to suggest a starting point ā€œIf you want (or need) to head down that rabbit holeā€.

1 Like

Meredyddā€™s recent response in a different thread addresses this concern:

3 Likes

If you go to django, flask, laravel, expressjs, hapijsā€¦ forum and ask the same question you will get the same answer, the framework of that forum.

So, I try to give an unbiased answer.

In terms of dev time, nothing beat Anvil. Also, you really feel enjoyable when working with Anvil as well, it just works.

But there are few things to be considered. The cloud IDE, which is awesome, is the only place to code. While you can find some way to code without it, it is quite tricky.

The cloud host Anvil is the only PaaS option, and the open source Anvil require sysadmin skills to manage servers, security updateā€¦ Good news is docker can be used to deploy anvil app.

Furthermore, the open source Anvil doesnā€™t have much contribution from the community and if there is issue, a pull request need to sign CLA, which is unfortunately not available now.

Furthermore, I am not 100% confident using the open source Anvil in production given the basic issues it has (for example above link). Http-kit, not a production ready server, is used. It seems for dev, not for production.

So using cloud Anvil for production is the only option.

With django, you are free to choose IDE, cloud providers, most importantly, it is battle tested, easy to find jobs, a lot of book and resources to learn.

So, I use Anvil for line of business apps using inside the company firewall and django for critical mission apps.

Final thought, without Anvil, I cannot make tons of amazing apps fast, easy and enjoyable. I really wish that I can use Anvil open source in production.

2 Likes

It takes days to learn Anvil, but weeks or even months to learn Django. So learn Anvil first.

From UI, UX pount if view, Anvil is much faster since it is SPA.

Yes, with cloud version


After mastering Anvil, working with Django / Laravel / ExpressJs / RoR / Asp core ā€¦ is pain in the ass. Every line of code makes me miss Anvil.

3 Likes

Wow! These facts are scary.

Iā€™m checking out Anvil to see what it can do.

One of the main attractions for me was to be able to host Anvil on a provider of my choosing.

Based on this, it looks like Iā€™d have no other choice but to host my production applications on Anvil cloud servers.

If I use Anvil, I have every intention of supporting Anvil. But, I wouldnā€™t want to be stuck on Anvil servers if my business needs change.

@owen.campbell
Owen, did you rewrite the application of your DjangoCon talk already in Anvil? Just curieusā€¦

If you have Team of developpers who will do Front-end, Data base and Networking security go with Django but if you are alone just star with your ideas try Anvil and build working successful application then decide may be you will want something better.
Team means investment = Number of memebers X Salary +Office+Compyuters + additional costs = aprox 20kUSD per montch)

1 Like