Вин Король Саксов
Don't create new Patient Details with same patient_num
Вин Король Саксов
So what to type to remove error
Remove primery_key = True, or don't add new records tod db with same patient num
़д।युषी। ✽
़д।युषी। ✽
Remove primery_key = True, or don't add new records tod db with same patient num
You are trying to add a non-nullable field 'Patient_num' to patientdetails without a default; we can't do that (the database needs something to populate existing row s). now its showing this
Deep
Hey Folks, im trying mongodb with django first time and getting error " Database error, No exception message supplied " everywhere. Pls help
Doragonsureiyā
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Doragonsureiyā
Try harder until you get what you want! don't give up! 🦾
Shivaprasad
suggest any tutorial for api based project
.
I am making a production based chat application ,for a large user base how can I implement it efficiently and do I need to use Django channels!Please suggest if anybody have any idea regarding this
Deep
Use djongo
Im using djongo, which is giving error
Prashant
Guys, does one app inherit the models of another app? If yes, then how? Is it because of some parent child relationship? If someone could help me out , it would be great.. Thank you...
♈
Django in how to clear search filtter query after search
Pavel
Hello. class A(models.Model): date = models.DateField() json = models.JSONField() How to update value in json using F()? I use .update(json={"date_diff": F("date") - datetime.now()}) django raises error thant F isn't json serializable
Anonymous
class ProjectForm(ModelForm): class Meta: model = Project fields = ['title', 'discription', 'thumbnail','tags','demo_url','source_url','status'] widgets = { 'tags': forms.CheckboxSelectMultiple(), } def init(self, *args, **kwargs): super(ProjectForm, self).init(*args, **kwargs) for name, field in self.fields.items(): field.widget.attrs.update({'class': 'form-control'}) Hi, How can I check if field is for 'tag'? I want if field is 'tag' change the field class to 'form-select' . Thank You
Kunal..
can anyone explain , what is instance in django ?
Kunal..
def form_valid(self, form): form.instance.user=self.request.user return super().form_valid(form)
Christof
So this will probably be a few seconds
Christof
Thank you
Anonymous
def form_valid(self, form): form.instance.user=self.request.user return super().form_valid(form)
form.instance is a reference to the current form being processed.
Anonymous
Guys, does one app inherit the models of another app? If yes, then how? Is it because of some parent child relationship? If someone could help me out , it would be great.. Thank you...
Your Django app is just an ordinary python package. The models in one app knows nothing about other models. For one model to inherit from another model in a different app, you have to explicitly import and subclass accordingly.
Siddharth
I have authenticated id and pass from database from x model and while id and password user enters should match with it but in views it does not matches
Siddharth
Pls help me anyone
Rohan
Use djongo
You better have a good usecase to be using nosql
Arya
I want create user on terminal for postgresql and have a problem after createuser -P command I recieve error : creation of new role failed : ERROR : role “postgres” already exists I have not any experience with postgresql
Dot enum
this is my base html
Dot enum
this is the extension
Dot enum
why it's not extending?
Dot enum
both are in templates folder
Dot enum
anyone?
Dot enum
like? it's not ugly. it became ugly here
Rishu
like? it's not ugly. it became ugly here
Use some pasting services and delete ur previous code
dคv¡d
why it's not extending?
The problem is not extends? Did you make destination templates in settings?
Dot enum
ohh thnaks i forgot that
Rishu
How to do that
https://nekobin.com/ paste ur code here properly and share your url here
Anonymous
in postgres we have not createsuperuser command…
If you are trying to create a role or user in your PostgreSQL database, kindly note that initdb automatically creates a role called postgres. You cannot have two roles with the same name in the same database just like it applies to tables
Dot enum
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR,'main/templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ]
Dot enum
this ryt?
Dot enum
still its not working
Anonymous
Could I message you in pv?
No. If you have further issues I or others may assist you here
Anonymous
what m doing wrong?
What is the problem?
Dot enum
What is the problem?
i added in the base directory but it's still not extending
Dot enum
but it includes the templates
Rishu
so how I can create user and connect to my django project?
Do you know how to connect with postgresql credential ?
Anonymous
so how I can create user and connect to my django project?
You can create a user at the terminal using createsuper, at the admin interface, calling your User.objects.create() or using forms
dคv¡d
i added in the base directory but it's still not extending
1 check urls.py (make sure you call the path is 100% correct) 2 make you your base.html is in template destination following settings.py
Anonymous
i added in the base directory but it's still not extending
To extend another template, {% extends <template_name> %} must be topmost of your template and that template should be in the directory
Arya
Do you know how to connect with postgresql credential ?
I just know that put db setting on settings.py/Databases and switch engine to postgresql and i dont have any idea what is my user name when i didnt make any user in db
Arya
and I dont know how to creare user for my postgresql after install that
Anonymous
and I dont know how to creare user for my postgresql after install that
After installing PostgreSQL in your machine run this commands: pg_ctl -D <the directory you want your db cluster> initdb createdb <name of db> The name you use at createdb should be passed to NAME parameter in your Django DATABASE setting
Anonymous
You must start the postgres server before running your local Django server that depends on it
Laayouni
hello,please how to create task in background with django python ?
Laayouni
how to modify the code so that the task starts when the time is finished
VISHNU
[<inmemoryuploadedfile:image.jpeg (jpeg/img)>, <inmemoryuploadedfile:image.jpeg (jpeg/img)>] How to make this list as dictionary because of <> I am not able to use lambda This is because of this error while running background task Typerror: object of type inmemoryuploadedfile is not json serializable ...........how to handle this error in background task to upload image to db in django.
Alex
u must use base64 images for serializing images
as I understand, he wants to save an image in DB. I don't think that storing it, even as base64, in DB is a good idea.
VISHNU
How do you get this data at all?
Images as listfield in serializer so from frontend I am getting list of images so if 50 images are it takes more time to load so that I am using background task but getting this error
Peeru
Hi, Pls suggest me web application set up using django. Which interacts db and web pages.
VISHNU
So, you are trying to pass those file to a background worker and it throws you that error, right?
No,this need to be in json format then only can be send to background task. I will share the code for more clarity.
Mirco
So, you are trying to pass those file to a background worker and it throws you that error, right?
Celery tasks serialize data passed as argument for example you cannot pass request object
Alex
No,this need to be in json format then only can be send to background task. I will share the code for more clarity.
You shouldn't pass an entire object to a task. You can simply pass a list of ids. Then in your task def task(image_ids): Image.objects.filter(id__in=image_ids)
Alex
yup another better practice
I actually had to start answering this question from asking the code. That would be twice time effective.
VISHNU
https://dpaste.org/crz9