chowmin
Then python manage.py migrate
Charly
Charly
If yes, it means you are running it inside python and that's wrong
Вероника
Abhi
When trying to makemigrations it showing impossible to add a non nullable field to without specifying a default
Abhi
How to solve it
Abhi
I using a foreignkey to call another class so should I have to add default value
Charly
Abhi
I tried null=true but doesn't worked
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
Maxim
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
Arsalan
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?
Anonymous
Hamid
Arsalan
Arsalan
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?
Doragonsureiyā
cj
Can you upgrade it ?
can you stop giving bad advice without really knowing the cause of his issues?
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
Ajn
Thanks buddy,
null
Ajn
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
Ajn
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.
Ajn
Lightbourne
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
Kiro
The total field is not showing
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)
AB
J
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
Рy
Does anyone know how to create a payment gateway with django?
Рy
Charly
HACKER
I'm learning Django, it it's good or better change it for laravel?
Charly
HACKER
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
Alexey
Maxim
HACKER
Anyone can tell me the structure of of a crm?