Comments (11)
@wjstarrsiii thank you for reporting this. Could you give a look to #74 please? Let me know if it helps...
from django-maintenance-mode.
I put the FORCE_SCRIPT_NAME in place and have all of my application urls, reverse lookups, and functionality working properly with it after some fiddling around. Now /app/maintenance-mode/on/ and /off/ are properly setting the state file, but the resulting redirect takes me to the server root (RHEL apache Test Page). And even if maintenance-mode is on, absolutely nothing is being redirected to the 503 page.
from django-maintenance-mode.
It looks like the PR is trying to resolve the redirect after setting maintenance mode issue, but I don't see anything about the core functionality failing to redirect to 503.
from django-maintenance-mode.
Just to be sure nothing funny was going on with my whitelist pattern matching, I temporarily removed all IGNORE_URLS, it should redirect everything but it still redirects nothing.
from django-maintenance-mode.
@wjstarrsiii could you test if PR #75 solves your problem?
from django-maintenance-mode.
Update... I changed the testing server and moved the application to the root /. WSGIAlias is now /, and FORCE_SCRIPT_NAME is "". there are no whitelisted URL patterns. The application functions fine. the maintenance-mode/ urls still work to set the state but don't redirect properly. Still nothing is redirected to 503 when maintenance mode is set. Might not be related to script_name after all.
from django-maintenance-mode.
It means that this function (called by the middleware) return an unexpected result... if you want to debug the reason you can add some logs before each return statement to identify which one is the cause.
from django-maintenance-mode.
It turns out I am a moron. I put logging all throughout http.py and middleware.py, and nothing was logged. Then I noticed that due to other differences between dev and testing I had restated completely the MIDDLEWARE setting in the testing config. Did I put this middleware in there? Of course not. Now everything is working as expected without a script name in the URL. I suppose I will try to turn that on and off later if I want to / need to put the app back into a virtual directory. Thank you for your help.
from django-maintenance-mode.
@wjstarrsiii don't worry, it happens :)
Since you did some tests with FORCE_SCRIPT_NAME
, if you can give some contribute on #74 / #75 it will be appreciated.
from django-maintenance-mode.
I was never able to get anywhere with FORCE_SCRIPT_NAME, some of the internal django redirects were malformed, after research it seems that that is not a straightforward option to use. I may proceed instead using a sub-domain instead of virtual directory so the dynamic portion of urls are not affected.
from django-maintenance-mode.
I never used it, frankly I always use a subdomain in these cases. Thank you for the feedback!
from django-maintenance-mode.
Related Issues (20)
- Add new setting to expire the user session HOT 4
- ModuleNotFoundError: 'utils.middleware.maintenance' While running testcases HOT 1
- Add Django Cache Backend HOT 2
- Support JSON content type HOT 2
- `set_maintenance_mode` should use atomic write. HOT 8
- `manage.py maintenance_mode on/off` changes permissions of state file HOT 12
- Inherit state file permissions from the directory where it is created.
- File Write Errors on Windows Systems HOT 6
- Banner for all templates to warn users when maintenance will be HOT 1
- 404 Not Found Error When SCRIPT_NAME Defined HOT 10
- FileNotFoundError with default settings HOT 1
- IGNORE_IP not working HOT 6
- CommandError: Unable to write state file at: maintenance_mode_state.txt HOT 1
- force_maintenance_mode_off doesn't work for AJAX requests HOT 1
- Problem with ipware version HOT 1
- Unable to use with s3 storage HOT 4
- Add maintenance mode toggler in the admin site HOT 1
- MAINTENANCE_MODE_STATE_FILE_PATH setting bug HOT 2
- Drop `Python < 3.8` and `Django < 2.2` support.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-maintenance-mode.