-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle mutliple urls.py #114
Comments
Finally, I figured out where the caching problem is. Somehow the cache isn't really cleared. If I change in sitetree.cache_init
to
it works fine. Do you have an idea, how to fix this Problem? |
Ok I was wrong. The caching works fine :) But I figured out where the caching problem is. After saving in Admin, the sitetree gets initiated, but in the Admin. Therefore, the urls.py of subdomains aren't recognized. I solved this issue by disabling the caching in the Admin. |
Hi, Unfortunatelly I have no clue on how does your initial problem relate to the given solution. |
I'm using the default cache ('BACKEND': 'django.core.cache.backends.locmem.LocMemCache',) I think the problem lays somewhere in the Admin. After a server restart, if the first load of the sitetree is in the Admin (which is located under the main site) eg. for editing the sitetree the sitetreeapp looks for the urls.py of the main site to resolve the patterns. But there are none because they are all in the subdomains urls.py which is not loaded. If I then go to the subdomains site, the sitetree is already cached with unresolved urls. If the sitetree doesn't get cached in the Admin, it gets reloaded on the first load of the subdomains with the correct urls.py and therefore the urls are resolved. My problem was, that I was changing a sitetree item of the subdomains sitetree in the Admin and then I was redirected to the overview of this sitetree in the Admin. After saving, the cache was cleared but because I was redirected to this overview, the sitetree gets cached immediately but with the wrong urls.py. Therefore I disabled caching in the Admin. |
I see your point. I should take a closer look into |
Hey there,
I'm using django-subdomains and django-sitetree in the same project. Therefore, I have 2 differenet urls.py. Eg. one for www.example.com (here is also admin) and one for subdomain.example.com. On both, I have included a sitetree, but different ones.
If I start the server, everything works fine. But if I change the sitetree in django admin, only the sitetree on the site with admin works fine and the urls are resolved. On the subdomain the sitetree shows up but the urls aren't resolved. If the server reloads, eg. due to changes in the code, the sitetree on the subdomain works again.
I tried to figure out how what happens on a reload, but I couldn't. Could you give me hint, what I can do to fix my problem?
Best wishes
The text was updated successfully, but these errors were encountered: