пантера
It still isn't working
Shekhar
can any1 tell me the how to use celery in windows?? I got async issue many time
Guillermo
can any1 tell me the how to use celery in windows?? I got async issue many time
what version? Celery does not support Windows from v4 onwards IIRC
Shekhar
what version? Celery does not support Windows from v4 onwards IIRC
ya but I tried celery3.x but it still has some issue with other dependency pike kombu
Anonymous
Hello everyone I am uploading multiple files using single form field in dhango and successfully uploaded to target directory also but how can i assign media url for these pictures because only one media url will be assigned to one picture... Below is my code for uploading pictures def post(self, request, *args, **kwargs): context={} if request.method =='POST': form = AddRoomForm(request.POST) s = request.POST['service'] service = Service.objects.get(id=s) sKey = service.serviceKey if form.is_valid(): for count, x in enumerate(request.FILES.getlist("roomPictures")): def process(f): with open("/Users/JARVIS/Desktop/obap/media/images/rooms/"+sKey+"_"+ str(count), 'wb+') as destination: for chunk in f.chunks(): destination.write(chunk) process(x) form.save() return redirect('roomsdata')
Anonymous
what is the use of class MEta
Anonymous
class Meta
Jadav
Hi
Jadav
I deleted the 0001.initial.py file from migrations
Jadav
And the db
Jadav
But still showing a filenot found error of 0001_initial.py
Jadav
Can anyone help me to solve this
inchidi
I deleted the 0001.initial.py file from migrations
if you delete db, then delete all migration file not just first one
inchidi
and dont forget to run makemigrations again
Jadav
Migrations folder is now empty
Jadav
But still exists
Jadav
Applied makemigrations and migrate successfully.
Jadav
But still it shows the filenotfounderror of 0001_initial.py
Jadav
Inchidi.....😞
Jadav
I can't share photos to this channel
Anonymous
woah woah what are you trying to do??
Actually i am uploading multiple images with single file input element So when i upload images they are storing in targeted directory Upto this everything is ok.. But when i view the files uploaded post it is showing no files are associated to the attribute pictures... I realized that i am only uploading multiple images but bot linking them with post object, as we do it using upload_to field in model
Anonymous
woah woah what are you trying to do??
Actually it means Images are not attached with id or foreignkey to the post they are just moving from one place to another place
Anonymous
thats true, so you already search how to properly store FileField now?
Then consider i am uploading 5 files to directory then how and which file i should link to display it using media url
inchidi
you should share your model first
Anonymous
you should share your model first
Sachin: models.py code class Rooms(models.Model): roomPictures = models.ImageField(upload_to='images/rooms/', null=True, blank=True) roomNo = models.textInput(max_length=255, null=True, blank=True)
Anonymous
No no single room which contains multiple images for display
Anonymous
so you are uploading 5 room data?
Sachin: No no single room which contains multiple images for display
inchidi
then why your model only have one room pic?
Anonymous
then why your model only have one room pic?
Because we can't put limit to user that how many images he can upload For example consider facebook post, each post can contain many images uploaded by user only on single input i am trying to apply same logic here
inchidi
so, imagine the images is simply texts, if you have ["text1","text2", ... ] how do you want to store those texts in your database?
Anonymous
so, imagine the images is simply texts, if you have ["text1","text2", ... ] how do you want to store those texts in your database?
Ya in this case what i am thinking is 1. for all these images i am creating a directory which contains unique random number as name before uploading 2.and for storing each image in that directory i am using for loop 3. In third step i am trying to attach the first uploaded image path as url in the imagefiled for Rooms model
inchidi
But in third step i am failing because the imagefield not storing the path i given
class Rooms(models.Model): room_pictures = models.TextField() room_no = models.PositiveIntegerField() given input of room pictures: ["text1","text2", ... ] can you show me how you solve this problem?
Anonymous
I want to make a relational database where two tables named patient and metabolite table will have one to one relation . The webportal will provide form where user has to submit the two excel sheet and based on the data submitted they can browse the metabolites based on some filters. so is it possible if browsing retrieves some metabolite eg methane . is there any way when clicked on methane it should search the methane just like google does
Anonymous
yus
Anonymous
i m just telling the row1 of patient table correspond to row1 of metabolite one
inchidi
i m just telling the row1 of patient table correspond to row1 of metabolite one
and you assume patient will have many metabolites by that?
Anonymous
titles?
I mean Why ["text1","text2", ... ] only one text field is enough per post right
Anonymous
i want to know is it possible to incorporate custom google search in my web app
inchidi
I mean Why ["text1","text2", ... ] only one text field is enough per post right
you are the one who want to upload 5 images and not one, i just simplify it to texts so you able to find wheres mistake you made
Anonymous
you are the one who want to upload 5 images and not one, i just simplify it to texts so you able to find wheres mistake you made
No no inchidi I mean Then tell me If one user wanted to upload 2 images Another user wnated to upload 3 images Another user wanted to upload 7 images How to write model filefield for this case
the dark
can anyone tell me how i can display pdf file in html page from django model
Anonymous
You really want to do it?
Anonymous
You would have to create a new window inside one.
the dark
i want to show pdf that taken by the user in model
Anonymous
you can use <iframe> for that
He should avoid it anyway
inchidi
why? never research about that
Anonymous
Create issues in indexing
Anonymous
Bookmarking issues
Anonymous
And last - "only use if know about it"
Anonymous
I think not avoid but using cautiously would be a better advice.
Anonymous
Hi! I am a beginner in Django, am following step-by-step the tutorial; I am in the 2nd step: https://docs.djangoproject.com/en/2.1/intro/tutorial02/; there is this link: http://127.0.0.1:8000/admin/, whenever I try to open it, I have this:
Anonymous
Oh, I wanted to upload a photo of the problem!
Anonymous
It says that "This site can't be reached."
Anonymous
What would you advise me to do?
Anonymous
I myself also trying to figure this out, but to no avail for now.
Anonymous
Anonymous
🤦‍♂️
I guess you mean my question is very stupid.