abraham
If you don't know how to create models then you need to read the official tutorial of Django then
yes i understand .. create model but how to create format 018-04-04T06:51:02+00:00
abraham
yes already try use model datetime..
abraham
the format doesn't fit like that..
Charly
the format doesn't fit like that..
It's called ISO format: https://pynative.com/python-iso-8601-datetime/
abraham
oke thanks..
Rahil
I Think username = None if request.user.is_authenticated(): username = request.user.username
Harshit
can anyone help me with this issue https://stackoverflow.com/q/75463772/19381810
Kene
can anyone help me with this issue https://stackoverflow.com/q/75463772/19381810
I'm not sure why you need three models for user authentication. You can use one model with roles defined. class User(AbstractBaseUser): ... ... ... CUSTOMER = 'customer' STAFF = 'staff' DEALER = 'dealer' USER_ROLES= [ (CUSTOMER, 'customer'), (STAFF, 'staff'), (DEALER, 'dealer'), ] user = models.CharField(max_length=10, choices=USER_ROLES, default="your-default")
Unknown
Hi, everybody I created a telegram bot, and now I need to create an admin panel for this telegram bot I know how connecting to the django admin panel But the team leader tells me that I have to do it without the django admin panel Does anyone know how to do this
Unknown
Is there any source on this topic?
Munesh
I Am getting operational error:could not connect to the server, while running project,i am a begginer ,help
Mohammed
Or just run it again
Arshiya
Hi guys. How to set initial values for a ModelForm?
Alex
People help pliz. I will host a Django site on a hosting using nginx + bunicorn, but this server has apache with a bunch of sites based on it. The problem is that nginx by default uses the same ports as apache and when I start nginx it says the port is already taken. If I change the port in the config of my site to another one (8080 for example), then the site does not open by domain, nothing happens at all. But the site itself works fine on the IP server: 8080 or site.ru: 8080. Tech support said that my site is proxied through port 443, and I put 300, but again 443 uses apache. How to make sure that nginx is not allocated with apache and the domain is opened normally?
Arshiya
Guys I have a form form(instance=MyUserModel) for editing users A ckeck bux ‘clear’ show automaticly I dont want it What should i do?
Arshiya
Can you give me the models code
It is a AbstractUser Model I add image field to django user model The image field is like this Prof_pic= models.ImageField(null=True, blank=True)
Arshiya
It is a AbstractUser Model I add image field to django user model The image field is like this Prof_pic= models.ImageField(null=True, blank=True)
I remove the blank=True So ckeck box is gone But still get MultiValuDictKeyError ‘proc_pic-clear’
Arshiya
I remove the blank=True So ckeck box is gone But still get MultiValuDictKeyError ‘proc_pic-clear’
When i try to post the form with out choose picture I get that error
🧌
Hello! I need to have three roles - admin, vendor and customer! From what I've seen in the internet, people create vendor and customer table, but don't create admin table. Can I use admin panel functionality that comes with Django to achieve admin table/user table with admin role? Or should I create admin panel from scratch?
🧌
first create a dummy project and check out the admin panel... if what it ptovides suits your needs, then go with the defaults.. otherwise you can override it
I like the admin panel, but I don't know if it's possible to make admin panel to separate SQL table
The Inspired
no
The Inspired
admin is just a normal django user with specialized roles
The Inspired
so really its just the default django user table
🧌
I would need to create my own admin panel, is that so?
The Inspired
I mean... if you dont like it
.
How to list 2 objects separately in Django admin that are from the same single model? The use case: I have a model class named Claim. I want the admin to display 2 types of Claim instances: one is only the logged in user’s claim (e.g. defined by a field claimant = user), and another one all Claim instances regardless of the claimant. So I want the admin to display 2 objects: 1. Claims, 2. My Claims, Both of these come from the same model, only differentiated by applying a filtered queryset to the second one.
dani
Then?
Charly have You works with javascript DOM en the templete of django?
Doragonsureiyā
Charly have You works with javascript DOM en the templete of django?
Don't tag people randomly, even if they seem knowledgeable. Most of the time, the person you tagged doesn't even know about the topic you just brought up. If people want to help you, they will - just be patient.
amirhosein
Hello friends, does anyone know how I can use Chart TradingView for the Iranian stock market on my site, how can I get the library, or if anyone has it, can you give it to me so I can use it too? like this https://sahambin.com/chart
Aruu
Hlo every one,i am biginner , Can Any one tell me how can I do this What is the starting??
Aruu
Do what?
Django
🧌
🤔🤔 Could you be more precise? What exactly do you want?
Charly
Django
What do you want do with Django?
Aruu
I haven't any knowledge about django....... so I just want to say ,any one can explain to me ,what is it ,why ,uses ,work etc
Aruu
Can you suggest any youtube channel
Aruu
Can you suggest any youtube channel
Best you tube channel for django
Charly
Can you suggest any youtube channel
No, read the official documentation first
Aruu
Ok
Charly
Don't be lazy to read
Aruu
Thankuh very much
Brown
People barely read Documentations. I’m no exception
Charly
People barely read Documentations. I’m no exception
That only applies to novice or not professional developers sol senior developers should know how to use documentation
segmentation fault
Hi everyone, how i can parse a filter in url? How i can configure it. Example i have url(r"bots/(?P<pk>[0-9]+)/$", views.FooClass.as_view()) and i want to can make this request GET bots/?bg_id=number/ meaning a filter by any parameter and this GET bots/1/ meaning you want to search and particular object in database
segmentation fault
whitout modify original url
حمید
HI everyone How do I write group by for this order? Select * from test group by datestart,classes_id
@yshn
Hlo every one,i am biginner , Can Any one tell me how can I do this What is the starting??
First complete python programming fundamentals, and get into django framework.
amirhosein
Hello friends, does anyone know how I can use Chart TradingView for the Iranian stock market on my site, how can I get the library, or if anyone has it, can you give it to me so I can use it too? like this https://sahambin.com/chart
amirhosein
it doesn't seem to have much to do with Django
This is a react or html you can use with all backend
Maxim
This is a react or html you can use with all backend
Django related questions only more info in the rules
Razik
the system cannot find the file?
Razik
none of python complier is working (vscode and pycharm)
Razik
How?
Javlon Baxtiyorov
Hi everybody please Who can send me example ,testing model with pytest
Doragonsureiyā
Hi everybody please Who can send me example ,testing model with pytest
Copy that error message and paste it on a Google search, read the first results.
Doragonsureiyā
http://xyproblem.info/
Aleksey
Who can help. Who can tell you how to make a selection with an annotation, but with a grouping. there is a federal district, a region, there are daily statistics for the region, how to get the amount for each district. Now I pull it out by region like this: class DailyInfo(models.Model): region = models.OneToOneField(Region, on_delete=models.CASCADE, verbose_name='region') tek_plan_check = models.IntegerField('count_check', default=0) dailys_fed = DailyInfo.objects.filter(date=now).annotate( Sum('tek_plan_check'), )
hadi
Hello, why Django Channels is not suitable for real-time application? Does anyone have experience?
Chayeb
Hello, someone can tell me how I can create a backend authentication for phone number ?
Chayeb
Def authentication (self, request, username, password): Try: User=..... I have a problem in this line I can't understand how to access to the number filed
Chayeb
I didn't create a costumuser I just stored the number in profile model Wich have one-to-one relation with the default user model
Chayeb
It's possible to do it in this way?
Chayeb
Did you modify your model and you are trying to makemigrations?