Bandar
Thank so much (^_^)
Ramin
Hey guys! could you please help!! How can I gain the main path of the temporary uploaded file in django?
Vladimir
Hi, I have to design adreess and contact table for my client. There si partners/customers/company… tables that need to have adress and contact data. I created Contact table with value field and foreignkey to contactype table. Same patern for Address table, fields for address information and foreignkey to adresstype table. Partners/Customers and other tables doesnt need the relation beetween addresses with contacts(what is contacts for specific address), but there is specific need of installation process where some employees need to know where to go(address data) and what contacts are for that locations. I have a lot of ideas but doesnt know what is the best. Solution 1: create intermidiate table AddressContact(foreignkey to address and to contact) Solution2: create new ContactAddress table which will have value, type and address(foreignkey) fields Solution 3: create Instalation table which will have foreignkey to address table and additional fields telephone,email, mobile phone
Vishal kumar
Will deploying a django project on pythonanywhere 1)how can I store the media
Vishal kumar
The media upload by user is not showing in database.can someone help
@h_llary
the media, how are you storing in the database?
Charly
First you need to choose one payment processor then you can follow their documentation or search for an specific tutorial
Sieg
Does anyone know how to add the Bearer Autho to drf_spectacular swagger UI? I can't seem to get it there. All its bringing out is the tokenauth and sessionauth field I'm using custom pyjwt setting
Vincent
Hello. What's better to use if I need permissions with ability to disable or enable them INDIVIDUALLY and IN GROUP?
:q!
hi, help, please. How i can change position of TabularInlines (with other fields) in django admin (django 2)
:q!
I have some fields and 2 inline, a must insert field between 2 inlines in django admin
.
I have some fields and 2 inline, a must insert field between 2 inlines in django admin
Ok I don’t have any idea other than hackishly using JavaScript to rearrange the DOM.
Kaustab Roy_C_24_CSE(AIML)
hello, is there a way to get a value before submitting a POST method form?
Zhaks
Hello, there! Are there special APIs with a long response for testing asynchronous requests?
Venkatesh Akhouri
Hey guys I am creating a e commerce project with django My question is i am using models from django.db, can I save the data in MySQL Or is it better to use MySQL as a database
Venkatesh Akhouri
So if i want to save data in a MySQL db, can we do that, it can be then used for further analysis, ML/DS projects
Dodullo
So if i want to save data in a MySQL db, can we do that, it can be then used for further analysis, ML/DS projects
Doesn't matter, for development or learning purposes you can use sqlite, but for production use MySQL, Postgres, Oracle..
Dodullo
How can i create dynamic queues in celery using data from database?
Dodullo
Something like that: Queue('event', binding(exchange=Exchange(f"{fromDB}.events", type='fanout'), routing_key=f"{fromDB}"))
Dodullo
The issue is i can't import models that i need insinde the celery .py file
Dodullo
Throws django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet error
Aji
Hey, can anyone help me deploying django webapp in IIS windows server. I've completed the hosting with wfastcgi. But while running it's throwing a configuration error. Can any one help me out of this. Thanks in advance
Сантино
Hi everyone I need small help . How can I need to document my code in django but I don’t know any instance, can anyone give me some repository?
Aji
What's the error?
Configuration error, it shows something about permission. I've tried every way, gave every access and permission still it's not working
Zen
I wanna display photo that I uploaded in the admin panel. How can I do that?
Alessandro
How can I write unit tests for a redis request?
Alessandro
The problem is that I'm using the full text search stuff, I don't think in this case will be a good solution
Shrey
If suppose we have separate apps for Admins and Users inside the same Django Project, can we create a functionality that will provide admins to login as a particular user and view or update the user's details !?
Rishabh
Yup admin can view all instances
You can restrict other users as per their roles
Shrey
Can I get an example of how to do this or what should be the procedure !? Like stepwise integration
Happy
Save that files in media and use them commonly
https://overiq.com/django-1-10/handling-media-files-in-django/
null
I wanna display photo that I uploaded in the admin panel. How can I do that?
def image(self,obj): return format_html('<img src="{}" style="width: 45px; height:45px;" />'.format(obj.image.url))
Scrix
hi, I ran into a problem when configuring gunicorn for my site: ModuleNotFoundError: No module named 'mans.wsgi' (gunicorn file: https://pastebin.com/4Bh8KX0C), please help
Dodullo
How can i create dynamic queues in celery using data from database? Something like that: Queue('event', binding(exchange=Exchange(f"{fromDB}.events", type='fanout'), routing_key=f"{fromDB}")) The issue is i can't import models that i need insinde the celery .py file Throws django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet error
Dodullo
Any help would be apreciated
Alexey
In settings app installed?
Kiarie
I have a Django website for my project. When I’m in my dashboard and copy the url, then log out, then paste the url in my browser, it takes me back to my dashboard but it should ask me to login
Kiarie
How can I solve that
Denes
give me a django project tutorial using window
Doragonsureiyā
give me a django project tutorial using window
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Satya Anurag
Hi, I'm not sure how to models data directly in template. For ex: {{ request.user.first_name }} gives us directly the user's name. I'm having two models in my app. I can get the first model's data in template by {{ request.user.profile.about }}. But cannot do the same thing in my 2nd model. I want to get "partner_1" & "partner_2" fields. I was trying: {{ request.user.relationship.partner_1 }} but didnt work. Please refer to my models.py: https://hastebin.com/share/jufoxepexa.python
Kaustab Roy_C_24_CSE(AIML)
Get from where?
From the html form, before submitting
Charly
From the html form, before submitting
You can do it with JavaScript
Rupali
Anyone know SMS shots code and long code setup?
Its me
Anyone know SMS shots code and long code setup?
Just do a dlt registration and register templates then u will get a templated id and dlt id by using this u can send sms using any sms providers. Mostly it will be a get request or post request call from python code will do it for u
Satya Anurag
Try this request.user.profile.boy.all request.user.profile.girl.all
I tried it. When I use request.user.profile.boy I'm getting output: home.Relationship.None Any solution?
Satya Anurag
and when i'm using request.user.profile.boy.all, I'm getting <QUERYSET []> in webpage.
.
I tried it. When I use request.user.profile.boy I'm getting output: home.Relationship.None Any solution?
You’ll need to use attribute .all to access related items. Without it, you won’t get the resulting values. You get empty queryset because in your database there are no Relationship objects whose boy field = the request user’s profile. Try to create one or two of that and see the results again.
Satya Anurag
I have two profiles created of users. Then I created a relationship object where partner 1 is first profile & partner 2 is second profile.
Satya Anurag
Still not getting
Satya Anurag
I also logged in by the same profile (user)
Suren
Hi, I have inline fields as below, how can I apply TranslationAdmin so that I get only langueages fields? en & ru for example. Currently I have program, program[en] & program[ru]. I just have no idea how to remove "program" class ProgramAdmin(admin.StackedInline):
.
Still not getting
Try experimenting more, sometimes I forget myself. Check these one by one in template request.user request.user.profile Check those first if you’re getting what u want
Harshit
I have made an authentication system using simplejwt in DRF While testing with Postman I pass key Authorization and value Bearer <token> in url header on protected urls and everything works fine on localhost . But I want test it using drf web API and I don't know how to give token in headers for protected urls . I tried http://localhost/protected url/?Authorization: Bearer <token> But getting " credentials not found " Am I doing it right ?
.
Hi, I'm not sure how to models data directly in template. For ex: {{ request.user.first_name }} gives us directly the user's name. I'm having two models in my app. I can get the first model's data in template by {{ request.user.profile.about }}. But cannot do the same thing in my 2nd model. I want to get "partner_1" & "partner_2" fields. I was trying: {{ request.user.relationship.partner_1 }} but didnt work. Please refer to my models.py: https://hastebin.com/share/jufoxepexa.python
I think I found your issue. Your Relationship str method should return a string, but yours is returning a tuple, so that’s actually a problem that should rise when you save objects in your admin. I wonder how you didn’t encounter that. Anyway, to solve it, apart from using request.user.profile.boy.all, also modify your str method to be perhaps something like return f’{self.first_name}, {self.last_name}’. This makes it a string. Otherwise you were giving a tuple.
Harshit
Mention token, in the header section
From where and how to access header section ?
Übermensch
Hello, I want to ask a question to experienced developers: I have been studying Django for the second month and have learned a lot during this time, I need advice on what to do next. In a few months I'm moving to Kyiv and I want to be able to work as a programmer, what knowledge should I improve in terms of Django in order to be able to compete for a developer position? what projects should be taken for a portfolio and where to get the layout for the project?
Übermensch
I also studied aiogram for some time, is it worth focusing on the development of telegram bots or is it better to concentrate entirely on Django?