The
i get that error when i run python mange.py runserver what might be the issue
AleMVP
chicos que programa es bueno para hacer modelo de datos, hojala free?
The
Exception in thread django-main-thread: Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\ProgramData\Miniconda3\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\management\base.py", line 419, in check all_issues = checks.run_checks( File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\functional.py", line 48, in get res = instance.__dict__[self.name] = self.func(instance) File "C:\ProgramData\Miniconda3\lib\site-packages\django\urls\resolvers.py", line 598, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\functional.py", line 48, in get res = instance.__dict__[self.name] = self.func(instance) File "C:\ProgramData\Miniconda3\lib\site-packages\django\urls\resolvers.py", line 591, in urlconf_module return import_module(self.urlconf_name) File "C:\ProgramData\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
The
Exception in thread django-main-thread: Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\ProgramData\Miniconda3\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\management\base.py", line 419, in check all_issues = checks.run_checks( File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "C:\ProgramData\Miniconda3\lib\site-packages\django\core\checks\urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\functional.py", line 48, in get res = instance.__dict__[self.name] = self.func(instance) File "C:\ProgramData\Miniconda3\lib\site-packages\django\urls\resolvers.py", line 598, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\ProgramData\Miniconda3\lib\site-packages\django\utils\functional.py", line 48, in get res = instance.__dict__[self.name] = self.func(instance) File "C:\ProgramData\Miniconda3\lib\site-packages\django\urls\resolvers.py", line 591, in urlconf_module return import_module(self.urlconf_name) File "C:\ProgramData\Miniconda3\lib\importlib\__init__.py", line 127, in import_module
This is an error i get on running python manage.py runserver
The
I can't tell where I'm going wrong ..anyone who knows where the problem is
Aniesh
someone help me (non_field_errors“: [”Invalid data. Expected a dictionary, but got InMemoryUploadedFile."])
Anonymous
someone help me (non_field_errors“: [”Invalid data. Expected a dictionary, but got InMemoryUploadedFile."])
Can you show the code? It seems a function/class (like a form) needs a dictionary but you're giving it an InMemoryUploadedFile object
Aniesh
Can you show the code? It seems a function/class (like a form) needs a dictionary but you're giving it an InMemoryUploadedFile object
https://stackoverflow.com/questions/67979634/non-field-errors-invalid-data-expected-a-dictionary-but-got-inmemoryupload
Anonymous
is there any way to change a row in a table and if an error has been generated in process return changes?
Anonymous
did transaction solved my problem?
Anonymous
is there any way to change a row in a table and if an error has been generated in process return changes?
Do you mean reverting them, right? Yes you can use transactions (for example using checkpoints) Check Django documentations
Anonymous
Aniesh
Who know about drf please help
sheikh
How to remove single user from group in channels?
Jd
You can use set headless option for your driver
Great ... Thanks, I'll try to implement it
Asad
hi there, i'm working with timefield in admin panel and django time fields is uncomfortable. it offers Now, Midnight, Noon keywords. how can i change that, how can i change them to detailed timedeltas?
Pavel
Hi. I have url re_path(r"a/(<int:pk>/)?", MyListView.as_view()) How to add pk in browser url if it wasn't passed? I mean to convert "a/" to "a/10/" for example Dispatch of MyListView has this logic if 'pk' in kwargs: self.a = A.objects.get(pk=kwargs['pk']) else: self.a = A.objects.last() return super().dispatch(request, *args, **kwargs)
-
Any good django project suggestions?
Pavel
Ok. I'll pop pk to not to confuse u with listView
Pavel
But it doesn't solve my question
Pavel
Solve it with redirect
Mirco
Solve it with redirect
redirect to what ? a random pk ?
Pavel
last pk
Ankit
hey please help, my webpage is working fine but i can not save new task in the field
Ankit
from django.shortcuts import render, redirect from django.http import HttpResponse from todolist_app.models import Tasklist from todolist_app.form import TaskForm def todolist(request): if request.method == "POST": search_form = TaskForm(request.POST, request.FILES) if search_form.is_valid(): cd = search_form.cleaned_data search_form.save() else: all_tasks = Tasklist.objects.all() return render(request,'todolist.html', {'all_tasks':all_tasks}) def contact(request): context = { 'welcome_contact': "Hey, Welcome to contact page", } return render(request,'contact.html',context) def about(request): context = { 'welcome_about': "Hey, Welcome to about page", } return render(request, 'about.html', context)
Complex_101
I added Amazon rds using postgres in my django website and deployed on heroku. Now when I run the website on local host it gives and error that - django.db.utils.OperationalError: fe_sendauth: no password supplied It has something to do with the psycopg2? How should I resolve this?
Ankit
https://del.dog/pegecrykux
Ashish
Hey all, can we clone a website? Is it legal??
Ankit
it is illegal. You cannot duplicate copyrighted elements such as images, text, or source code and logo.
Sopan
Hey all, can we clone a website? Is it legal??
Every thing depends... you are copying some unnoticable site.. then no trouble to you 🙂
Sopan
But out of curiocity - what do you want to copy?
Ashish
I want to make a clone of Amazon, Netflix apps
Sopan
I want to make a clone of Amazon, Netflix apps
ROFL .. and users will use your clone copy
Ghorz
Start with one first.
First clone a blog, ecommerce
Sopan
That's madness
Ghorz
ROFL .. and users will use your clone copy
It may be for learning purposes
Anonymous
I want to make a clone of Amazon, Netflix apps
There's a project in github (its name is clone-wars). I suggest you check it.
Asad
I didn't implement it but you can build your own widget for any field you want.
I'm newcomer to django, are there any ready solve for this?
Sopan
Yes
May be check for free courses online + check projects on github.com ... you can learn more things there
Ankit
Ashish you can take ideas of looks and fancy things but you can not build exactly same. do some changes when copying
Anonymous
There's a project in github (its name is clone-wars). I suggest you check it.
You can build a rest-api with drf and use them as its fronted.
Ankit
you can use same navigation bars but do some changes in colors and styling.
Ankit
etc etc
Ashish
But if I changed all color schemes and elements then it doesn't look like amazon
Ankit
yes and this is how patent/copyright works
Ankit
nobody can steal your ideas and hardwork so easily lol
Anonymous
I'm newcomer to django, are there any ready solve for this?
Actually I don't know. Search github. May someone did it before and shared it as a package.
Ashish
I just add it in my portfolio I am not use that app for business purposes
Ankit
https://del.dog/pegecrykux
Ankit
help me to resolve error pls. i'm new to django and now learning how to save data in database. i'm getting error in save() attribute
Artem
Can't display data from database to html dropdown list. What am I doing wrong? <div class="form__input"> <select name='department_name' class="form-select" aria-label="Default select example"> {% for item in query_results %} <option>{{ item.department_name }}</option> {% endfor %} </select> </div> views.py def index(request): query_results = Department.objects.all() context = {'query_results': query_results,} return render(request,'passage/registration.html', context)
Dev
! [remote rejected] master -> master (pre-receive hook declined)
Dev
File "/app/.heroku/python/lib/python3.9/distutils/util.py", line 9, in <module> remote: import importlib.util remote: ModuleNotFoundError: No module named 'importlib.util'
Dev
how to solve thi eroor
Artem
write it where??
when you create a database model in models.py you should add that
Mo
hi, when i want to connect django rest api with mongodb by both mongoengine and djongo methods this error appears: what is the solution: raise ImproperlyConfigured("Missing MONGODB_DATABASES in settings.py") django.core.exceptions.ImproperlyConfigured: Missing MONGODB_DATABASES in settings.py
Artem
Try to print query_results in views to check what data you are getting.
I got data from that table through python shell. Everything shows correct. What can be wrong?
William
I got data from that table through python shell. Everything shows correct. What can be wrong?
Just try to display in your HTML file first then try it on the dropdown
Artem
Just try to display in your HTML file first then try it on the dropdown
I have this line <select name='department' class="form-select" aria-label="Default select example"> and I guess it could be problem with name parameter, what should be there: table column name, table name or anything else?
Artem
Are you using bootstrap?
But in other fields in html I also use name parameter and there I'm using database column name. In this case it doesn't work
Artem
What is department_name here?
table column name that I'm trying to get data from to display it in dropdown list
Null Boy
Hi . I deployed my django project on server with aapanel . I proxed the domain over 8080 and IP 127.0.0.1 . Everything works fine when I run the project in the terminal with python manage.py runserver 0.0.0.0:8080 But when I run the project with Apache and gunicorn mode, it does not recognize the static and media folder . SERVER OS : Centos 7 Admin panel : aapanel Web server : apache Use ssl : Yes I went to Google for Apache configuration solutions but got no answer
Mounted
Hello everyone! need help with django infinite scrolling. Couldn't make HTML scrolling table. Maybe someone has examples?
Red
Hello everyone! need help with django infinite scrolling. Couldn't make HTML scrolling table. Maybe someone has examples?
By Vitor Freitas: https://simpleisbetterthancomplex.com/tutorial/2017/03/13/how-to-create-infinite-scroll-with-django.html