Alex
Kavya
I've issue with importing JWT in django rest framework.anyone can help
Kavya
Error is "import "rest_framework_simplejwt" could not be reloved
Abrar Abu
I have to add fields in serializer and which are not part of model how do I achieve that
Example is during sign-up
Password and confirm password i can take as input and save only password
I want to achieve this this in django rest framework
Mirco
bansh
May be it will be work.
GLuko
Yo guys, can someone helps me?
GLuko
I have this error
'DiscordUser' object has no attribute 'is_active'
GLuko
when I went to my admin page
GLuko
class DiscordUser(models.Model):
objects = DiscordUserOAuthManager()
id = models.BigIntegerField(primary_key=True)
discord_tag = models.CharField(max_length=100)
avatar = models.CharField(max_length=100)
public_flags = models.IntegerField()
flags = models.IntegerField()
locale = models.CharField(max_length=100)
mfa_enabled = models.BooleanField()
last_login = models.DateTimeField(null = True)
def is_authenticated(self,request):
return True
GLuko
I only have this model and class DiscordUserOAuthManager(models.UserManager): with class DiscordAuthenticationBackend(BaseBackend):
GLuko
how to fix this?
Alex
GLuko
GLuko
GLuko
how to change this?
Of course
Hello , why in Comment form don't raise error_message when I remove required in inspect ellements and leave input field empty or space?
Anonymous
match action:
^
SyntaxError: invalid syntax
i am using python 3.10.5 version and i have 3.10.4 in my runtime.txt
Alex
Of course
add validator in form backend
I just want when user_name input is empty raise a error massage but don't raise. in my previous project error was raised default
Alex
Of course
Alex
Of course
no
so why this form don't raise error massage?
Alex
share your codebase.
Krushna
Integrated slack with django, used block's static select option in chat_postMessage.
I've got request_url payload for static_select options.
When I select any one option I get response and if I select other option I'm getting response for that too.
How can I make it select only one option and then disable the dropdown menu so that it won't be selected again?
Of course
share your codebase.
class Comment(models.Model):
user_name = models.CharField(max_length=30, null=False)
email = models.EmailField()
text = models.TextField(max_length=400)
post = models.ForeignKey(
Post, on_delete=models.CASCADE, related_name='comment')
def __str(self):
return self.user_name__
Of course
share your codebase.
class CommentForm(forms.ModelForm):
user_name = forms.CharField(required=True)
class Meta:
model = Comment
# fields = 'all'
exclude = ['post']
labels = {
'user_name': 'Your Name',
'email': 'Your Email',
'text': 'Your Comment'
}
error_messages = {
'user_name': {
'required': 'You must enter a user name.'
}
}
Of course
no
<section id="comment_form">
<h2>Your Comment</h2>
<form action="{% url 'post_detail_page' post.slug %}" method="POST">
{% csrf_token %}
{% for field in content_form %}
<div class="form-control">
{{ field.label_tag}}
{{ field }}
{{ field.errors}}
</div>
{% endfor %}
Alex
Of course
Of course
Of course
Alex
Of course
Of course
Bhaskar
I need help in django project
Bhaskar
Plz help me
Jagadish
Hi
Jagadish
What help do you need
Bhaskar
My project is run but when i am giving data in registration form but data is not passing to MySQL
Charly
Bhaskar
The current path , register, didn't match any of these
Jagadish
Maybe send a screenshot of error
Bhaskar
Sending media is off in this group
Alex
Bhaskar
Now giving MultiValueDictkey Error
Erkaboy
Hi all. I'm going to make project in DRF like this: user gives an order and it should be seen for workers in real time. So I need some advices for that. Shuold I use channels or some thing else?
cj
Erkaboy
Erkaboy
I couldn't figure out what to do.
cj
I couldn't figure out what to do.
if you really want to be stuck with DRF, them you may make an endpoint end poll to it from your client, but don't expect good performance while doing that when you have a high load from many clients ¯\_(ツ)_/¯
Erkaboy
cj
Марк
Hello. https://pastebin.com/yXZuNxEt
need help. You need to write a script in a file migration that ProfileSettings are created for all profiles (that have already happened)
Here's what I got https://pastebin.com/p6gAmeGm
The migration takes place in the database of nothing enterprise.
GLuko
I start my project from start and I can easly connect to localhost:8000/admin but when I try to use my model for discord I have problem: 'AnonymousUser' object has no attribute '_meta'
I found that when I put 'django.contrib.auth.backends.ModelBackend',(standart auth) and 'oauth2.auth.DiscordAuthenticationBackend', (discord oauth)
when I login into discord
all works fine
but when I go to my admin site
I have error
'DiscordUser' object has no attribute 'is_active'
Alfonso
Ok, I want to add a field to an existing table, I read that shemaeditor has a function to do that but I can't make it work.
Alfonso
with connection.schema_editor() as shema:
last name = models.Charfield(max_lenght=15, null=True, blank= True)
schema.add_field(My own model, lastname)
And the error is
'Charfield' object has no attribute 'column'
Krushna
Hello. I'm using slack's interactive messages: static select menu option inside blocks of chat_postMessage to send message to channel.
I'm getting payload from request_url when anyone select one of the options. I'm sending selected option to db.
Problem is once I select a option, an entry is added to the db and when I select it again it gets saved again.
Whit I want is: once an option is selected then select menu should be disabled i.e. we shouldn't be able to select any options.
So far I've added confirm and deny options for selection but still I can select any option as many times I want to.
Maybe I'm bad at searching but I didn't get results related to this.
Anyone would like to suggest something?
Anonymous
GLuko
I start my project from start and I can easly connect to localhost:8000/admin but when I try to use my model for discord I have problem: 'AnonymousUser' object has no attribute '_meta'
I found that when I put 'django.contrib.auth.backends.ModelBackend',(standart auth) and 'oauth2.auth.DiscordAuthenticationBackend', (discord oauth)
when I login into discord
all works fine
but when I go to my admin site
I have error
'DiscordUser' object has no attribute 'is_active'
Anonymous