@@ -123,7 +123,8 @@ ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
123
123
>
124
124
> * First, we are going to create a random secret key.
125
125
> Open the Glitch terminal again, and type the following command:
126
- > {% filename %}.env{% endfilename %}
126
+ >
127
+ > {% filename %}command-line{% endfilename %}
127
128
> ```bash
128
129
> python -c 'from django.core.management.utils import get_random_secret_key; \
129
130
> print(get_random_secret_key())'
@@ -132,17 +133,20 @@ ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
132
133
> We will now paste this key into a `.env` file that Glitch will only show you if you are the owner of the web site.
133
134
>
134
135
> * Create a file ` .env ` at the root of your project and add the following property in it:
136
+ >
135
137
> {% filename %}.env{% endfilename %}
136
138
> ```bash
137
139
> # Here, inside the single quotes, you can cut and paste the random key generated above
138
140
> SECRET='3!0k#7ds5mp^-x$lqs2%le6v97h#@xopab&oj5y7d=hxe511jl'
139
141
> ```
140
142
> * Then update the Django settings file to inject this secret value and set the Django web site name:
143
+ >
141
144
> {% filename %}mysite/settings.py{% endfilename %}
142
145
> ```python
143
146
> SECRET_KEY = os.getenv('SECRET')
144
147
> ```
145
- > * And a little further, in the same file, we inject the name of your new Glitch website:
148
+ > * And a little further down in the same file, we inject the name of your new Glitch website:
149
+ >
146
150
> {% filename %}mysite/settings.py{% endfilename %}
147
151
> ```python
148
152
> ALLOWED_HOSTS = [os.getenv('PROJECT_DOMAIN') + ".glitch.me"]
0 commit comments