an4s911 Posted Monday at 11:53 PM Posted Monday at 11:53 PM I have a django app setup in root dir /httpdocs. And I use git integration to pull latest changes to heliohost, but the changes aren't reflected immediately. It takes a really long time. And when I reload a page, sometimes it comes and sometimes it shows an error message for a previous change, means some kind of caching is playing here. I did reset all cache and tried again, but nothing fixes this. So do I have to wait till next day to test my backend? What should I do? This is very annoying. How can I reset the cache in all places, including in your servers. EDIT: PS: I use the tommy server. The new one.
wolstech Posted yesterday at 12:21 AM Posted yesterday at 12:21 AM Code is cached yes. See https://wiki.helionet.org/tutorials/django/django-on-heliohost It can take up to 2 hours to take effect after you push changes. If you're using WSGI, it's possible to request WSGI control access, which will let you manually clear the cache by editing the dispatch.wsgi file (you can literally just add a space or something, the timestamp changing triggers it). https://wiki.helionet.org/tutorials/django/django-on-heliohost#wsgi-uses-server-side-caching 1
an4s911 Posted yesterday at 03:34 PM Author Posted yesterday at 03:34 PM Can I just request it here, my username is an4s911 and I want control access to WSGI. Or do I need to open a new topic?
KazVee Posted yesterday at 03:51 PM Posted yesterday at 03:51 PM This topic is not marked as [Solved] so it's probably fine to ask here since it's a related request to the original problem you were having. 🙂 Since you only have the 1 domain on your account now, we have all the info we need to escalate the request. Once a root admin gives you WSGI Control Access, they'll update this thread to let you know. 1
Krydos Posted yesterday at 04:57 PM Posted yesterday at 04:57 PM WSGI control access has been enabled on the domain anasbashir.helioho.st. To restart your Django app and load new code changes in simply edit /home/anasbashir.helioho.st/httpdocs/anas/dispatch.wsgi. Adding a blank line, removing a blank line, adding a space, or removing a space are examples of editing the file. As long as the last modified timestamp changes it will clear the server cache. Let us know if you run into any issues. 1
an4s911 Posted yesterday at 05:52 PM Author Posted yesterday at 05:52 PM (edited) Alright, quick question. Does it have to be the dispatch.wsgi file? The reason I am asking is because as I mentioned I use git integration. So I have a remote gitlab repo connected to this site, and after I push changes to that repo, I pull it from plesk. So it does pull in multiple changes, so does that make a difference, or does it have to be the dispatch.wsgi file itself. so a followup question is, if it should be the dispatch.wsgi file, then can I just make the change while pushing to git, and that change will be pulled on plesk, and the dispatch.wsgi file would also change due to the git pull. Would that work as well? Edited yesterday at 05:53 PM by an4s911
an4s911 Posted yesterday at 05:58 PM Author Posted yesterday at 05:58 PM (edited) One more thing. The site doesn't seem to be working currently. When I go to https://anasbashir.helioho.st, it is supposed to show me "Hello, world!", but instead it gives me 500 Internal Server Error Edited yesterday at 06:02 PM by an4s911
wolstech Posted yesterday at 06:10 PM Posted yesterday at 06:10 PM ModuleNotFoundError: No module named 'djangotest' Code issue? The full log including traceback is visible in Plesk in the logs section
Krydos Posted yesterday at 06:53 PM Posted yesterday at 06:53 PM 59 minutes ago, an4s911 said: Does it have to be the dispatch.wsgi file? Experiment and let us know. The whole WSGI control access thing is pretty new so not that many people have tried it out yet. 1
an4s911 Posted yesterday at 07:08 PM Author Posted yesterday at 07:08 PM 15 minutes ago, Krydos said: Experiment and let us know. The whole WSGI control access thing is pretty new so not that many people have tried it out yet. Alright
an4s911 Posted yesterday at 07:10 PM Author Posted yesterday at 07:10 PM 58 minutes ago, wolstech said: ModuleNotFoundError: No module named 'djangotest' Code issue? The full log including traceback is visible in Plesk in the logs section I don't have anything called djangotest in my code. I believe I did use it before, but I'd removed it, can't remember exactly. But in the latest version of the code, it doesn't exist. On that note, if I do want to add additional python packages, what do I have to do?
Krydos Posted yesterday at 07:11 PM Posted yesterday at 07:11 PM Just now, an4s911 said: I don't have anything called djangotest in my code. Check your dispatch.wsgi file. 1 minute ago, an4s911 said: if I do want to add additional python packages, what do I have to do? Let us know what packages you want installed.
an4s911 Posted yesterday at 07:14 PM Author Posted yesterday at 07:14 PM 1 minute ago, Krydos said: Check your dispatch.wsgi file. I did, and it doesn't exist. This is the contents of my dispatch.wsgi file: import os import sys from django.core.wsgi import get_wsgi_application sys.path.append("/home/anasbashir.helioho.st/httpdocs") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anas.settings") application = get_wsgi_application() # vim:ft=python 1 minute ago, Krydos said: Let us know what packages you want installed. Alright, will do when I need to.
an4s911 Posted 23 hours ago Author Posted 23 hours ago (edited) UPDATE: the site works now. Thanks for all the help Edited 23 hours ago by an4s911 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now