abraham
Charly
abraham
yes already try use model datetime..
Charly
abraham
the format doesn't fit like that..
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
Mohammed
Or just run it again
Not-so-Slim
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?
cj
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?
Dhananjoy
Dhananjoy
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
Arshiya
🧌
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?
The Inspired
🧌
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?
Charly
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
Charly
Aruu
🧌
🤔🤔 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
Charly
Aruu
Can you suggest any youtube channel
Aruu
Aruu
Ok
Charly
Don't be lazy to read
Aruu
Aruu
Thankuh very much
Brown
People barely read Documentations. I’m no exception
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
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
Maxim
Maxim
Razik
the system cannot find the file?
Doragonsureiyā
Razik
none of python complier is working (vscode and pycharm)
Ali
Razik
How?
Javlon Baxtiyorov
Hi everybody please Who can send me example ,testing model with pytest
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'),
)
Aleksey
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?