Tejesh
Can I make social networking site on django at a much larger scale
Instagram, Pintrest, Bitbucket are built on django... So you can imagine the scalability
isa
I can not find a thousand separator in django. There is a filter for thousand separator ? Like 123.456.789 ?
isa
with points
isa
or comma ? no matter
Astrapel
I can not find a thousand separator in django. There is a filter for thousand separator ? Like 123.456.789 ?
https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#intcomma comma and dots in there
isa
Thanks astrapel
isa
👍
Vijay
maybe you didn't add the app under apps in settings.py
no The problem is circuler import and the temp solution will be use the models.py with 'as'
Beka
I already know, no need to reply me.
Manish
Hey 👋
Manish
I am looking for a job. Any recommendations or contacts are much appreciated. Thanks.
Manish
Also suggestions for interview are welcome
Manish
BTW I am using django since release of v2😁
Akash N
Can anyone give me clarity about the changes done on html file in Django
Deepak
can anyone provide me rest framework projects
Deepak
Kindly help🙏
can u be more specific
Deepak
?
Akash N
Changes in html file for connecting database
Deepak
use templates
Beka
Hey all, quick question. How can I get language code in HTML file? Is it possible?
SmQ
Hey all, quick question. How can I get language code in HTML file? Is it possible?
You can declare the language of an HTML document within the <html> tag by using the lang attribute. For example, <html lang="de"> will declare the language of the web page as German.
Beka
Are you talking about switching the language function?
Yes, but I want to translate string from database.
Beka
Are you talking about switching the language function?
I do have views for switching languages and that works well with static sentences.
SmQ
Yes, but I want to translate string from database.
Of course it's possible, but the easiest way would be store both of the language format text in database with a key value pair, and while rendering just render the specific language file
Beka
Of course it's possible, but the easiest way would be store both of the language format text in database with a key value pair, and while rendering just render the specific language file
I only want to translate "category" list. Because category is from the database. Other translations like statics, JavaScript does it for me. I wanted to use Django with po and mo files but decided to use JS. The problem I may having right now is translate "category" list with if/else statement in for loop. I will try later this approach later.
SmQ
What is the problem, JS object is not triggering correctly?
Beka
What is the problem, JS object is not triggering correctly?
Js can't translate database string. That's my problem.
Beka
I wanted to get language code and just play with if/else statements.
Beka
Thanks for your advice.👍
Tony
If I have a model which contains an image field, what do i need to need to insert to the image field before i save it if i don't want to save it with a form.
SmQ
Just don't render the image upload/set option in the form
SmQ
In the model set blank=True, null=True
SmQ
In the image field
Tony
But I want to save the image in the database but I want to save it manually, I don't want to save it using a model form
Beka
What do you mean by "manually"?
Tony
Let me give you an example
Tony
I have a model class Detail(models.Model): name = models.CharField() Saving it manually will be d = Detail(name = "Tony") d.save()
Tony
I want to use this same way to save an image field
Beka
What's is the purpose of this? If you are saving to database at the end.
Tony
What's is the purpose of this? If you are saving to database at the end.
Well you can save it using a model form but I don't want to use that one . I want to save it using the Django shell
Tony
Yh but how can I save a model with an image field in the django shell
SmQ
Well you can save it using a model form but I don't want to use that one . I want to save it using the Django shell
In the view where you are processing the form just set the image url field manually before saving it. And don't show any image upload option in the html.
Beka
Yh but how can I save a model with an image field in the django shell
Well, I never tried that one using shell. But, you can set to null=True, as @shoumique already mentioned. Just skip that part.
SmQ
Another way would be get the fields using JSON post method and while sending the data in json field fix the image url
Beka
He wants to save an image field using shell.
Tony
He wants to save an image field using shell.
Yh and the image field is a required field
Beka
Yh and the image field is a required field
Is it django rest framework project?
SmQ
class user(models.Model): name = models.CharField(max_length=20) pic = models.ImageField()
SmQ
from django.core.files import File user1=User(name='abc') user1.pic.save('abc.png', File(open('/tmp/pic.png', 'rb')))
SmQ
got it from stackoverflow
Rajan
Hey help me to deploy django project on Apache 2
Rajan
Take a remote
Rajan
On my pc
Beka
No
I think, you need to import os module and save the image directory in variable and use that variable for image field.
Beka
Thanks man I will try that
If os module doesn't work, try to use package for images. Get the image first and use it.
Beka
Package like Pillow or what
Something like that. Try to goole.
Beka
I'm sure you can get image directory using package or os module.
Tony
Ok
Beka
Just make sure to get the only one image. Save somewhere in your folder one image and get that image in the shell and use that image.
Karthik
I am getting attributed error at/'tuple' object has no attribute 'get'
Tony
I got the same error when I did not render the view well
Karthik
When i am solving templateproject
Beka
I am getting attributed error at/'tuple' object has no attribute 'get'
Tuple object has no attribute 'get'. Is it make sense?
Beka
Somewhere you are using tuple and get.
Isaías
Hello.
Isaías
How storage JWT token in django rest ?
Karthik
After cleaning attituderror
Karthik
I runserver but message is blank