-
Notifications
You must be signed in to change notification settings - Fork 322
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
Static Files Won't Serve #248
Comments
Figured it out, posting here for any future people: pip install django_compressor and add it to installed apps and then changed
Now static files serve correctly |
Relying on I haven’t looked at the code, but assume that package is not tenant-aware. So if it is working now after adding These static files may or may not actually belong to the specific tenant that you are trying to access. Did you run |
That makes sense, thanks for the reply. Yes, I am first running |
I'm experiencing the same (or very similar) problem. I have noticed that the assets of the admin aren't loading based on the domain. Instead, they always load the URL of the first tenant that manages to make a GET request to the admin. So, if I restart Django's server and then open Example: |
Merged |
So, I'm working on the fix for this, but... we have a serious problem... The bug is threading-related... Somehow, somewhere, |
Just in order to keep everybody on track on this, this is where the bug happens:
the last line will create a new instances of the database wrapper, which is our So, basically, if there is only one thread, the middleware will correctly handle each domain, but if there are 2 or more threads, booom. |
Following the docs here: https://django-tenants.readthedocs.io/en/latest/files.html and can't get static files to serve
I run
python manage.py collectstatic_schemas --schema=tenant1
Static files gets copied to
my_proj_path/staticfiles/tenant1
but logging into the admin via the frontend still yields 404 with css/js files. within the tenant1 folder I see the normal djangoadmin
folder with the static resources.Chrome is looking for these files at (example:
http://tenant.localhost:8000/static/tenant1/admin/css/base.css
) which looks correct and the same as the folder structure where collectstatic_schemas is writing to.I believe I am following the docs very closely but can't get static files to serve. Any help would be appreciated
The relevant parts of my settings files are:
The text was updated successfully, but these errors were encountered: