Anonymous
MEDIA_URL='/media/'
MEDIA_ROOT=os.path.join(BASE_DIR, 'media')
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)
Abrar
Anonymous
Ok thanks
Sirius
Anonymous
Anonymous
Settings was missing
Mr.m
I want some help in creating a django project
sm
Is there any way to stop refreshing script in django templates
Mirco
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
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
Anonymous
Vivek
I want some help
Vivek
In creating a project
Anonymous
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
Nonverbis
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?
Yair
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
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
cj
Felipe
cj
you have a queryset where None came last, so at reversing it, None will come first 🤷🏻♂️
Felipe
Felipe
But if I want to order by higher prices, make no sense return None prices first
Felipe
Yeah, but I need the None values too. I just want them on the end of the queryset
Felipe
Hum, ok. Thx
Felipe
Solved, I used this
Felipe
queryset.order_by(F(price).desc(nulls_last=True))
cj
Yair
👏🏻
Anonymous
What do you guys think about this django docker configuration? Any PR would be appreciated https://github.com/IamStefin/dockerizing-django
Abrar
D
Hi anyone have Durga sir RestAPI Videos?
❤️
Hi anyone give a link of videos to learn django
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
Sourav
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
Prasanthari
I think u passed a context of html contents or http response as html