Smile
in other words: how to assign a new created skill to a profile? and is it possible to do it in form_valid ?
FOR YOU
Hi, now I creating authentication in my project. Can you give me some books or resource about that, except documentation.. In project, I should use Django authentication (not custom)
Manoj
i am not able to update data
Manoj
def update_data(request, id): if request.method == "POST": pi = User.objects.get(pk=id) fm = StudentRegistration(request.POST, instance=pi) if fm.is_valid(): nm = fm.cleaned_data['name'] em = fm.cleaned_data['email'] pw = fm.cleaned_data['password'] upd = User(name=nm, email=em, password=pw) upd.save() return HttpResponseRedirect('/thanks/') else: pi = User.objects.get(pk=id) fm = StudentRegistration(instance=pi) return render(request, "enroll/updatestudent.html", {'form':fm})
Manoj
when i updae data in ui it creates a new entry in table
Manoj
what is wrong in this code?
Ivan
You are doing User(withdata).save() , that create a new record, you need to update an existent with two ways: pi.name = nm pi.email = em pi.save() or my favorite updated_data = { 'name': fm.cleaned_data['name'], 'email': fm.cleaned_data['email'], 'password': fm.cleaned_data['password'], } User.objects.filter(pk=id).update(**updated_data) and that's all
Fredrick
Has anyone used django-filters for dropdown only one category menu with class based views? if yes how is it done? #django #Python
Yooo
in template/app/index.html {% extends 'base.html' %} {% block content %} replace me {% endblock %} in template/app/base.html <!doctype html> <html> <head> <title>Base title</title> </head> <body> {% block content %} {% endblock %} </body> </html> in app/urls.py from django.urls import path from app import views urlpatterns = [ path('',views.index) ] in app/views.py from django.shortcuts import render # Create your views here. def index(request): return render(request,'app/base.html',{}) this is the code...!
Yooo
i have defined block content in base.html and extents in index.html , block content is not working
Suraj
Any one send to me voice chat and vedio chat in django
Kapil
how to update all date at single click
Doragonsureiyā
how to update all date at single click
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Kapil
click on update all button
Charly
click on update all button
Still not enough details to help you
Rohit
Bro on local host while login csrf token working
Rohit
But after hosting its showing csrf forbidden error
Rohit
Anyone 🙏 plz help
FOR YOU
But after hosting its showing csrf forbidden error
Maybe, you don’t send token on body in request?
FOR YOU
I mean about next requests
Rohit
Maybe, you don’t send token on body in request?
No it's there {csrf_token}.... Working on local host
Shrey
But after hosting its showing csrf forbidden error
Have you installed django-cors-headers and placed it in INSTALLED_APPS inside settings.py ??
Shrey
Also you will have to modify ALLOWED_HOSTS and add your site or access point to CSRF_TRUSTED_ORIGINS inside settings.py too !!
Vasyl
And try to path index.html in views
JUGO
Somebody know why on my site I can't rewind video
Charly
Yooo
Do you get an error?
Index.html is not add to to base.html
noob
Can anyone help Sql query to get all flights from station a to b connecting and direct both in single table
Charly
noob
Don't use sql unless its really necesary use the orm queries
I need sql query only because of my project structure
Charly
I need sql query only because of my project structure
Then ask in an SQL group ¯\_(ツ)_/¯
🔸Haku ⚒
I had a working website on Django. Suddenly, some styles stopped loading, I made no changes on the code, so after searching what could it be, I realized I am receiving a Content Security Policy error on the browser console, which says that my website config have blocked loading an inline resource for default-src. Any way to solve this?
🔸Haku ⚒
Ali
Hi I want to find the registration in Django so that when it receives the email and other information, it will be redirected to a page where it will enter the code that was sent to the recipient's email. If it is correct, the registration will be done. How do I write this?
Евгений
Hello. How can I solve this problem? RuntimeError: Model class races.models.Racer doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. help pls
Даниил
Hello. How can I solve this problem? RuntimeError: Model class races.models.Racer doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. help pls
Check INSTALLED_APP in settings.py, you should add name of your app, or look at file app.py inside your application https://stackoverflow.com/questions/40206569/django-model-doesnt-declare-an-explicit-app-label
Qureshi
Anyone python django free course sent me please🙁
Евгений
Check INSTALLED_APP in settings.py, you should add name of your app, or look at file app.py inside your application https://stackoverflow.com/questions/40206569/django-model-doesnt-declare-an-explicit-app-label
thx, i changed my setting file, but now I have worning that AttributeError: 'AdminSite' object has no attribute 'url' This is because I have bad code in my project?
Mihir
What option is better for realtime data ajax or django channel ?
Даниил
4.1.4
It seems that error inside your admin.py file
Евгений
Mihir
Ok tysm
Davide
hi do you have any tips on how to create a form by passing it a dictionary?
Himalaya
listdata = SchoolWiseScheduleDate.objects.annotate(item_position=Count('action')).filter(**{f'action-1{item_position}scheduled_datein': date_list}) Throw error --> NameError: name 'item_position' is not defined
Himalaya
Like I want to use item position value as to define a field key to filter data?
Himalaya
Anyone who can help?
Y
Anyone python django free course sent me please🙁
I think that you can begin django learning with django official documentation.
Mr Moha
can i build full school managment system in django restframework and react as front end
vahid
https://stackoverflow.com/questions/74863899/django-test-discovery-issues
Mani
my_project └── src ├── __init__.py ├── main.py ├── database.py └── auth ├── __init__.py └── repository.py How can I import database.py in repository.py? when I try to do, it says: ValueError: attempted relative import beyond top-level package No idea how to fix. package in repository.py is auth and name in repository.py is auth.repository
MultiValueDictKeyError in 'role' def Registeruser(request): if request.POST['role'] == 'Candidate': role = request.POST['role'] fname = request.POST['firstname'] lname = request.POST['lastname'] email = request.POST['email'] password = request.POST['password'] cpassword = request.POST['cpassword']
Krunal
I am using django channels. It is working fine on windows server while running on development server. But it is not working on IIS. Do I need to do any additional setttings in iis to run websocker? I have checked websocket is enabled in iis.
🧚‍♂️
Hello Have you ever encountered such an error ? Error 8 connecting to redis:6379. nodename nor servname provided, or not known.
Даниил
Hello Have you ever encountered such an error ? Error 8 connecting to redis:6379. nodename nor servname provided, or not known.
What's about this https://stackoverflow.com/questions/22216723/redis-error-8-connecting-localhost6379-nodename-nor-servname-provided-or-not
🧚‍♂️
It doesn’t work
Даниил
It doesn’t work
Can you run shell?
......
Anyone know how to create Chat application API in django-channels for communicate with each other.
Doragonsureiyā
......
I am creating django restframework web API using django-channels for just like chatting web site.
Yulian
It doesn’t work
do you run redis on docker or as local application?
🔸Haku ⚒
No
I was making some testings and if I deploy the project locally, it works well, so it probably has something to do with the server and not the code
maverick
Any one familiar with unit test
Doragonsureiyā
Any one familiar with unit test
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
maverick
I need to test a csv upload and store the data into database. How to do the unit test for this ?