محمد دلشاد
have a look and help in it
محمد دلشاد
a bit more explaination would be better
Future
a bit more explaination would be better
result = YourModel.category_set.filter(status=True)
Future
result = Category.objects.filter(status=True) if you want to get directly from table (previous one was using fk relation)
محمد دلشاد
okk usually we go like this https://hastebin.com/ivicacaxex.py and when we create forms we get desired result what should i change in the models.py for my desired result
Sobha
https://stackoverflow.com/questions/63682048/how-to-make-a-small-part-of-code-in-views-py-to-run-for-every-x-minutes-in-djang
Sobha
please help me
Beka
Read about cronjobs. That does something for specific time.
mirrorpie
DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", "NAME": os.environ.get("DB_NAME", ""), "USER": os.environ.get("DB_USER", ""), "PASSWORD": os.environ.get("DB_PASSWORD", ""), "HOST": os.environ.get("DB_HOST", ""), "PORT": os.environ.get("DB_PORT", ""), } }
iliyaz
@mirrorpie in my example database variables written in string, in your example variables gets from system envs
abhijith
any one know how to implement sokect.io with django rest framework??
Anonymous
Anyone need 30 days of Machine learning/ Deep Learning Interview Question By ineuron
محمد دلشاد
Anyone need 30 days of Machine learning/ Deep Learning Interview Question By ineuron
i actually don't need it but maybe i can pass it to one of my friend
Beka
needed some help here still
You want to get the categories in drop down menu. But in drop down category status needs to be True?
Shradha
Hi I want to build and practice django and django REST related projects. Can anyone help me with some sites for projects....
KP
Is AWS mandatory for web developer. Most interviewer ask about AWS. If Any one have any idea about it pls share.
KP
If I want to learn then what will be the best way
KP
To learn
Mirco
AWS has path to get certification and learn about it
Mirco
otherwise internet is full of resources
KP
👍
Nirmal
Helloo
Nirmal
I want to set admin panel template in my project
Nirmal
How can i use template??
Beka
I want to set admin panel template in my project
You want custom django admin panel?
Mirco
How can i use template??
official docs, customize admin topic
Beka
yeah can you help me
Why not to filter? You already got answer before me.
محمد دلشاد
Why not to filter? You already got answer before me.
i would really appreciate if you hastebin me some help code bcs after trying for a long i am really frustrated
محمد دلشاد
that wasn't link man that was @ with the property
محمد دلشاد
https://hastebin.com/oheqelexob.py
thank you man that just slept out my head
Karthik
Can any one help me what are basic interview questions asked in django
Karthik
And how to prepare for interview
Shivam
Can any one share about how to create middleware
Mehmet
https://docs.djangoproject.com/en/3.1/topics/http/middleware/
Uday
{% for post in posts %} <li> <div class="blogContent"> <img src="https://wallpaperplay.com/walls/full/4/2/c/343005.jpg"><br> <div class="blogTextPreview"> <a href="#"><h1> {{ post.title }} </h1></a> <h3>{{ post.created_on }}</h3> <p>{{ post.content }}</p> </div> </div> </li> {% endfor %} i have image field too
Uday
how to show image?
Uday
in post model i have field for image
Anonymous
Hello Please I am new to Django and I want to know how to display Django urls in my hompage template.. Thanks
Uday
got it though, posts.blog_url.url
Uday
in img src
Beka
Did you set image configurations in settings.py and urls.py?
Zerihune
hello have difficulty displaying images while sending email
Sobha
https://stackoverflow.com/q/63689207/12169437
Sobha
this is my problem
Zerihune
have anyone tried sending emails in django
Sobha
hello have difficulty displaying images while sending email
https://docs.python.org/3.4/library/email-examples.html
Zerihune
it sends the email but doesn't display the images
Zerihune
i have used html email templates but fails to render the image
Mehmet
Did you give absolute urls into img srcs each?
Zerihune
yes its dynamic
Mehmet
What do you mean by dynamic?
Mehmet
Are your img srcs rendered like "https://yourdomain.com/static/img.jpg" or "/static/img.jpg"?
Zerihune
its from database
Zerihune
{% for x in post %}
Zerihune
{{x.image.url}}
Beka
it sends the email but doesn't display the images
It doesn't display images in website, right?
Mehmet
Are your img srcs rendered like "https://yourdomain.com/static/img.jpg" or "/static/img.jpg"?
Please read properly I ask you whether your template imgs are rendered with absolute URL like first or host relative format like second
Mehmet
You can create a fictive view and try that email tmplate
Mehmet
Or you can log your html before email to parse with your eye.
Beka
You are missing image configuration. Go to your project url and add those lines...
Zerihune
not rendering images in the email
Beka
Oh.. hmm.. no idea. Okay.
Beka
not rendering images in the email
In email when other person receives it?