Abbosjon Vositov
I think django has no future for good career growth
Tbh it is relative, DRF is still quite popular and on demand, easy to maintain so I see many job offers where knowledge of DRF is required
KAKASHI
Hello friends. Have nice day. Has anyone liking system resource code?
Doragonsureiyā
Hello friends. Have nice day. Has anyone liking system resource code?
This group is to help you on specific issues you have on YOUR code, so you have to show the code you wrote and explain where and why you are stuck... as simple as that
Y
best channel for learning django + reactjs????
Doragonsureiyā
best channel for learning django + reactjs????
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
mahyar
when i use createsuper user command i got this error ValueError: Field 'id' expected a number but got 'm@gmail.com'. m@gmail.com is my superuser email
mahyar
when i use createsuper user command i got this error ValueError: Field 'id' expected a number but got 'm@gmail.com'. m@gmail.com is my superuser email
my code: class UserManager(BaseUserManager): def create_user(self, email, password, **extera_fields): if not email: raise ValueError('the email must be set') email = self.normalize_email(email) user = self.model(email, **extera_fields) user.set_password(password) user.save() return user def create_superuser(self, email, password, **extera_fields): extera_fields.setdefault('is_staff', True) extera_fields.setdefault('is_superuser', True) extera_fields.setdefault('is_active', True) if extera_fields.get('is_staff') is not True: raise ValueError('super user must have is staff==true') if extera_fields.get('is_superuser') is not True: raise ValueError('super user must have is is_superuser==true') return self.create_user(email, password, **extera_fields) class User(AbstractBaseUser, PermissionsMixin): """ Custom user model for app """ email = models.EmailField(max_length=255, unique=True) is_superuser = models.BooleanField(default=False) is_staff = models.BooleanField(default=False) is_active = models.BooleanField(default=True) #is_verified = models.BooleanField(default=False) USERNAME_FIELD = 'email' REQUIRED_FIELDS = [] objects = UserManager() created_date = models.DateTimeField(auto_now_add=True) update_date = models.DateTimeField(auto_now=True) def __str__(self): return self.email
The Inspired
my code: class UserManager(BaseUserManager): def create_user(self, email, password, **extera_fields): if not email: raise ValueError('the email must be set') email = self.normalize_email(email) user = self.model(email, **extera_fields) user.set_password(password) user.save() return user def create_superuser(self, email, password, **extera_fields): extera_fields.setdefault('is_staff', True) extera_fields.setdefault('is_superuser', True) extera_fields.setdefault('is_active', True) if extera_fields.get('is_staff') is not True: raise ValueError('super user must have is staff==true') if extera_fields.get('is_superuser') is not True: raise ValueError('super user must have is is_superuser==true') return self.create_user(email, password, **extera_fields) class User(AbstractBaseUser, PermissionsMixin): """ Custom user model for app """ email = models.EmailField(max_length=255, unique=True) is_superuser = models.BooleanField(default=False) is_staff = models.BooleanField(default=False) is_active = models.BooleanField(default=True) #is_verified = models.BooleanField(default=False) USERNAME_FIELD = 'email' REQUIRED_FIELDS = [] objects = UserManager() created_date = models.DateTimeField(auto_now_add=True) update_date = models.DateTimeField(auto_now=True) def __str__(self): return self.email
need to create USERNAME_FIELD in your create_user method and set it to email https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD
Vikash
?
You need to add in allowed host
Rud
hi, i have query in local db postgresql , then the result for now i put into data.json , i click update button in order to fetch the new result in django client side will fetch the data.json directly the problem is if i update the data.json , client side won't be able to fetch the newest one until i hard refresh / remove cache . what will be the idea ? should i need go with api or ?
fereshte
Hi, I install DRF, but when I try to import something from it, it gives an error the error is: Import rest_framework.response could not be resolved Does anyone know how to solve it?
Maxim
Take a Screenshot
don't give bad advice pictures are not allowed here
Doragonsureiyā
Hi, I install DRF, but when I try to import something from it, it gives an error the error is: Import rest_framework.response could not be resolved Does anyone know how to solve it?
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://hastebin.com - https://bin.kv2.dev
KAKASHI
Hello How can I add the currency of my country?
Doragonsureiyā
Hello How can I add the currency of my country?
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
vikrant
You need to add in allowed host
I already added my domain to the allowed hosts, but what about these types of requests? [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'www.shadowserver.org'. You may need to add 'www.shadowserver.org' to ALLOWED_HOSTS. [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'api.ipify.org'. You may need to add 'api.ipify.org' to ALLOWED_HOSTS. [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'ad608a31b0be:8000'. You may need to add 'ad608a31b0be' to ALLOWED_HOSTS. How do I handle these types of requests?
abbas
[Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'www.shadowserver.org'. You may need to add 'www.shadowserver.org' to ALLOWED_HOSTS. [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'api.ipify.org'. You may need to add 'api.ipify.org' to ALLOWED_HOSTS. [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 'ad608a31b0be:8000'. You may need to add 'ad608a31b0be' to ALLOWED_HOSTS.
pranav
any tutorial on deploying a django app on ec2 which has celery and redis in it
The TokenTitan
I am using drf, so I want to implement something of the django inlineformset_factory excatly in drf, Such that I have a product and productImage models where the productImage is the child of the product model When the product model is being edited, the associated productimage model is also edited in the same time. How can I do this in djangorestframework
Saif
Hey I need resources to learn django
Doragonsureiyā
Hey I need resources to learn django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Taha
Is Django recommended for beginners to learn backend dev? I am good in python language.
Yeah , if you are good at python , the best language for backend is Django for you
Taha
So how can I put a chatbot with admin with session and channels with Django??
Taha
Sth that the public can communicate with admin in the web
Taha
Also we do it with session and channels Django
Taha
But I don't know how
Charly
Sth that the public can communicate with admin in the web
Comunicate with admin or with the chatbot, that part is not clear
Taha
Communicate with admin
Charly
Communicate with admin
So not a chatbot but a chat room?
Taha
Somehow
Taha
Yep
Taha
What's your opinion?
Charly
What's your opinion?
To search any chat tutorial with channels, then just adapt the pat of the ooms to have only one use and the admin
Taha
Are you kidding??
Charly
Taha
I know that and I tried but it didn't work even
Charly
I know that and I tried but it didn't work even
We don't know what exactly you have done, but thats the way.
Taha
Have it you way
Taha
Tnx
Данuло
Is it conventionally acceptable to call djnago-project's apps like "authApp" or should i use more python-friendly "auth_app"?
Иван
id (primary key) guid name 1 6d480b98-6e54-425c-9c7a-736ddd95b48a wood 2 de2562f3-bbcb-4f45-9dd4-a4916a97cac6 iron 3 2a4f3d57-89fc-4d56-be8d-f8b28c7ee14c flower 4 6e5901ef-125e-436b-b704-e79ccfb5860e ice How can i query records from guid "2a4f3d57-89fc-4d56-be8d-f8b28c7ee14c" in Django ORM?
Іhor
Greetings. How to download 50 or more photos at once in Django 5 (car bulletin board). I spent half a day like this and did not find anything worthwhile.
Rikas
Check out my latest article exploring how I am contributing to neuroscience through coding. #GSoC2024 https://medium.com/@rikasilamdeen/gsoc-2024-with-incf-7ef5a209e5b8
maneliiii
does django channels have any new version?
Mirco
does django channels have any new version?
Go the change log and check It out
Doragonsureiyā
🚫 ‎....... [6920749998] is already banned.
KAKASHI
Hi friends Tailwind-django problem I have defined a bg for my kit When I post a kit and set bg pink for example it doesn't work and the point is when I insect that element I see bg-pink-500 (I'm using tailwind) I have set this on element bg-{{kit.bg}}-500 What's the issue? I don't understand I think it's bug right?
KAKASHI
Use bootstrap or even CSS and link it to your HTML
I'll test it But I work with tailwind every time And on each project I see this bug
pranav
i am serving my django app on ec2 instance which has an upload page which uploads video to s3 bucket but rather i am getting this eerror in cosole even though i configured cors_origin_allow_all = True in settings
pranav
upload/:1 The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header.
Jamie
What will be CELERY_BROKER_URL for AWS hosted redis?
Mirco
What will be CELERY_BROKER_URL for AWS hosted redis?
If you use Elasticache cluster, It will be the primary endpoint
maneliiii
Go the change log and check It out
no something new like django channels but better with new name I can't remember now
Mirco
no something new like django channels but better with new name I can't remember now
I don't know but Django Channels is alive and supported
maneliiii
I don't know but Django Channels is alive and supported
I can't remember now there were two things besides the django channels
Angel
I have deployed a project in railway and I notice that for tasks that do not query the database it takes too long (approx. 600 ms) compared to django runserver. These are simple tasks like collecting some fields, doing some mathematical operations with that data and displaying them on the screen. Does the same thing happen to you? Could it be a latency issue?
Angel
postgresql?
Yes, I use postgres but I am talking about tasks that do not involve the database
Angel
I had same error like that
And what was the problem? have you solved it?
maneliiii
Yes, I use postgres but I am talking about tasks that do not involve the database
you mean tasks that nothing to do with database at all?
Angel
I collect the values of some fields, do some operations and send the result to the front-end
Отабек
|---------------------------------------------| | User ID:[ Field] | | User Name: [Field] | | Languages Code:[Field]| | Phone Number: [Field] | | Amount:[Field] [ Button]| | Balance:[Field | |---------------------------------------------| Hi guys I have some questions This is django model structure How I can add button this here. Please 🙏 helping
maneliiii
Achmad
there's a button to copy the import
Maroua
Hello , can anyone show me a good video to get views and urls ?? i didnt have a trouble with models and superuser but the views and urls is hard to get , i'll be thankfull ! 💓