Re: I am unable to view images in webpage which is given in html
Can you share the code? On Wednesday, November 2, 2022 at 3:11:37 PM UTC+3 MaheshKumar wrote: > I have given the photos in the database but it does not displays in the > webpage. > > [image: Screenshot (25).png] > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f21b5c2-9001-4683-a645-eecaab4dff19n%40googlegroups.com.
Re: Need to pick up easy task in repo
Hi, you will need to first understand how to use Django, then you will see which parts need improvements. Then you make the improvements and push the changes for review and addition to the main Django Repository. If you are new to Django Python I connect you to some good WhatsApp groups. On Friday, October 14, 2022 at 8:46:20 PM UTC+3 anshi...@gmail.com wrote: > > > Hi Team, > > I want to start contributing in this repository .Please let me know how to > start . > Email id: anshi...@gmail.com > Please let me know easy tasks which i can pick up in beginning. > > Regards, > Anshika > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d7059edd-fc6b-4920-9031-e3714fc8cf1cn%40googlegroups.com.
Re: TypeError: 'module' object is not iterable - django 4
Issue was sorted.. Here is the link. python 3.x - TypeError: 'module' object is not iterable in django 4 - Stack Overflow <https://stackoverflow.com/questions/70924854/typeerror-module-object-is-not-iterable-in-django-4> On Monday, January 31, 2022 at 11:53:03 AM UTC+3 muwaga micheal wrote: > Hi > Team, > I am getting the above error, it has persisted long enough than at this > point i really need help. > I am using pickle to load an ML model, POST to get user input. Below is > the error, my urls.py file and the views.py file. > Any Help will be highly appreciated. > > *** Error Message *** > > (python10_env) D:\Online > Drives\MDigital\CIT-Letures\python10_env\smart_health_consult>python > manage.py runserver > Watching for file changes with StatReloader > Performing system checks... > > Exception in thread django-main-thread: > Traceback (most recent call last): > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\urls\resolvers.py", > > line 634, in url_patterns > iter(patterns) > TypeError: 'module' object is not iterable > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > File > "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\threading.py", > line 1009, in _bootstrap_inner > self.run() > File > "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\threading.py", > line 946, in run > self._target(*self._args, **self._kwargs) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\utils\autoreload.py", > > line 64, in wrapper > fn(*args, **kwargs) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\management\commands\runserver.py", > > line 124, in inner_run > self.check(display_num_errors=True) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\management\base.py", > > line 438, in check > all_issues = checks.run_checks( > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\registry.py", > > line 77, in run_checks > new_errors = check(app_configs=app_configs, databases=databases) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", > > line 40, in check_url_namespaces_unique > all_namespaces = _load_all_namespaces(resolver) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", > > line 67, in _load_all_namespaces > namespaces.extend(_load_all_namespaces(pattern, current)) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", > > line 57, in _load_all_namespaces > url_patterns = getattr(resolver, 'url_patterns', []) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\utils\functional.py", > > line 48, in __get__ > res = instance.__dict__[self.name] = self.func(instance) > File "D:\Online > Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\urls\resolvers.py", > > line 642, in url_patterns > raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e > django.core.exceptions.ImproperlyConfigured: The included URLconf ' 'ml_dp_model.urls' from 'D:\\Online > Drives\\MDigital\\CIT-Letures\\python10_env\\smart_health_consult\\ml_dp_model\\urls.py'>' > > does not appear to have any patterns in it. If you see the 'urlpatterns' > variable with valid patterns in the file then the issue is probably caused > by a circular import. > > ** > > urls.py * > from django.urls import path > from . import views > > #from .views import index > #from .views import predict > > urlpartterns = [ > path('', views.index, name='index'), > path('result.html', views.predict, name='predict') > > ] > ** > > * views.py * > from django.shortcuts import render > # Testing if context can solve circular refference issue. > from django.template import context > # Model related imports > import pandas as pd #install pandas > import pickle > import numpy as np # helps to manipulate the data > > # Create your views here. > def index(request): > return render(request, 'index.html') > > # importing the models using pickle. > #Loading Naive Bayes P
TypeError: 'module' object is not iterable - django 4
Hi Team, I am getting the above error, it has persisted long enough than at this point i really need help. I am using pickle to load an ML model, POST to get user input. Below is the error, my urls.py file and the views.py file. Any Help will be highly appreciated. *** Error Message *** (python10_env) D:\Online Drives\MDigital\CIT-Letures\python10_env\smart_health_consult>python manage.py runserver Watching for file changes with StatReloader Performing system checks... Exception in thread django-main-thread: Traceback (most recent call last): File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\urls\resolvers.py", line 634, in url_patterns iter(patterns) TypeError: 'module' object is not iterable The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner self.run() File "C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\management\commands\runserver.py", line 124, in inner_run self.check(display_num_errors=True) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\management\base.py", line 438, in check all_issues = checks.run_checks( File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\registry.py", line 77, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", line 67, in _load_all_namespaces namespaces.extend(_load_all_namespaces(pattern, current)) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\core\checks\urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "D:\Online Drives\MDigital\CIT-Letures\python10_env\lib\site-packages\django\urls\resolvers.py", line 642, in url_patterns raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e django.core.exceptions.ImproperlyConfigured: The included URLconf '' does not appear to have any patterns in it. If you see the 'urlpatterns' variable with valid patterns in the file then the issue is probably caused by a circular import. ** urls.py * from django.urls import path from . import views #from .views import index #from .views import predict urlpartterns = [ path('', views.index, name='index'), path('result.html', views.predict, name='predict') ] ** * views.py * from django.shortcuts import render # Testing if context can solve circular refference issue. from django.template import context # Model related imports import pandas as pd #install pandas import pickle import numpy as np # helps to manipulate the data # Create your views here. def index(request): return render(request, 'index.html') # importing the models using pickle. #Loading Naive Bayes Pickle Model load method 1 nb_pickle = open('./models_store/final_nb_model.pickel','rb+') nb_model = pickle.load(nb_pickle) #Loading RandomForest Pickle Modal load method 1 rf_pickle = open('./models_store/final_rf_model.pickel', 'rb+') rf_model = pickle.load(rf_pickle) #Loading Scala Vector Machine Pickle Model load method 2 svm_model = pickle.load(open('./models_store/final_svm_model.pickel', 'rb+')) # Disease prediction Function: def predict(request): if request.method=='POST': symptom_index = {} symptom_index['symptom1'] =float(request.POST.get('symptom1')) # Add data in string format to the dictionary symptom_index['symptom2'] =float(request.POST.get('symptom2')) symptom_index['symptom3'] =float(request.POST.get('symptom3')) user_symptoms = pd.DataFrame({'X':symptom_index}).transpose() #think about changing dictionary to list at this line. # Using pickle model() to predict nb_prediction = nb_model.predict(user_symptoms)[0] rf_prediction = rf_model.predict(user_symptoms)[0] svm_prediction = svm_model.predict(user_symptoms)[0]
Re: newbie
Django is a good framework to learn. Its easy and has a great community to help. There are good videos on YouTube. On Thursday, January 27, 2022 at 5:10:56 PM UTC+3 jmizpaha...@gmail.com wrote: > It's easy if you get the Python basics first. > Suggest having a good grasp of Python basic concepts then you jump to > learning Django. > There's a lot of things Django can offer, you just need to understand them > before to jump to other topics :) > > On Thursday, 27 January 2022 at 22:02:42 UTC+8 me.ve...@gmail.com wrote: > >> hi all. is it easy to learn django...? > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7d4a3c85-7aab-4b22-a9a7-60f0f76d19f8n%40googlegroups.com.