You are currently viewing the new Anvil Editor Docs.
Switch to the Classic Editor Docs
You are currently viewing the Classic Editor Docs.
Switch to the new Anvil Editor Docs

Structuring your app

Anvil apps are made up of:

Client Side

Forms Packages Modules

Server Side

Server Packages Server Modules

Packages

Your app can be organised using Packages Client packages icon. Packages can contain Forms, Modules, and other Packages.

You can nest things inside Packages.

You can nest things inside Packages.

Forms can contain things

Forms Form icon can contain other Forms, as well as Modules and Packages. Technically, Forms are just Python Packages.

You can nest things inside Forms.

You can nest things inside Forms.

Server Modules and Server Packages

There are also Server Modules Server module icon and Server Packages Server packages icon. These are just like ordinary Modules and Packages, but they can only be run or imported on the server.

They are found in the ‘Server Code’ section of the App Browser.

Server Modules and Server Packages.

Server Modules and Server Packages.

Adding things

To add a new Form, Module or Package, click the three dots menu Three Dots Menu next to ‘Client Code’ or ‘Server Code’:

Or use the dropdown menu next to a Form or Package to add things inside it:

Adding things
inside a Package

Adding things
inside a Package

You can create new Server Modules and Server Packages in the same way:

Adding things
inside a Server Package

Adding things
inside a Server Package

Moving things

Drag-and-drop existing Forms, Packages and Modules to put them in a new place within your app structure:

Drag-and-drop to move things around.

Drag-and-drop to move things around.

If you move a Form, Module or Package, be sure to rewrite its imports and the imports of things that refer to it - the all-app search function can help you here.


Do you still have questions?

Our Community Forum is full of helpful information and Anvil experts.