Aamer
Guys, How i can post some radio button in a form to views.py ?
You can give a name to html radio tag, and you will get a Boolean (true/false) value along with that name in request.POST (in views.py)
AKSHARA REDDY
They specified django there But the point Iam not getting how to play the audio from the PC
Aamer
Husen
Hello everybody. How to output matching data when typing in search field in drf?
Aamer
Guys I have a html page that plays the audio and shows the transcript All the audios and transcripts should be taken from the PC how should I create the django framework
Do you want User to select one file and it plays Or you want website to show all files from pc and user clicks on anyone to play?
ㅤ
What library is the best for seeding?
Aamer
Hello everybody. How to output matching data when typing in search field in drf?
You will need an onkeyup event listener on search input which calls an api endpoint (with search input ) to fetch matching results API endpoint should take the search string and filter records with ORM query and return filtered objects as response
Aamer
What library is the best for seeding?
django-seed is good to go Do you want seeding for fake/dummy data for testing or some migration kind of stuff?
ㅤ
django-seed is good to go Do you want seeding for fake/dummy data for testing or some migration kind of stuff?
I wanna make some fake and some real data, I used django-seeding but it seed all for one time, so I got errors
Aamer
I wanna make some fake and some real data, I used django-seeding but it seed all for one time, so I got errors
Probably that should be an order and priority issue Or in case you have co dependant signals, that could be one too
Aamer
I wanna make some fake and some real data, I used django-seeding but it seed all for one time, so I got errors
If you don’t have much models, you can write a short script with custom behaviour You can use random to generate random numbers as texts But if you want some serious data, you can share the code, it would help identifying where’s the issue
ㅤ
Can I send u git?
Aamer
How to implement service in Django which has to take user's uploaded file then check it in order to detect does it contain malware and if does not then to save in db, otherwise reject?
You can create a function which takes file stream, verifies it clamd (or any other library) and return true/false based on its safe or not And you can call this function in Django form by overriding validate method and raise ValidationError if it’s not safe
Aamer
Yes, I tried to open each image I had uploaded through the admin site, the URL looks like this: localhost:/8000/media/item_images/watch.jpg This is the URL while trying to make sure I had uploaded correctly.
This url seems incorrect If it’s not a type mistake, then you need to fix MEDIA_ROOT in settings.py If it’s typo mistake, are you able to load the image when you click in admin panel?
ㅤ
Sure
https://github.com/YourG0d/magazin1
Aamer
Please how do I solve the error: "image attribute has no file attached to it" I have done the configuration in my settings file, and m using something like {{item.image.url}} in the IMG src to reference it. What m I doing wrong?
One more issue could be If your image field is optional and one or some items aren’t having image and you are looping over them in html Then for those items which doesn’t have image, it’s raising this issue If this is the case, you can add condition in html before accessing the image {% if item.image %} <img src="{{ item.image.url }}"> {% endif %}
Rupan
Exception inside application: No route found for path 'socket.io/". Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\site- packages\django\contrib\staticfiles\handlers.py", line 101, in __call_ return await self.application(scope, receive, send) ǝl! vvvvvvvvvv۷۷۷۷۷۷۷۷۷۷۷۷۷۷۷VVVVVVVVVVVVVVVVVVVV "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\site- packages\channe^routing.py", line 62, in call return await application(scope, receive, send) ۸۸۸۸////////////////////^^^^^^^^^^^^^^^ File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\site- packages\channels\routing.py", line 134, in_call_raise ValueError("No route found for path %r." % path) ValueError: No route found for path 'socket.io/" Any one help me with it plz.
Aamer
https://github.com/YourG0d/magazin1
RoleSeeder must be called before StaffSeeder as you have foreign key relations there To do so, you will need to add dependency in staffseeder, depends_on = [“RoleSeeder”]
ㅤ
Don't work:(
Aamer
Don't work:(
What’s the error you are getting?
ㅤ
Same, role matching query does not exist
Carlos A.
Hi All, how can I use a custom rule for the naming convention used in the primary keys and foreign keys ? Thanks in advance.
Aamer
Don't work:(
perhaps something is breaking the order quick solution would be manager_role, _ = Role.objects.get_or_create(role_name='manager') admin_role, _ = Role.objects.get_or_create(role_name='admin') this will create role object if doesn't exists without giving error same you can apply for category
Aamer
Hi All, how can I use a custom rule for the naming convention used in the primary keys and foreign keys ? Thanks in advance.
not sure what you exactly mean about naming convention if you want to use a custom name for foreignkey related object name then you can use 'related_name' attribute in Foriegnkey field if you want custom column name in database then you can use 'db_column' attribute in any field let me know if you were looking for something else
ساره
Greetings, I’m working on a Django project and I’m trying to integrate it with tailwind But when I run this command line Python manage.py tailwind init I get this error message : ‏importerror: cannot import name 'get_config' from 'tailwind' If anyone has a solution for it I’ll be grateful.
Deni
Seems like version issue Perhaps tailwindcss version isn’t suitable with Django / pythons version
I am use django, and tailwindcss, but no have somethink problem. What problem you have in django - tailwindcss ?
Антон
good afternoon to everyone, I’m making an application in Django and JS, I need to enter data from Telegram, then a window pops up where I have to enter code from Telegram. How should I handle this in Django? (Using telethon)
Joe
Good day, I am a Django beginner and I'm working on an E-commerce website so I linked my CSS to my base html file but when I run the server and refreshed my cache, it's still not applying my CSS, how best can i solve this? Thank you
Ninj
Can you show?
Ninj
Yes I did
Do you have the same problem with other static files like images or just CSS?
Joe
Do you have the same problem with other static files like images or just CSS?
I haven't added anything else, I just wanted to check if my CSS is configured correctly
Joe
Can you show?
I couldn't have sent a picture in here but unfortunately I am not allowed to
Ninj
I haven't added anything else, I just wanted to check if my CSS is configured correctly
Try to load an image as a static file and see if it's displaying. This way I will know if the problem is general to static files or if it's specific.
Ninj
I mean server response code.
Joe
I mean server response code.
it's running perfectly The response status code is 200 But it's not applying css
Cimpah
Hello. I want to have a calendar for birthdays in my django project. I have a model Student with columns; name date_of_birth sex course(FK) etc
Emre
Hello, I am using a schema in Postgresql, my table is located under the manager schema, django_session is in my table, so I am trying to use session in the view there, but django cannot find django_session because it looks at the public schema by default. how can i fix this?
Richard
Hello, how to use fingerprint in Django ?
Joe
Normally after clearing cache it should work.
Yeah, I actually cleared cache, changed browsers but still it's not working
MUHAMMAD
Hellow friends,I ma new to django learner. Which database to choose between postgres and mysql????????????
MUHAMMAD
Ples help
MUHAMMAD
Ok
MUHAMMAD
But few reasons why chose psotgres?
MUHAMMAD
To motivate me
Mirco
To motivate me
to unblock Django superpowers 😊 PG has many more powerful features in comparison with mysql especially with Django
Rafik
Does anyone used DaisyUI (Tailwindcss components library) as a Tailwindcss plugin (Not via CDN) in a Django project before?
Rose
Does anyone used DaisyUI (Tailwindcss components library) as a Tailwindcss plugin (Not via CDN) in a Django project before?
Don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask directly! The better you are at explaining the problem, the more likely you are to get help. If you don't know what that means, read Asking Smart Questions (http://catb.org/~esr/faqs/smart-questions.html#intro).
Abolfazl
the section of the code: https://dpaste.org/WFyt5#L16 guys, i have this in my template how i can know what user choose in views.py (it is in a form)?
Rishav
About the form
Abolfazl
About the form
look at the full section: https://dpaste.org/n7GH6
Abolfazl
look at the full section: https://dpaste.org/n7GH6
I want to know which of these radio inputs user choose (from their id attribute)
@l!®€z@
hi guys can u help me this is my code user = django_filters.ModelChoiceFilter( label=gettext_lazy("User"), field_name="user", queryset=lambda request: ModelLogEntry.objects.all().get_users(), ) and this is my error RuntimeError: Unable to resolve relationship user for model log entry.ModelLogEntry. Django is most likely not initialized, and its apps registry not populated. Ensure Django has finished setup before loading `FilterSet`s.
Abolfazl
You can use a drop down menu
thanks for your attention, i figured it out myself
@l!®€z@
Have you run the migrations
I can't run project or run migrations
@l!®€z@
I get this error
User
i need hlp in python code can any one help