mukhil
html live input data how can get in django
Alex
html live input data how can get in django
Elaborate. Are you sending some form and want to get its data on the backend side?
mukhil
without submit button how can get?
Raad
Elaborate. Are you sending some form and want to get its data on the backend side?
No, I'm only receiving and processing, I don't even render a template
mukhil
if i type firstname automatically need to fill second inputbook
Alex
Yes, exactly
Lets say you define your Subscription as class Subscription(model.Models): user = models.OneToOne(User) Then subscription.user.email. And user.subscription.some_attr
Raad
The data coming from WordPress in JSON format included first_name, last_name, email, mobile, etc When these data arrive to django, i either create an account or update a current one.
Alex
@Mukhilkg I don't consult in private
mukhil
sorry
Raad
@R3d_sa Am I answered your question?
Yes, Thank you Alex I will try it and let you know
Raad
@R3d_sa Am I answered your question?
Works like a charm now gonna work on plans
Nisha
theDisgrace
Yes, i did but the image is not visible
Can u show ur static folder location, settings.py (wherever u mentioned static folder) and the page where u want to show the image
Саша
If somebody know how to get all url patterns of the project? Not in terminal,and in python file
Neo
of a website that is in production? I don't think you can unless debug is set to True and you hit a 404
Саша
what do you mean?
Function,which will return all url patterns as “posts/” “posts/<int:pk>/” and etc.
Zikirillo
hello everyone, how do you make two forms on one page?
Anonymous
Hi. I got a question about running tests, maybe someone can help. I wrote tests, and wanna run them with Jenkins, but Django cannot connect postgres when I execute test command. Not sure what should I do now. Any suggestions ?
Anonymous
Hi. I got a question about running tests, maybe someone can help. I wrote tests, and wanna run them with Jenkins, but Django cannot connect postgres when I execute test command. Not sure what should I do now. Any suggestions ?
Normally Django will use a connection to the 'postgres' database to avoid running initialization queries against the production database when it's not needed (for example, when running tests). Django was unable to create a connection to the 'postgres' database and will use the first PostgreSQL databa instead.
Azizbek Xushnazarov
Hi. I have a question. I want to make some bussiness logic validation when creating instance of a model. So I have overrited clean() method of model. But DRF does not respect this model level validation. More clearly, serializer.is_valid() is not calling the full_clean() method of the model. So this is being called on .save(). So how can I achive a validation in model level that serializer "respect".
Neo
what's wrong with that
Azizbek Xushnazarov
implement the validation in the serializer
I want model level validation. rest api is not the only thing that creates model instances
Fred
Hello there! I have a question. there is some model, like this: class Order(Model): ts = DateTimeField() total = IntegerField() I need to calculate the sum of total for every date in some date range (or without date range), request looks somehow like this: Order.objects.values('ts__date').annotate(sum=Sum('total')).order_by('ts__date') It works, but if there is no any order for some date, it will not return any data for that date. For example, I have some rows in database: 25.03.2021 - we have some orders 26.03.2021 - no orders 27.03.2021 - we have some orders Now results is looking like this: [{'ts__date': '25.03.2021', sum: 3782818}, {'ts__date': '27.03.2021', sum: 432423}] but I want something like this: [{'ts__date': '25.03.2021', sum: 3782818}, {'ts__date': '26.03.2021', sum: 0} {'ts__date': '27.03.2021', sum: 432423}] Is it possible to do this on database side, or I have to correct data at application layer?
wikd
https://medium.com/@jkjayakrishnan5/difference-between-asgi-and-wsgi-91fba8cf9372
wikd
An article on difference between asgi and wsgi
Thuy
then who should that mention…?
Sarthak
How to combine crud operations in one class using class based view any demo do you have anyone please?
Raad
How to combine crud operations in one class using class based view any demo do you have anyone please?
https://pastebin.com/e5fMMF51 Check here I shared an example from my code. There are several things you need to look at in Django official docs
Al
please help my question. https://stackoverflow.com/questions/70920633/how-to-create-model-django-for-fixed-question-and-integrated-with-user-document thanks before
Sub
Hi everyone, can you give me the turtorial for uploading images with django?
Sub
I looked turtorials online but in them you got static foldier /static/ and save path for images /pics/ or images
Sub
So I could uplod image but not show it
Sub
And how to do this then?
Mirco
And how to do this then?
Read carefully Django official documentation topic about FIle Uploads and you will get it 🤙🏼
₩
Hi guys I wanted to push my code to github but I got an error! Can you help me?
₩
F:\Django>git push -u origin main fatal: unable to access 'https://github.com/zeroOne81/my-first-blog.git/': error setting certificate verify locations: CAfile: E:/Python/󒄌/Git/mingw64/ssl/certs/ca-bundle.crt CApath: none
Pawan
What should I do?
Take ssh key from github account.
Sophia
i have a doubt i have creted the signup page using mysql and login page,but the thing is when i login using username and pwd it should displays the students details that is name, department,age,ad....,but it is not displaying what should do for that
Fan / Ac
are you using django
Sophia
yes
Fan / Ac
why use sql drivers if you havr orm
Sophia
if i use mysql connection ,how to code to fetch the particular student data when the student logins
Sophia
'tuple' object has no attribute 'first_name' it shows this error
T4P4N
why use sql drivers if you havr orm
good question, Why are you not using orm?
Sophia
that only i have mentioned
Fan / Ac
that only i have mentioned
the error says tuple doesnt have an attribute first_name
Neo
why use sql drivers if you havr orm
Some queries are easier without orm
Sophia
the error says tuple doesnt have an attribute first_name
i dont what mistake i have done in the code
Fan / Ac
i dont what mistake i have done in the code
what does print(record) prints ??
Sophia
datas of the student in console
Sophia
but it is not printing in the display page
Sophia
what does print(record) prints ??
did i done any mistake in the code
Fan / Ac
did i done any mistake in the code
you check what print(record) prints and think if the elements of a tuple can be accessed like you did
Sophia
(15, 'asahi', '123', 'asahi', ' as', 'CSC', 9, 1, 'xxxxxxxxxx') (id,username,pwd,first_naem,last_name,dep...)
Fan / Ac
no
if your tuple is a=(15, 'asahi', '123', 'asahi', ' as', 'CSC', 9, 1, 'xxxxxxxxxx') you can access fourth element like a[3] read this https://www.digitalocean.com/community/tutorials/understanding-tuples-in-python-3
Sophia
ok
𝙀𝙧𝙖𝙡𝙞
Could not fetch URL https://pypi.org/simple/pywebio/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pywebio/ (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_ACCESS_DENIED] tlsv1 alert access denied (_ssl.c:1129)'))) - skipping HELP
Bobosher
Hello, how can I integrate Django 3.2 with Channels 3.0? This is a part of __init__.py of channels module: try: import django if django.VERSION < (3, 2): default_app_config = "channels.apps.ChannelsConfig" except ModuleNotFoundError: pass
None
Is it possible to create a django form with fields from multiple models?