Hamidreza
Alex
yes i have many
The code you're showing us is absolutly valid. It MUST work. Something is wrong with your setup.
Anonymous
Mirco
Mirco
Hamidreza
Anonymous
Anonymous
SELECT shop_order.id, shop_order.order, shop_order.date_order, shop_order.customer_id, shop_order.product_cant, shop_order.supplier_total, shop_order.sale_total FROM shop_order WHERE EXTRACT(MONTH FROM CONVERT_TZ(shop_order.date_order, 'UTC', 'America/New_York')) = 11 ORDER BY shop_order.order ASC
Anonymous
will be smt with the timezone setup!
Anonymous
some recommendation!? change time zone on mysql server !?
Alex
will be smt with the timezone setup!
I doubt that it's TZ problem. Are you 100% sure that you setup the same DB in django's settings as you query with that sql? Are you sure that you didn't setup any DB cache in your django project? Like cachalot for instance.
Anonymous
yes, im sure there is no cache, and the DB setup is correct
Anonymous
Anonymous
after that, remove the timezone convert
SELECT shop_order.id, shop_order.order, shop_order.date_order, shop_order.customer_id, shop_order.product_cant, shop_order.supplier_total, shop_order.sale_total FROM shop_order WHERE EXTRACT(MONTH FROM shop_order.date_order) = 11 ORDER BY shop_order.order ASC
and then i have the result
Alex
Anonymous
it work!!!!
Alex
-_-
Anonymous
but... is that correct!???
Anonymous
i mean, is a good practice!??
Alex
i mean, is a good practice!??
I really don't like disabling timezone support. I think there is something is wrong with your mysql instance. But cannot say what.
Alex
Anonymous
-_-
Ofcourse, wrong tz naming
i dont understand this!? the mysql server is running on remote server, and it have the time zone well configured
Alex
Anonymous
Anonymous
inchidi
Alex
why!?
I was wrong, nvm. America/New_York is correct
Anonymous
now, USE_TZ = True and the queries are working!!!
@Garant
Hello! Help plz !!!
Model:
class A:
name = CharField
class B:
size = int
a_link = ForiegnKey(A)
I have filtered queryset with B.
I need to compose a request that will return similar to:
{A.name1 : sum(B.size), A.name2 : sum(B.size)...}
The
Mirco
Anonymous
I found, already with the identified problem that in the official documentation explains about the use of time zones
Anonymous
right here
https://docs.djangoproject.com/en/3.1/topics/i18n/timezones/#migration-guide
Anonymous
Anonymous
I want to make a static website
For shop:
not for shopping, just to show the pictures of the products and maybe comments, 'how to contact' etc.
Do you think that django fits that ?
Or I should use just html & css ?
Thanks in advance 😄
cj
cj
Anonymous
cj
Anonymous
Mousiol
Does django channels use a pub/sub in redis? Or it uses another system?
Mirco
on
Hi freelance Django developer ping me. I have project and will pay you
S
M
Hallo ! I am new here anyone guide me to make my mini project...?
mukul
M
I wanted to make smart canteen in python and Django mysql by use editor pycharm / sublime
mukul
that's good
mukul
how may i help you
nightescapist
John
Hey Django Devs.
I want to use Cloudinary (on heroku) to store my media file. But I don't seem to be getting the settings quite right.
Carlos
Carlos
I mean, Quora has a good community
John
Hey guys, please what are those resources for pasting code?
John
okay thanks
Pandu
Witch is the more secure way to authenticate user(internal) in Django.
John
Okay let me recap and ask my question properly.
John
Hey Django Devs.
I want to use Cloudinary (on heroku) to store my media file. But I don't seem to be getting the settings quite right.
John
I followed cloudinary offical docs and used this:
image = CloudinaryField("product")
on my model field. And it worked for production.
[old model.py code - https://dpaste.org/6gWq]
[old settings.py code - https://dpaste.org/n88Y]
John
But I wanted the files to be on my system during development. So I change the model field back to
image = models.ImageField(upload_to="products/%Y/%m/%d", blank=True)
[new model.py code - https://dpaste.org/e838]
And added "dj3-cloudinary-storage" package
then used: DEFAULT_FILE_STORAGE = "cloudinary_storage.storage.MediaCloudinaryStorage"
in my settings.py
[new settings.py code - https://dpaste.org/d5g8]
John
This made it to save images on my system and on heroku production environment (which disappears after 30mins)
I want the images to save on my system during development and on cloudinary during production. How should I go about this?
Dexter
How do I make download able pdf of table which has around gb of data . Can anyone guide me I tried with datatable but django cannot render such huge data I am getting 502 error
Anonymous
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
from safe_lxml import defuse_xml_libs
ImportError: No module named safe_lxml
Anonymous
Mr.B
Safexml is not detected see that
Anonymous
then how can i solve that
Anonymous
hi
Anonymous
I was trying to pass some data to filter the queryset using a get request. but I cannot use the data in django.
name = request.data.get('name', None).
the name is always empty
can someone please help?