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
Copy file name to clipboardExpand all lines: docs/hosting/deploy-quick-start.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Reflex’s hosting service makes it easy to deploy your apps without worrying ab
17
17
18
18
### Prerequisites
19
19
20
-
1. Hosting service requires `reflex>=0.3.2`.
20
+
1. Hosting service requires `reflex>=0.6.5`.
21
21
2. This tutorial assumes you have successfully `reflex init` and `reflex run` your app.
22
22
3. Also make sure you have a `requirements.txt` file at the top level app directory that contains all your python dependencies!
23
23
@@ -43,7 +43,13 @@ reflex deploy
43
43
44
44
The command is by default interactive. It asks you a few questions for information required for the deployment.
45
45
46
-
**Name**: choose a name for the deployed app. This name will be part of the deployed app URL, i.e. `<app-name>.reflex.run`. The name should only contain domain name safe characters: no slashes, no underscores. Domain names are case insensitive. To avoid confusion, the name you choose here is also case insensitive. If you enter letters in upper cases, we automatically convert them to lower cases.
46
+
**Name**: choose a name for the deployed app. This name will be part of the deployed app URL, i.e. `<app-name>-randomword-randomword.reflex.run`.
47
+
48
+
The name should only contain domain name safe characters: no slashes, no underscores.
49
+
50
+
```md alert info
51
+
# Custom domains are available for paid plans.
52
+
```
47
53
48
54
**Regions**: enter the region code here or press `Enter` to accept the default. The default code `sjc` stands for San Jose, California in the US west coast. Check the list of supported regions at [reflex deployments regions](#reflex-deployments-regions).
49
55
@@ -52,13 +58,7 @@ The command is by default interactive. It asks you a few questions for informati
52
58
That’s it! You should receive some feedback on the progress of your deployment and in a few minutes your app should be up. 🎉
53
59
54
60
```md alert info
55
-
# Once your code is uploaded, the hosting service will start the deployment. After a complete upload, exiting from the command **does not** affect the deployment process. The command prints a message when you can safely close it without affecting the deployment.
56
-
```
57
-
58
-
The hosting service does not currently handle database or file upload operations. It is necessary to set up an external database use it within your app.
59
-
60
-
```md alert info
61
-
# If you want to deploy on a custom URL we recommend using https://redirect.pizza
61
+
# The hosting service does not currently handle database or file upload operations. Set up an external database and use it within your app.
@@ -56,25 +56,8 @@ To redeploy or update your app, navigate to the project directory and type `refl
56
56
57
57
All the `reflex` commands come with a help manual. The help manual lists additional command options that may be useful. You type `--help` to see the help manual. Some commands are organized under a `subcommands` series. Here is an example below. Note that the help manual may look different depending on the version of `reflex` or the `reflex-hosting-cli`.
list List all the hosted deployments of the authenticated user.
73
-
logs Get the logs for a deployment.
74
-
regions List all the regions of the hosting service.
75
-
status Check the status of a deployment.
76
-
"""
77
-
)
59
+
```bash
60
+
reflex deployments --help
78
61
```
79
62
80
63
### Authentication Commands
@@ -83,13 +66,8 @@ Commands:
83
66
84
67
When you type the `reflex login` command for the very first time, it opens the hosting service login page in your browser. We authenticate users through OAuth. At the moment the supported OAuth providers are Github and Gmail. You should be able to revoke such authorization on your Github and Google account settings page. We do not log into your Github or Gmail account. OAuth authorization provides us your email address and in case of Github your username handle. We use those to create an account for you. The email used in the original account creation is used to identify you as a user. If you have authenticated using different emails, those create separate accounts. To switch to another account, first log out using the `reflex logout` command. More details on the logout command are in [reflex logout](#reflex-logout) section.
After authentication, the browser redirects to the original hosting service login page. It shows that you have logged in. Now you can return to the terminal where you type the login command. It should print a message such as `Successfully logged in`.
@@ -108,55 +86,8 @@ This is the command to deploy a reflex app from its top level app directory. Thi
108
86
109
87
A `requirements.txt` file is required. The deploy command checks the content of this file against the top level packages installed in your current Python environment. If the command detects new packages in your Python environment, or newer versions of the same packages, it prints the difference and asks if you would like to update your `requirements.txt`. Make sure you double check the suggested updates. This functionality is added in more recent versions of the hosting CLI package `reflex-hosting-cli>=0.1.3`.
110
88
111
-
```python eval
112
-
doccmdoutput(
113
-
command="reflex deploy",
114
-
output="""Info: The requirements.txt may need to be updated.
115
-
--- requirements.txt
116
-
+++ new_requirements.txt
117
-
@@ -1,3 +1,3 @@
118
-
-reflex>=0.2.0
119
-
-openai==0.28
120
-
+openai==0.28.0
121
-
+reflex==0.3.8
122
-
123
-
Would you like to update requirements.txt based on the changes above? [y/n]: y
124
-
125
-
Choose a name for your deployed app (https://<picked-name>.reflex.run)
126
-
Enter to use default. (webui-gray-sun): demo-chat
127
-
Region to deploy to. See regions: https://bit.ly/46Qr3mF
128
-
Enter to use default. (sjc): lax
129
-
Environment variables for your production App ...
130
-
* env-1 name (enter to skip): OPENAI_API_KEY
131
-
env-1 value: sk-*********************
132
-
* env-2 name (enter to skip):
133
-
Finished adding envs.
134
-
──────────────── Compiling production app and preparing for export. ────────────────
Your site [ demo-chat ] at ['lax'] is up: https://demo-chat.reflex.run
158
-
""",
159
-
)
89
+
```bash
90
+
reflex deploy
160
91
```
161
92
162
93
The deploy command is by default interactive. To deploy without interaction, add `--no-interactive` and set the relevant command options as deployment settings. Type `reflex deploy --help` to see the help manual for explanations on each option. The deploy sequences are the same, whether the deploy command is interactive or not.
@@ -213,52 +120,16 @@ The returned logs are the messages printed to console. If you have `print` state
213
120
214
121
We have added more options to this command including `from` and `to` timestamps and the limit on how many lines of logs to fetch. Accepted timestamp formats include the ISO 8601 format, unix epoch and relative timestamp. A relative timestamp is some time units ago from `now`. The units are `d (day), h (hour), m (minute), s (second)`. For example, `--from 3d --to 4h` queries from 3 days ago up to 4 hours ago. For the exact syntax in the version of CLI you use, refer to the help manual.
215
122
216
-
```python eval
217
-
doccmdoutput(
218
-
command="reflex deployments logs todo",
219
-
output="""Note: there is a few seconds delay for logs to be available.
2023-10-13 22:18:46.210583 | rxh-dev-todo | info | Configuring firecracker
225
-
2023-10-13 22:18:46.434645 | rxh-dev-todo | info | [ 0.042971] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
226
-
2023-10-13 22:18:46.477693 | rxh-dev-todo | info | [ 0.054250] PCI: Fatal: No config space access function found
227
-
2023-10-13 22:18:46.664016 | rxh-dev-todo | info | Configuring firecracker
228
-
""",
229
-
)
123
+
```bash
124
+
reflex deployments logs todo
230
125
```
231
126
232
127
#### reflex deployments build-logs `app-name`
233
128
234
129
Get the logs of the hosting service deploying the app.
The hosting service prints log messages when preparing and deploying your app. These log messages are called build logs. Build logs are useful in troubleshooting deploy failures. For example, if there is a package `numpz==1.26.3` (supposed to be `numpy`) in the `requirements.txt`, hosting service will be unable to install it. That package does not exist. We expect to find a few lines in the build logs indicating that the `pip install` command fails.
0 commit comments