Fabrício
I texted python manage.py createsuperuser
Fabrício
Fabrício
Because I am learning to program
Mirco
I texted python manage.py createsuperuser
You have to open admin panel and login with the username and password you typed after running this command
Doragonsureiyā
thanks. i am check it out
You're welcome! 😊
Arbaaz
is anyone has work with django with sweetalert
Arbaaz
can anyone help
Doragonsureiyā
is anyone has work with django with sweetalert
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
M
Hi friends, does anyone know or have any experience about bad side effects of using nested include tags? (I mean including a template file which itself includes another template) For example: file x.html: {% include "z.html" %} file y.html: {% inclide "x.html" %}
Anonymous
I think it's good, that's the point of include, to group logically and remove duplicate, only side effect I think is it's bit confusing sometimes
Sourabh
users = User.Objects.filter(id=userid).values("username") Iam using this in export-csv as a name of file.. But the File name starts with {username andy} How to remove the brace and username.. wt code i need to edit
Arbaaz
<script> {% for message in message %} swal('{{message}}'); {% endfor %} </script>
Arbaaz
it is showing me error can anyone help
Snowman
anybody use python for trade coin in binance
Charly
it is showing me error can anyone help
If you don't share the error it will be hard to help you
Doragonsureiyā
anybody use python for trade coin in binance
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Arbaaz
If you don't share the error it will be hard to help you
Bro msg not allowed I followed a youtube but showing error
Charly
Bro msg not allowed I followed a youtube but showing error
what? just share your error message (see rule 5)
Arbaaz
What’s the error?
I can use for loop in script like that
Charly
Not working
show full code, I can;t see how are you converting it to csv
Sourabh
show full code, I can;t see how are you converting it to csv
response['Content-Disposition'] = 'attachment; filename={users}-stocks.xlsx'.format(users = User.objects.filter(id=userid).values("username"), )
Charly
Read this: https://docs.djangoproject.com/en/3.2/howto/outputting-csv/
Shilpy
I am uploading a file and I want to post that file name to an API. How can I do so?
Charly
I am uploading a file and I want to post that file name to an API. How can I do so?
once you upload the file you can retrive the filename and post it to an API
Shilpy
Ok I will try
Shilpy
Thank you
Alex
yeap
can you provide little info about the use case of 0 as default instead of null?
Alex
I think I can`t
okay because i am certain, that i have never till now have encountered scenario for this type of specific database entry from django side,
Alex
I think I can`t
https://dba.stackexchange.com/questions/50481/can-a-foreign-key-have-a-default-value-equal-to-0/50486#:~:text=Yes%2C%20you%20can%20define%20a,value%20of%200%20as%20well.
Saransh
Guys i am having issue lately with djanog debug toolbar
Saransh
i did all the installation steps
Saransh
but it wont show up
Saransh
What could be the possible reason
Saransh
https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
José
I am uploading a file and I want to post that file name to an API. How can I do so?
If you are posting the file to an api, then you probably have to you Java script's FormData
José
<script> {% for message in message %} swal('{{message}}'); {% endfor %} </script>
Remove the script tag, this is html you are writing, script is used to enclose Java script code
Shadow
https://stackoverflow.com/questions/69535149/allow-users-to-sort-in-ascending-order-using-radio-button-django
Shadow
Anyone know how to solve this issue?
José
Anyone know how to solve this issue?
Have you tried to order by "-id" ?
Shilpy
If you are posting the file to an api, then you probably have to you Java script's FormData
No no I'm not doing that. I'm uploading the file using FileSystemStorage and then I need to paas the extension, file name and path to an API. I am able to retrieve these informations but don't know how to post these to an API. Should I use mixins for that or anything else?
Laja
Ohayo😃
Shadow
Tried but does not work
Shilpy
Pass extension from where, where are you making requests from?
From backend i want to pass the information
игорь/igor
Can someone help me? I stuck here for very long :(
Pass the name of the column you want to search on as an url parameter. For example &sort=name&sort_direction=-
игорь/igor
From backend i want to pass the information
Same code base? You don't need to use your api, api is for outside client(mobile app, Javascript, etc). If it is connected to models, just use your models to save in DB
José
Can someone help me? I stuck here for very long :(
You have to sort one field that you want sorted, if it's the field is username, then .... order_by("-username") or order_by("username") according to the order you want.
José
Check what you need to pass in your body...
The body of the post request.
José
Which means I must have multiple form is it?
Not really, you can use jquery to detect which mode the user selects, (asc/desc)
игорь/igor
Can someone help me? I stuck here for very long :(
Do the search first in your code, then check the sorting params and sort, then pagination. But that's hard, because sometimes people try sorting while on page 4 for instance, ideally you would throw them to page 1, because the order of items changed, but it is hard to know they just pressed sorting button without proper knowledge of js. Also, there is package called Django-filter, which is super helpful
Shadow
if (part is not None) and part: allusername=Photo.objects.objects.alL().order_by("pantno")
Shadow
So this is wrong?
Shadow
objects.objects
Even with one objects also cannot 😂
ㅤ
Is QuerySet API important for Django interview
∫ 𝔞𝔪𝔞𝔫
Hey Do you have any recommendation about books or tutorials on channels?
∫ 𝔞𝔪𝔞𝔫
Except the official documentation
∫ 𝔞𝔪𝔞𝔫
Shilpy
The body of the post request.
When I'm trying to post the data using requests module, I'm getting the error "Cannot schedule new futures after interpreter shutdown" and the page keeps on loading forever
Anonymous
How to update object using model form ?
V
Hai I'm trying to make a rest API for a blog app using Django Rest Frame work. I'm beginner and it's hard for me how to implement that system. I made an intermediary model for making connections between and following s and followers views