On Thursday, August 25, 2022 at 1:54:53 PM UTC+7 MikeOl...@open4businessonline.com wrote:
>>> import mysite.mymiddleware.DoseControllerMiddleware
Traceback (most recent call last):
File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'mysite.mymiddleware'
>>> import mymiddleware.DoseControllerMiddleware
Traceback (most recent call last):
File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'mymiddleware'
>>>hmmmOn Thursday, August 25, 2022 at 2:48:15 PM UTC+8 Mike Oliver wrote:Ok will try the shellOn Thursday, August 25, 2022 at 2:00:33 PM UTC+8 bboy...@gmail.com wrote:Ur config with me are the same.But i put it in the bottom of the middlewareMIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware","django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",Think you should try by shell to make sure you can call it, or importable `from mysite.mymiddleware import DoseControllerMiddleware`. Shell very helpful."chuthe.middlewares.supervisor.ChutheIOMiddleware",
]On Thu, Aug 25, 2022 at 11:09 AM Mike Oliver <MikeOl...@open4businessonline.com> wrote:Currently, I have/mysite/mymiddleware.pysettings.pyMy CustomMiddlware class looks like...class DoseControllerMiddleware(object):def process_request(self, request):"""get ready to call the Dose Controller"""print("DoseControllerModdleware.process_request Hooray")return None
my settings has...MIDDLEWARE = ['django.middleware.security.SecurityMiddleware','django.contrib.sessions.middleware.SessionMiddleware','mysite.mymiddleware.DoseControllerMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware',]runserver gives me...ModuleNotFoundError: No module named 'mysite.mymiddleware'--On Thursday, August 25, 2022 at 12:04:55 PM UTC+8 Mike Oliver wrote:Well I have continued to search and now I see that CustomMiddleware will do what I want, but I cannot find a current example and some of the StackOverflow answers are old and not working in the latest Django.On Thursday, August 25, 2022 at 10:23:41 AM UTC+8 bboy...@gmail.com wrote:Could you tell us more detail of process flow?On Wed, 24 Aug 2022 at 20:52 Mike Oliver <MikeOl...@open4businessonline.com> wrote:Hello,I want to follow a microservices architecture and have some shared services I can include in a process flow instead of the 1:1 View:ModelSuggestions?MO--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fea12690-f86e-4761-9aef-5be7358dea57n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a907da19-4a73-41c5-964d-67b0e67e91e5n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/218090cc-e61f-46f8-87f4-49249a1baa40n%40googlegroups.com.
No comments:
Post a Comment