tutorial icon indicating copy to clipboard operation
tutorial copied to clipboard

- Add caveat about automatic changes to settings.py and git conflict

Open kjcole opened this issue 5 years ago • 4 comments

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.

kjcole avatar Feb 08 '20 17:02 kjcole

@hjwp Should pa_autoconfigure_django.py make modifications to settings.py? Can this be avoided somehow?

das-g avatar Jul 12 '20 21:07 das-g

@hjwp Should pa_autoconfigure_django.py make modifications to settings.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/ ?

hjwp avatar Jul 30 '20 13:07 hjwp

you could open an issue at https://github.com/pythonanywhere/helper_scripts/issues/

I've now filed pythonanywhere/helper_scripts#27

das-g avatar Jul 30 '20 14:07 das-g

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?

das-g avatar Feb 19 '21 19:02 das-g