Sirius
Anyone can help
show you settings.py where you added media_root
Anonymous
MEDIA_URL='/media/' MEDIA_ROOT=os.path.join(BASE_DIR, 'media')
Anonymous
MEDIA_URL='/media/' MEDIA_ROOT=os.path.join(BASE_DIR, 'media')
Mohsin Bilal try this python script add at the end in settings.py and create media folder in your project home
Anonymous
show you settings.py where you added media_root
I am just putting two lines in the end of setting.py MEDIA_URL = /'media/' MEDIA_ROOT= is.path.join(BASE_DIR,'media') And one line in the outer bracket of urls.py +static(settings.MEDIA_URL,default_root=MEDIA_ROOT)
Anonymous
Ok thanks
Sirius
Try to change: default_root=MEDIA_ROOT in your urls.py to: document_root=settings.MEDIA_ROOT
and : MEDIA_ROOT = is.path.join(BASE_DIR, 'media') To: MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
Anonymous
Settings was missing
Mr.m
I want some help in creating a django project
Doragonsureiyā
I want some help in creating a django project
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
sm
Is there any way to stop refreshing script in django templates
Mirco
Is there any way to stop refreshing script in django templates
Refreshing script ? You mean after submitting ?
Nonverbis
https://stackoverflow.com/questions/52058625/pass-a-list-as-a-parameter-to-django-tag In the example they use split() method in template like this: {% my_tag paramA='asdf' paramB='fdsa' listparams='XY Z'.split %} I am trying, and it doesn't work. Django 3.0.6. Could you tell me whether this is a working code sample or I should build a custom filter?
Alan
What would be the best way to pass variables from the view to a variable in javascript in a way that in my use case, Chartjs, be easily done. I know how to do it like it's exposed here: https://stackoverflow.com/questions/51003311/django-and-chartjs But I don't think that doing [{% for i in myobject %}{{ i.labels }},{% endfor %}] be that well readable. Thoughts?
Fernandy
Hi there... i would like to ask about make namespace in urls ....im using django 2.2 and i learned from youtube at Kelas Terbuka he is using 1.11...can some tell me using namespace at main urls and on app.urls
Sweetie
I have a javascript code that picks id of all rows in my page and adds a button to that row. The code works fine, now I added bootstrap class="collapse" to some of the rows so they remain collapsed on page load. Now my javascript it not adding buttons to those rows which are collapsed during page load. How can I resolve this so button is added to all rows whether collapsed or not
sm
Yes*
Mirco
use javascript and fetch apis or ajax to update without refreshing the page
Anonymous
Hi , i need to add decimal field default value to 0 when i submit the form the empty decimal field should take it as 0 and save in database how can i do that??
Anonymous
Give default value to. Ur models attributes and set it blank to true
Like Blabla = models.de...(default=0.. blank =True
Anonymous
Like Blabla = models.de...(default=0.. blank =True
I have save method which makes calculations will it work on it??
Vivek
I want some help
Vivek
In creating a project
AB
I am getting the error even though I have configured DJANGO_SETTINGS_MODULES accordingly. Error:django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() 
AB
https://stackoverflow.com/q/62004154/11545896
Muslim
Be polite
AB
Okay sorry
Abrar
Run the django shell via manage.py
Mayank
Is there any module which helps admin fields value. Like if 3 admin users update the same record then how to maintain the data accuracy while saving the model object
Mayank
Anyone have worked on this problem earlier?
.
I've building a registration form. Whenever a user fills the form and hits the submit button I want to redirect him/her to a preview page to see their submissions. How do I make the preview page? I'm having troubles with it.
Manish
Hello I have raised an issue in Github for mye django issue.. I am posting link here. It's related to using an user field as a foreign key in model.py file Please if anyone could help me! https://github.com/mayur200/django3/issues/1
Felipe
Hey guys, I hope you're all good! I'm trying to order a queryset by price value. But the price can be 0, None or other number. When I do my_queryset.order_by(price). It works as expected first prices with 0, than the numbers and last the None prices.
Felipe
My problem is to order_by(-price)
Felipe
reverse order
Felipe
It returns first the none values, than the numbers, and last the items with price 0
Felipe
I think it should return first the numbers, than the zeros and last the None, isn't?
Felipe
What do you guys think about?
cj
What do you guys think about?
you said doing .order_by() works as expected: "first prices with 0, than the numbers and last the None prices." and you said reverse ordering is: " first the none values, than the numbers, and last the items with price 0" so it's working as expected 🤷🏻‍♂️
cj
I think it should return first the numbers, than the zeros and last the None, isn't?
then why do you think this should be the result of reversing the .order_by() result?
Yair
I don’t know if you need the none objects values, in case you don’t. I tried to add other filter to the query set to do it. But I’m not sure what you really neeed...
Felipe
then why do you think this should be the result of reversing the .order_by() result?
Yeah, I realize that, but I think None values should come last
cj
you have a queryset where None came last, so at reversing it, None will come first 🤷🏻‍♂️
Felipe
But if I want to order by higher prices, make no sense return None prices first
Yair
But if I want to order by higher prices, make no sense return None prices first
Filter avoiding None prices values would be the solution you need? Add filter() to the queryset should work I think...
Felipe
Yeah, but I need the None values too. I just want them on the end of the queryset
cj
Yeah, but I need the None values too. I just want them on the end of the queryset
🤔 then probably you'll need 2 querysets, one to order the prices without None values, and other to show only None values, then join them.... but IDK if that's gonna affect the performance of your response, depending on the amount of data you have
Felipe
Hum, ok. Thx
Felipe
Solved, I used this
Felipe
queryset.order_by(F(price).desc(nulls_last=True))
Yair
👏🏻
Anonymous
What do you guys think about this django docker configuration? Any PR would be appreciated https://github.com/IamStefin/dockerizing-django
Abrar
I've building a registration form. Whenever a user fills the form and hits the submit button I want to redirect him/her to a preview page to see their submissions. How do I make the preview page? I'm having troubles with it.
@rich_ard101 When the user hits submit , you copy the data in the cleaned dictionary either in a different form or however you choose to proceed and then you display that form in a different page and redirect to that template
D
Hi anyone have Durga sir RestAPI Videos?
❤️
Hi anyone give a link of videos to learn django
Jatin
Hi anyone give a link of videos to learn django
https://www.youtube.com/playlist?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
A
👍🏻
Sh
If anyone has any college projects or anything that has to be done with Python/Django (Only Backend) I can do it for you. Rates are cheaper than usual. Please contact me.
Anonymous
How to achieve logout functionality, I am using JWT
Anonymous
Prerequisites for web development
Anonymous
Is there anyway testing rest api in django without db?
Ankush
Hey everyone Can anyone help me with testing.. Im trying to find out how we deactivate transaction.atomic()
The
iam getting django or html code in the contactus page while clicking the submit button?
The
can anyone help me with why this occurs
The
?
Prasanthari
I think u passed a context of html contents or http response as html