Web development is pretty unwieldy. You need to master JS and HTML and CSS and Python (or Rails or Node) and a ton of frameworks.
Here are 12 reasons why building your front-end and back-end in Python is so great:
Running Python in the browser means you can modify your UI components in Python. Drag and drop them onto the page to build the user interface, then set their properties and call events on them from Python code.
Building the UI for a feedback form. Check out the tutorial!
In traditional web-dev, calling from the browser to the web server is a pain. You have to set up a URL route, smush all your data into JSON, set up the AJAX request, asynchronously get a response...so much work!
With Anvil, you just call a function. Add a decorator to any function, then just call the function from browser code. Pass Python objects as arguments; return Python objects. Job done.
Setting up and maintaining a database is a drag. So Anvil has a built-in database. Design your data tables graphically, then query or update rows with Python. (Can you return a lazy paginated query response to the browser, as a Python object? Of course you can! That would be dozens of lines of code in most web frameworks.)
Anvil is "serverless" - your code is automatically hosted in the cloud. But what if you want to run code on your computer? Just use the Uplink!
Connecting a Google Colab notebook to a web app
"Uploading a file" is basic functionality. So it must be simple in every web framework. Right? Surprise! Handling binary data -- like files, images, or PDFs -- is remarkably difficult in a traditional JS app. (If you're feeling mean, try saying '
enctype="multipart/form-data"' to a seasoned web developer. Watch them shiver.)
But Anvil makes it easy. All binary data (pictures, uploaded files, etc.) is represented as a Python object! You can pass binary data as an argument to a server function. You can store it in a Data Table. You can use it with Anvil components. For example, rendering and downloading a PDF is literally this simple:
# In a server module: @anvil.server.callable def get_pdf(): return anvil.pdf.render_form('Form1')
# In the browser: pdf = anvil.server.call('get_pdf') download(pdf)
Building user authentication is tedious, but deadly if you get it wrong! Half of the OWASP vulnerabilities are "ways you can get authentication wrong".
Anvil's built in User Service handles signup, login, and user permissions for you, out of the box. It takes one line of Python code to present your users with a signup form with email validation -- just call
Send an email with one line of code. Receive emails with one line of code! It's all built in with Anvil's Email service.
Building an app to receive email is so simple, we did it in a 4-minute video:
Did someone say "batteries included"? Create PDF documents with our drag-n-drop editor, then render and download them with a Python call.
Or just watch Bridget build and deploy a JSON API in 20 seconds:
Your Anvil app can easily connect to services from Google, Microsoft, Facebook, Stripe and more. Log your users in using Google, Microsoft and Facebook Single Sign-Ons, take payments with Stripe, or display interactive Google Maps.
You don't want to leave passwords lying around in your source code. The App Secrets service provides easy-to-use encrypted storage of sensitive data, like passwords or encryption keys.
Learn to store encrypted data with another 4-minute tutorial:
Anvil gives you all the power of Python, and none of the complexity of traditional web frameworks. If you're a Python developer, you can build full-stack web apps without needing anything else.
Anvil's runtime is open source, so you can take your app and deploy it anywhere. You don't even need our editor to create an Anvil app!