You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this file we are creating a new Typer app instance for the version command. This is not required in single-file applications, but in the case of multi-file applications it will allow us to include this command in the main application using `add_typer`.
37
45
46
+
Let's see that next!
47
+
38
48
### Main Module (`main.py`)
39
49
40
50
The main module will be the entry point of the application. It will import the version module and the users module. We'll see how to implement the user module in the next section.
@@ -49,12 +59,38 @@ Let's now create the `users` module with the `add` and `delete` commands.
49
59
50
60
{* docs_src/splitting_apps/users/add.py *}
51
61
62
+
Like the `version` module, we create a new Typer app instance for the `users/add` command. This allows us to include the `add` command in the users app.
63
+
52
64
### Users Delete Command (`users/delete.py`)
53
65
54
66
{* docs_src/splitting_apps/users/delete.py *}
55
67
56
-
### Users' app
68
+
And once again, we create a new Typer app instance for the `users/delete` command. This allows us to include the `delete` command in the users app.
69
+
70
+
### Users' app (`users/__init__.py`)
71
+
72
+
Finally, we need to create an `__init__.py` file in the `users` directory to define the `users` app.
57
73
58
74
{* docs_src/splitting_apps/users/__init__.py *}
59
75
60
-
Similar to the `version` module, we create a new `Typer` app instance for the `users` module. This allows us to include the `add` and `delete` commands in the users app.
76
+
Similarly to the `version` module, we create a new `Typer` app instance for the `users` module. This allows us to include the `add` and `delete` commands in the users app.
77
+
78
+
## Running the Application
79
+
80
+
Now we are ready to run the application!
81
+
82
+
To run the application, execute the `main.py` file:
0 commit comments