Jump to content

Recommended Posts

Posted

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.

Posted

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

  • Like 1
Posted

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. 

  • Like 1
Posted

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.

  • Like 1
  • Krydos changed the title to [Solved] Server update using git takes long time
Posted (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 by an4s911
Posted (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 by an4s911
Posted
ModuleNotFoundError: No module named 'djangotest'

Code issue?

The full log including traceback is visible in Plesk in the logs section

Posted
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.

  • Haha 1
Posted
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 :)

Posted
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?

Posted
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.

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...