File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
123123>
124124> * First, we are going to create a random secret key.
125125> Open the Glitch terminal again, and type the following command:
126+ >
126127> {% filename %}.env{% endfilename %}
127128> ```bash
128129> python -c 'from django.core.management.utils import get_random_secret_key; \
@@ -132,17 +133,20 @@ ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
132133> 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.
133134>
134135> * Create a file ` .env ` at the root of your project and add the following property in it:
136+ >
135137> {% filename %}.env{% endfilename %}
136138> ```bash
137139> # Here, inside the single quotes, you can cut and paste the random key generated above
138140> SECRET='3!0k#7ds5mp^-x$lqs2%le6v97h#@xopab&oj5y7d=hxe511jl'
139141> ```
140142> * Then update the Django settings file to inject this secret value and set the Django web site name:
143+ >
141144> {% filename %}mysite/settings.py{% endfilename %}
142145> ```python
143146> SECRET_KEY = os.getenv('SECRET')
144147> ```
145148> * And a little further, in the same file, we inject the name of your new Glitch website:
149+ >
146150> {% filename %}mysite/settings.py{% endfilename %}
147151> ```python
148152> ALLOWED_HOSTS = [os.getenv('PROJECT_DOMAIN') + ".glitch.me"]
You can’t perform that action at this time.
0 commit comments