Code Monkey home page Code Monkey logo

Comments (11)

fabiocaccamo avatar fabiocaccamo commented on July 4, 2024

@wjstarrsiii thank you for reporting this. Could you give a look to #74 please? Let me know if it helps...

from django-maintenance-mode.

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

fabiocaccamo avatar fabiocaccamo commented on July 4, 2024

@wjstarrsiii could you test if PR #75 solves your problem?

from django-maintenance-mode.

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

fabiocaccamo avatar fabiocaccamo commented on July 4, 2024

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.

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

fabiocaccamo avatar fabiocaccamo commented on July 4, 2024

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

wjstarrsiii avatar wjstarrsiii commented on July 4, 2024

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.

fabiocaccamo avatar fabiocaccamo commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.