- Add caveat about automatic changes to settings.py and git conflict
Because I missed the leading "." before "pythonanywhere.com" in settings.py my ALLOWED_HOSTS read:
ALLOWED_HOSTS = ["127.0.0.1", "pythonanywhere.com"]
This meant that the testing on the local development machine worked, but the deployed copy did not. I quickly realized the mistake, but since pa_autoconfigure_django.py had changed the "production" copy of settings.py, it was out of sync with the both my development machine and the hosted git repository.
Missing the leading "." seems like a potentially common mistake. So maybe that's where the tutorial should change, calling people's attention to that, instead.
@hjwp Should pa_autoconfigure_django.py make modifications to settings.py? Can this be avoided somehow?
@hjwp Should
pa_autoconfigure_django.pymake modifications tosettings.py? Can this be avoided somehow?
I'm not at PA any more, but you could open an issue at https://github.com/pythonanywhere/helper_scripts/issues/ ?
you could open an issue at https://github.com/pythonanywhere/helper_scripts/issues/
I've now filed pythonanywhere/helper_scripts#27
According to https://github.com/pythonanywhere/helper_scripts/issues/27#issuecomment-667152969, the PythonAnywhere's pa_autoconfigure_django.py was adapted, to not modify settings.py unless necessary, and with the settings.py content created in this tutorial such modification should indeed not be necessary, so no automatic modification should occur anymore.
Can we close this thus without merging? Or should we add instructions on how to make sure that indeed no modification occurred? (E.g. git diff or git status on PythonAnywhere) If the latter, what should those instructions recommend in case a modification did occur anyway? Commit on PythonAnywhere and push to GitHub and then pull it to the local repo?