Skip to content Skip to sidebar Skip to footer

Form Input-box Not Displaying

I'm trying to display a simple form input-text box with Django. I'm am deploying on Amazon AWS. The site works fine on a different server (pythonanywhere) but there is a major prob

Solution 1:

In my experience with Django, there are 2 things you often (always?) need to do to get static files to "refresh" after pushing them to a remote server:

  1. Run ./manage.py collectstatic to make sure all your static files are in the right place.
  2. While sshed into your server run the command sudo reboot now to restart your server (note that this will kick you out of your ssh session, and your server will be unreachable for a moment - usually just a few seconds in my case).

As for step 2 there might be a better way to do this, but in my experience, when I update static files the updated version is not served until I do this, and restarting nginx or the like is not sufficient for the changes to take effect. Note that this will mean that your site, if live, will not be reachable for a few seconds while the server is restarting (which is what makes me think there might be a better way to do it) but for me and my small user base this is not a big issue.

From reading some other posts about static files not updating, it seems like it could also be the case that your browser is caching the static files, and that restarting your browser/clearing the cache might do the trick as well, but I have not had a chance to try this yet.

Post a Comment for "Form Input-box Not Displaying"