Ich folge dem Django Heroku Tutorial. Ich bin an dem Punkt "Define config vars". Ich habe in meinem views.pydjango .env Datei funktioniert nicht wie das Tutorial erklärt es
import os
importiert und modifiziert es wie so
def index(request):
times = int(os.environ.get('TIMES',3))
return HttpResponse('Hello! ' * times)
I
python-getting-started\
getting-started\
hello\
.env
das Tutorial eine .env Datei erstellt sagt
heroku local will automatically set up the environment based on
the contents of the .env file in your local directory.
Edit the .env file to add:TIMES=2
If you run the app with heroku local, you’ll see two “Hello!”’s.
Nachdem ich es geändert habe, sehe ich immer noch dreimal 'Hallo'. Ich habe den lokalen Server dreimal neu gestartet, aber das hat nicht funktioniert. Ich möchte das zum Laufen bringen, damit ich alle fest codierten Dinge entfernen kann, die Variablen sein müssen, also ist meine App sicher. Was vermisse ich? Alle Anleitung ist willkommen.