Forums

Update PythonAnywhere Files from GitHub

I'm trying to update some files of my web app that I cloned in PythonAnywhere from Github, because the modifications that I do in my models.py don't save and they are not modified on the admin, so I want to update them from my gitHub. How can I do it? Thanks for your answers

I'm having trouble following what you're trying to change and where. Are you editing the models.py file? On PythonAnywhere or somewhere else? Are you adding records from the admin?

If you're editing the models.py file on PythonAnywhere, are you reloading the web app?

Sorry for my bad explanation. I'm editing my models.py file on PythonAnywhere, and the changes are not applied on the admin. For example, I modify the text max_length in the models.py, but in the admin it is not applied. Thanks for your attention

for db level changes you will probably have to migrate your database and reload your webapp.

+1 to what bfg says. Reloading the web app (on the "Web" tab) is probably the missing step here.

Do you have any idea how to migrate my models.py changes to db.sqlite3? When I'm using in BASH console: ,,python manage.py makemigrations <app_name>" I get: ,,no changes detected in <app_name> when I've already added field in my models.py and updated it to my github repository.

That certainly should work. You mention github -- did you add the field to models.py on the same machine as the one where you run makemigrations? If not, had you pulled the change from github first?

Nvm, I have written in pythonanywhere BASH console: "python3 manage.py ..." instead: "python manage.py" and it worked. Thanks anyway.

OK, glad you worked out a solution.