django fails, sometimes, very erratic behavior

后端 未结 3 1095
忘了有多久
忘了有多久 2021-01-27 07:37

I have terrible problems with django responding differently to the same requests for no apparent reason.

Sometimes i refresh and I see an error, then I refresh and its g

相关标签:
3条回答
  • 2021-01-27 07:49

    Are you storing state in global variables? If so, the response will differ depending on previous requests to the same process.

    Rest assured, Django is used reliably by thousands of sites every day. Your problem is not endemic to Django.

    0 讨论(0)
  • 2021-01-27 08:05

    You need to show your views code if you think the issue lies there. Otherwise we can only guess at what the problem might be.

    0 讨论(0)
  • 2021-01-27 08:11

    Unfortunately it sounds as though you're suffering from a common problem overload. It's hard to figure out exactly what's happening when there's so many things that are wrong.

    When it gets complicated, sometimes the best solution is to follow a KISS development method. Write small bits of code, and test them to make sure they work as intended.

    If you're worried about WSGI, get a small, simple project running first. Then introduce layers of complexity to try and isolate where the issue begins to occur; providing a great way to resolve the error.

    Utilise the python unittest.TestCase module and doctests to help you with the python side of error checking.

    All the best! :)

    0 讨论(0)
提交回复
热议问题