chowmin
Then python manage.py migrate
Вероника
Then python manage.py migrate
The result is the same, the migration is not completed
Charly
If yes, it means you are running it inside python and that's wrong
Charly
Yes, how can I fix it?
By bot running it inside a python shell
Abhi
When trying to makemigrations it showing impossible to add a non nullable field to without specifying a default
Abhi
How to solve it
Charly
How to solve it
Add a default value
Abhi
I using a foreignkey to call another class so should I have to add default value
Abhi
I tried null=true but doesn't worked
Charly
I tried null=true but doesn't worked
Show exactly what you have done and the error you get
Abhi
I created a class cate and I called this class cate to another class prod for a model by models.foreignkey( cate,on_delete=models.CASCADE) Then I trying to makemigrations it's showing impossible to add a non nullable field to prod without specifying a default
Arsalan
Show us your import statements
So This Are in the celery instance file celery.py from celery import Celery import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "picartia.settings") app = Celery("picartia") app.config_from_object("django.conf:settings", namespace="CELERY") app.autodiscover_tasks() ========================================== and This are the tasks imports statements tasks.py import shutil from .models import * import zipfile from .utils import * import json from django.core.files.base import ContentFile from io import BytesIO from datetime import timedelta from django.utils import timezone from celery import shared_task
Rahat
How to implement push notification tell me
Arsalan
main file
I have imported the none module but have the same error
Alexey
Arsalan
Hey Every Body I Have Problem So My Problem Is that when i want to use celery with django in ubuntu server it return this error No module named 'None' how can I solve this?
Anonymous
Hello is it logical iam i learn django in 2023 is it have respund?
Arsalan
Use python.exe -m pip --upgade None
No it does not work for me
Anonymous
No it does not work for me
What is your django version
Anonymous
django 3.2.11
Can you upgrade it ?
Arsalan
chowmin
Django + react stripe integration time getting cors error why I'm adding all things stripe integration time I'm getting this error
Artur
Hello! I use Subquery in ArrayAgg. My subquery must return list of jsons and then it mus be used in annotate. but i can’t use it. it returns “more than one row returned by a subquery used as an expression” every time
Artur
Can i in annotate return a list of dictionaries?
cj
Use python.exe -m pip --upgade None
why python.exe when he explicitly said he's using Ubuntu?
cj
Can you upgrade it ?
can you stop giving bad advice without really knowing the cause of his issues?
Doragonsureiyā
Hey Every Body I Have Problem So My Problem Is that when i want to use celery with django in ubuntu server it return this error No module named 'None' how can I solve this?
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
mohsen.k
Hello and respect I ran into a problem in the implementation of my project. I couldn't find it on the internet. I wanted to ask you for a guide if you don't have a problem In the codes of my html page and in the static files of my project, there is no such thing as css2.css, but there is an error when running the project Not found css2.css Gives And the incomplete project is implemented In other projects also this error is implemented, meanwhile I am using Paycharm
Doragonsureiyā
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Ajn
Hai , Anyone know how to return image url (image in database) as api response for flutter app, I created an api for this it displays the url where the image is located but,when I click on it it shows page not found, Anyone know why this happens, do I need to do anything in settings.py?
Lightbourne
Hai , Anyone know how to return image url (image in database) as api response for flutter app, I created an api for this it displays the url where the image is located but,when I click on it it shows page not found, Anyone know why this happens, do I need to do anything in settings.py?
perhaps you have to serve media files. in development you can do it like that in your urls.py if settings.DEBUG: urlpatterns += static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT ) but in production you better use nginx for that
Ajn
Thanks buddy,
Lightbourne
Dp you have any guide or web links
https://docs.djangoproject.com/en/4.1/howto/static-files/ serving media files in development is pretty much the same as static files regarding nginx, that could be helpful https://stackoverflow.com/questions/8370658/how-to-serve-django-media-files-via-nginx
bhzad
Hello to you friends I want to create a website with Django similar to Telegram Web But not all of its features. First, for example, I will implement 50% of the features that Telegram Web has I want to do something like this for the sake of learning. An example of its functionality: The user can upload different files and send them to his friends And.... How and where do I start? Tank your help.
bhzad
if you have this question, it probably means you're a complete beginner in backend. you should at least finish learning django, then you'll come up with the answers by yourself
Does that mean you don't need to ask? And that my biggest goal of this question was the algorithm of the problem Yes, I am not a backend professional with Django Framework And to introduce the complete resource for learning Django to cover all the contents
RXRX
is there anyone who is comfortabl with django-allauth? i want to add custom user registration feilds. i tried but not able to save custom feilds in database.
Baruc
Can someone help me connect Django with databases on a remote server througth ssh tunnel ! I am using sshtunnel package as described in this stackoverflow example https://stackoverflow.com/questions/70743246/django-db-with-ssh-tunnel and I am getting the following error : psycopg2.OperationalError: server closed the connection unexpectedly !
Ramesh
Anyone worked on graphql on a generic foreign key, please let me know I have some problem on it
Kiro
Can you tell me if this follows the best practice? class CartSerializer(serializers.ModelSerializer): menuitem_id = serializers.IntegerField(write_only=True) menuitem = serializers.StringRelatedField() quantity = serializers.IntegerField() total = serializers.DecimalField(read_only=True, source="get_total") class Meta: model = Cart exclude = ["user"] def get_total(self): return self.quantity * MenuItem.objects.get(pk=self.menuitem_id).price
Kiro
The total field is not showing
Maxim
Whether this is best practice or not, it's not working
code that doesn't work certainly can't be a model of best practice
Kiro
For sure
Kiro
Have you any idea of why this is not working?
Kiro
Okay now this works. class CartSerializer(serializers.ModelSerializer): menuitem_id = serializers.IntegerField(write_only=True) menuitem = serializers.StringRelatedField() quantity = serializers.IntegerField() total = serializers.SerializerMethodField("get_total") class Meta: model = Cart exclude = ["user"] def get_total(self, obj): print(type(obj)) return obj.quantity * obj.menuitem.price Does this follow best practices?
Kiro
(Nevermind the print)
Satya Anurag
Hey, I have a google Collab notebook . I want to take input (text) from the user in the webpage in django and then give this input to this Google notebook to process it and getting the output from google Collab to django then to the webpage (user) . Is it possible?
Kiro
Why don't you use mode serializer?
I am using a model serializer
Рy
Does anyone know how to create a payment gateway with django?
Рy
Does anyone know how to create a payment gateway with django?
If anyone knows I would be glad if you teach me
Charly
HACKER
I'm learning Django, it it's good or better change it for laravel?
HACKER
Thats a bad question to do here.
Why? Is a simple question
HACKER
I liked django, I think that it's easier than laravel
Charly
Why? Is a simple question
Becaus it cant be an impartial answer. No its not bad, just see the size of this group. And search for django job offers.
HACKER
But I saw that there's not a lot of jobs with Django
Pywizz
There is buddy!! Unless you locate the best search.
Sherbek Saydullayev
When working with email in Django when I used django smpt, the email didn't come with a password recovery url
Saeid
hi. i want to create custom user model that superuser has email, password and username when they want register and login while for normal user, they need only phone number for login and register. email, password and username are not required for normal user. moreover in admin panel, i dont want email, password and username be required for normal user.
Manik
I am using django channel when I send data from frontend to backend consumer recieve function it's doesn't receive data
HACKER
Anyone can tell me the structure of of a crm?