Mirco
No single-line
You can do it
Yuriy
You can do it
I'll check now...
Mirco
<p> {% trans "whatever you wanna" %} </p>
Mirco
Here u go
Mirco
I think Django doesn’t support translate with html tags
That's not true, you can use blocks or just single html tag content
Djasur
That's not true, you can use blocks or just single html tag content
I have said I think. If it’s possible that’s cool
Yuriy
<p> {% trans "whatever you wanna" %} </p>
No, I need so {% trans "whatever <br>you wanna" %}
Mirco
No, I need so {% trans "whatever <br>you wanna" %}
Just do {% trans "whatever" %} <br> {% trans "you wanna" %} Or much better, use CSS
Mirco
Two %trans . May be I was right about tags
It's the perfect scenario where is better to use CSS instead of br tags to format the text
Mirco
But i18n can be used for single tags What you thought isn't true Django can use both transblock and single trans
Moshe
I am currently working on django restful api with a React frontend. I have hard time working with the default pk. Is it a good design to use DateTime as a pk? Do you guys have any suggestion how to work with pk's with api?
Moshe
Use UUID as pk
I heard UUID as a huge problem with performance, did you experienced it?
Mirco
I heard UUID as a huge problem with performance, did you experienced it?
Nope and thinking too early on optimizations is the source of every evil UUID as pk is one of the most common best practices in Django
Doragonsureiyā
Ok, thanks mate
You're welcome! 😊
Zdravo
Hi guys, i want to implement a model where user can save album of multiple pictures and videos. How can this be achieved in django models?
Doragonsureiyā
Thanks brother
You're welcome! 😊
Dilipkumar
I have a project which is written in PHP and MySQL, how to convert the same into Django with existing table structure, i.e table structure should not be changed, please advise
EXTRA
Hi, tell me, what's the trouble? (Models are not registered in the Django admin panel) 1) Wrote the model #models.py class BookName(models.Model): title = models.CharField(max_length=255) 2) Made the migrations > py manage.py makemigrations > py manage.py migrate (Everything went well. Everything was created in the database) 3) The model in admin.py registered admin.register(BookName) 4) The application itself is illustrated in settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'drfservice', ]
Yuriy
Just do {% trans "whatever" %} <br> {% trans "you wanna" %} Or much better, use CSS
I solved the problem. I just created MSGID "Word <br> Word" and translation for it. And it works for me. No additional effects required.
Mika
Hii, whats is the best pratice to create viewset convention? If i have 2 model (book,place) I must create 2 viewset? 1 per model?
@LSR
How can i calculate rank of student based on marks like Student A B C D E Marks. 10. 8. 5. 5. 3 Rank. 1. 2. 3. 3. 4 How can i do this
Icecold Sensei
How can i calculate rank of student based on marks like Student A B C D E Marks. 10. 8. 5. 5. 3 Rank. 1. 2. 3. 3. 4 How can i do this
https://stackoverflow.com/questions/58103721/how-to-find-the-rank-of-students-respective-of-their-marks
Charly
What kind of php framework?
It doesn't matter
Djasur
It doesn't matter
I asked because, if he use some framework, i will be easy to explain. Php Controllers - views Php Db-models Php Views-templates
Maxim
I have a project which is written in PHP and MySQL, how to convert the same into Django with existing table structure, i.e table structure should not be changed, please advise
you just have to describe the existing structure through Django's ORM models i don't think there are tools to automate this
Maxim
I asked because, if he use some framework, i will be easy to explain. Php Controllers - views Php Db-models Php Views-templates
you are trying to answer a question that has not been taken up It can help the person asking, or it can be confusing
Shabbir
I created a custom user model... and extended the user class... but my login page is only logging in admin....other users are not able to login in...i don't know what the problem is...
Shabbir
how did you add password
https://linkode.org/#nJ9u1yWX7LG3q80HqyVke
Fan / Ac
https://linkode.org/#nJ9u1yWX7LG3q80HqyVke
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html
Pradip
Can anyone suggest django sqlite online course from online e lerning platform like Coursera,udemy?
Den
File "manage.py", line 17 ) from exc ^ SyntaxError: invalid syntax
Den
ask permission. is anyone here using a macbook pro m1. experiencing an error like this?
Manavver
Command will be : python3 manage.py runserver
Den
ModuleNotFoundError: No module named 'rest_framework'
Manavver
Pip install django rest framework
Manavver
python - django - download and install django rest framework - Stack Overflow https://stackoverflow.com/questions/29339800/django-download-and-install-django-rest-framework
DOUBLER_GATES
hi guys am requesting help on, Django biometric integration. Any tips, nudge, hints or help
Yehor
Hi there, I have question not exactly about django, but it's better to ask someone releted to django I dockerized my django project and moved all creds from settings to .env files Now when I whant to run manage.py createapp inside container it creates me a files with new app, but they don't appear in a project files on a host os, should I not copy my project files but use volumes within dockerfile ? what is best practice so i could run manage.py commands and migrations, apps, etc appears right in a workfolder ?
Shabbir
Any resources or guide... for hosting django app with mysql.... How to setup the server....Ubuntu for instance
Lakshya
Hello everyone. I'm trying to build a whatsapp chatbot using the documentation here: https://api.messengerpeople.dev/docs/authentication I've used postman and generated a token and I also notice there was a python code automatically generated. Would the next step be to create an authentication app inside my project and paste this code inside a function created inside views.py?
Lambda
Hi! Im need help. Exist some website on django, this created by another developer. Im add model: class Test(models.Model): last_name = models.TextField() first_name = models.TextField() class Meta: verbose_name_plural = "Test" and registry this: @admin.register(Test) class TestAdmin(admin.ModelAdmin): pass next, im restart server: systemstl restart uwsgi.service my model added in admin panel but click "Test" link or "change" link make error 500. how to fix? tnx
Д
how to get correct app name for first command?
it's the one defined in settings.py but basically it's just the folder name where your Models.py normally is
Д
WSGI_APPLICATION = 'nature.wsgi.application' this?
I'm not sure honestly. I've literally never touched that setting. I'm thinking about INSTALLED_APPS = [..., 'your_app_name']
Д
WSGI_APPLICATION = 'nature.wsgi.application' this?
you can try that. if it finds changes in the models, basically the Test model you created, you're good. the makemigrations command just tries to find new Models from the python files and create Migrations classes for them.
Д
the Migrations classes will be created and have the code with the instructions on how to change the DB. then the migrate command looks for all the Migrations classes and applies them in order.
Lambda
I'm not sure honestly. I've literally never touched that setting. I'm thinking about INSTALLED_APPS = [..., 'your_app_name']
in this array exist element 'core.apps.CoreConfig', dir includes models.py named is core. core.apps.CoreConfig its their?
Lambda
hmm I don't think so. not sure.
try value "nature.wsgi.application"?
Д
try value "nature.wsgi.application"?
you're making this harder than it needs to be. the makemigrations shouldn't break anything even if you run it.
Д
I don't remember what the precise values of these things are because I always create my own apps so I know the names for my folders and apps
Lambda
I don't remember what the precise values of these things are because I always create my own apps so I know the names for my folders and apps
python manage.py makemigrations nature.wsgi.application File "manage.py", line 14 ) from exc ^ SyntaxError: invalid syntax
Lambda
im not edited manage.py
Д
okay so that's not correct
Д
try Core or CoreConfig
Lambda
try Core or CoreConfig
one result. maybe manage.py is broken?
Д
one result. maybe manage.py is broken?
manage.py is not broken. One result means it found the Test model