DoT
yes
vishesh
May be settings not configured properly
DoT
restarted Django?
no , how can i do that....do you mean server(python manage.py runserver???)
DoT
yes i did
DoT
May be settings not configured properly
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '******', 'USER': 'root', 'PASSWORD': 'root', 'HOST':'localhost', 'PORT':'3306', } } is this enough to configure in project settings.py??????
Sinter
Hi there. Is there an example of how to limit tasks rate in celery? Thanks!
DoT
yes
Oloya
I am a script new who help from any of us to learn django from scratch
Doragonsureiyā
I am a script new who help from any of us to learn django from scratch
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Oloya
Thanks
@l!®€z@
Hi guys how can I get user ID in Django channels and jwt
vishesh
Hi guys how can I get user ID in Django channels and jwt
It's better to use JWTAuthMiddleware(BaseMiddleware) to extract user id from the jwt token
@l!®€z@
It's better to use JWTAuthMiddleware(BaseMiddleware) to extract user id from the jwt token
Ty and u can tell me how can I set jwt access token in ws connection
Afshin👀
hello why this message send to my admin panel not user login-messages.success(request, "Thank you for your email confirmation. Now you can login your account.")
Anonymous
Did you render messages into the html file
Afshin👀
when I login as admin I see this message but user hase to see this at the login or homepage
Afshin👀
Did you render messages into the html file
yes return redirect('login')
Anonymous
Send me the code of homepage
Anonymous
yes return redirect('login')
Yeah i get that you used for loop to go through the messages
Anonymous
If the messages are present you can able to see it
Tԋҽ Gɾҽαƚ
Band, a query, how can I validate a phone number for a form using the meta class. Note: phone number is in a model class. 🥺🥺
R
I am new to python language I need someone we can but exercise. Or a pro we can help me Really want to good in it Today makes it a month I started learning python
Rathish
Can anyone help me?I want to create two login forms one for user and another for employees or admin , I need an idea
Rathish
I am a beginner
Rathish
Creating separate login forms for my e-commerce website
theDisgrace
Can anyone help me?I want to create two login forms one for user and another for employees or admin , I need an idea
Make a table with a column named something like "type" which will tell if the user is employee or admin
vishesh
Can anyone help me?I want to create two login forms one for user and another for employees or admin , I need an idea
Create two functions, one is for staff and one is for user. Validate the staff by checking isSuperUser or not. If it is superuser then redirect it to staff page. Else, redirect the user to normal user page
Shainkey
One query from my side, For ex: if a run django server and then hit any request it's takes the same time after hitting twice thrice or else first time it will take some more time when we start the server.
Rahat
my_model = CommonFields.objects.create(created_at = datetime.now()) AttributeError: type object 'CommonFields' has no attribute 'objects'
Rahat
Solve this error
Anonymous
Check your models.py file
vishesh
my_model = CommonFields.objects.create(created_at = datetime.now()) AttributeError: type object 'CommonFields' has no attribute 'objects'
Your CommonFields class is not defined properly in your models. Need to re-check your CommonFields model
Shainkey
Yes send the CommonFields model
Rahat
class CommonFields(models.Model): id = models.UUIDField(primary_key=True, editable=False,unique=True,default=uuid4) created_at = models.DateTimeField(auto_now_add=True) created_by = models.CharField(max_length=50, blank=True, null=True) class Meta: abstract = True def str(self) -> str: return str(self.id)
Rahat
This a model.py fields
Anonymous
class CommonFields(models.Model): id = models.UUIDField(primary_key=True, editable=False,unique=True,default=uuid4) created_at = models.DateTimeField(auto_now_add=True) created_by = models.CharField(max_length=50, blank=True, null=True) class Meta: abstract = True def str(self) -> str: return str(self.id)
class CommonFields(models.Model): id = models.UUIDField(primary_key=True, editable=False,unique=True,default=uuid4) created_at = models.DateTimeField(auto_now_add=True) created_by = models.CharField(max_length=50, blank=True, null=True) class Meta: abstract = True def __str__(self): return self.id
Anonymous
Try this
Mahdi
class Movie(models.Model): name = models.CharField(max_length=45) year_date = models.DateField() city_product = models.CharField(max_length=45) genre = models.CharField(max_length=255) rating = models.DecimalField(max_digits=3, decimal_places=1) description = models.TextField(max_length=350) image = models.ImageField() slug = models.SlugField(max_length=100, unique=True) class Meta: ordering = ('-year_date',) def __str__(self): return '{}-{}'.format(self.name, self.year_date) class Actor(models.Model): name = models.CharField(max_length=150) date_of_birth = models.DateField() movies = models.ManyToManyField(Movie) image = models.ImageField() Hello, I wanted to know how I can display the actors of each movie according to this tag code
Андрей
Hello everyone! Please tell me how to save jpeg on Django correctly. I get the attached file, change the size of the image using Pillow. However, when I open a file in the admin panel, an error appears that there is no such file. How to correctly register Media nd MediaRoot? I published the website in PythonAnywhere.
Андрей
1 - debugging = false 2. I did so, but the file is saved to the root folder of the site, and not to the folder with the name media can you show an example of how to correctly register everything? maybe when saving a file edited with Pillow, you need to specify the save path?
Андрей
why not upload there? I'm still doing it for testing
Doragonsureiyā
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
◻
Can you guys tell me how to fix server error in vercel deployment, or if you know other free hosting service, i really need it.
Kareem
Are there any websites to host Django to test if the production code that i wrote is correct and will work live
Kareem
Herkou is blocked where i live.. I'm in syria
mny
Herkou is blocked where i live.. I'm in syria
you can use: https://railway.app as I did, but maybe vercel do the thing too
Tԋҽ Gɾҽαƚ
Good morning, I have a query. How can I send a message to an email after completing the form made from a Django model class Could you please send me the code on how to do it.I have tried to do it but nothing. 🥺🥺🥺
ᐧ•ΆΓí
OperationalError at /admin/blog/gallery/add/ table blog_gallery has no column named image_name How to solve this error?
ᐧ•ΆΓí
It is impossible to add a non-nullable field 'image_name' to gallery without spe cifying a default. This is because the database needs something to populate exis ting rows. Please select a fix: 1) Provide a one-off default now (will be set on all existing rows with a null value for this column) 2) Quit and manually define a default value in models.py. Select an option:
ᐧ•ΆΓí
no
ᐧ•ΆΓí
thank you
A
Hi Guys, how can I start learning Django?
Doragonsureiyā
Hi Guys, how can I start learning Django?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
ניקיטוס
hi everyone, i need to start dramatiq task after updating certain field in the model is there a solution better than using signals?
ניקיטוס
Whats wrong with signals?
i dont like that there is no builtin solution for that common task and i thought maybe it is better to implement by something else also there is some tricky moments in their triggering as far as i can see
ניקיטוס
Signals are the built in functionality for that
but there is no on_update method, or am i mistaking
ניקיטוס
These are generic
ok, thanks, i will read about that
Artem
Hello! I need help. I don't understand the error
Artem
File "C:\Users\User\PycharmProjects\bboard\venv\lib\site-packages\django\forms\fields.py", line 267, in init super().init(**kwargs) TypeError: init() got an unexpected keyword argument 'widjet'
Doragonsureiyā
مريم خالد
is there is any way i can create data of another model using a foreign key relationship in Django Rest Framework
Artem
widget, not widjet
I'm silly
Naseem
Which one to use for push notifications fcm-django or django-push-notification
Rahat
Which one to use for push notifications fcm-django or django-push-notification
Small data base for use fcm but big database no use fcm
ARS
Hi
ARS
I have a question
ARS
I tried deployment on serverless like vercel
ARS
It didn't worked out. For databases