Re: Upload image submit by users to another serveur

2023-03-03 Thread Ahmed Mulla
Hey off the top of my head there are a bunch of ways you can do it. 1. Create a separate function that uploads the image to the new server, call that function in the upload view(you should make it async) 2. Write the input to something like Kafka and then write read functions that cater to differ

Re: Upload Image Field? ASAP PLS

2018-11-18 Thread Yavin Aalto Arba
Assuming this is just a general question about the subject: Django Models has an imagefield option: https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.ImageField The image has a .url attribute which you can use for displaying (or you can use the % static % method). cf. "For

Re: Upload Image Field? ASAP PLS

2018-11-17 Thread Shashank Singh
Why not doing it? Where are you stuck? On Sun, 18 Nov, 2018, 8:02 AM Richard Vo Need to upload an image, manipulate the image through Python Pillow, then > display it. > > Whatever additional information I need to provide, please let me know. > > -- > You received this message because you are sub

Re: upload image with Django

2013-05-25 Thread Gianluca Dileo
Can you show me an example? With the HttpResponseRedirect are forced to send the information to another page. While I need to display the image (in a window, that the user can close) on the same page that contains the form. Thanks in advance. GD Il giorno venerdì 24 maggio 2013 20:27:55 UTC+2,

Re: upload image with Django

2013-05-24 Thread Michael Radziej
Gianluca Dileo writes: > Hi guy, > I've created a form in a page html that upload a image. > After capturing the image and edit it, I need to have it appear in a window > j > How can i do? Does HttpResponseRedirect do what you want to achieve? Kind regards Michael -- You received this mess

Re: Upload Image

2013-04-22 Thread Hélio Miranda
I'm doing the following: http://plnkr.co/edit/neqmvI13prMySMtHQHta Is something wrong? What could it be? As it is, should not be saving the image in folder? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Upload Image

2013-04-22 Thread Hélio Miranda
I still can not upload image Someone can give me one more help? 'm New to Django and did not know what I'm doing wrong ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: Upload Image

2013-04-19 Thread Michael Hernandez
Grr i accidentally pressed enter before finishing the message Since its in the database it is not available in your filesystem or for immediate display. to check if its there ./manage.py shell import yourmodel as Document print Document.objects.all() i would suggest researching pythons mo

Re: Upload Image

2013-04-19 Thread Michael Hernandez
Hi Miranda, If I understand correctly. Your code is working now but you cannot find the Image??? The image is currently being sent to the database. It is being store in a record in the table. On Friday, April 19, 2013 3:21:02 PM UTC-4, Hélio Miranda wrote: > > Gives no error > But do

Re: Upload Image

2013-04-19 Thread carlos
try this minimun changed = views === def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponseRedirect('/') else: form = DocumentForm() re

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Gives no error But do not know where to send the image and sends Do not put the picture in the ... Does anything in the settings? Or have a folder in the wrong place? My folder structure is right? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Upload Image

2013-04-19 Thread Charly Román
def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return render_to_response('index.html', {'form': form}) else: form = DocumentForm() return render_to_respons

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Gives the following error Charly Blog.views.index The view did not return an HttpResponse object. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+un

Re: Upload Image

2013-04-19 Thread Charly Román
def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return render_to_response('index.html', {'form': form}) else: form = DocumentForm() return render_to_res

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Is giving an error of syntax and I do not see where ... Says it is on line 19 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegrou

Re: Upload Image

2013-04-19 Thread Peith Vergil
Try this in your view: from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from models import Document from forms import DocumentForm def index(request): if re

Re: Upload Image

2013-04-19 Thread Hélio Miranda
My whole code including the settings are here: http://plnkr.co/edit/neqmvI13prMySMtHQHta And my structure is this: What do you think could be wrong? -- You received this message becau

Re: Upload Image

2013-04-19 Thread Peith Vergil
the *else:* should be part of *if form.is_valid():*, so just indent it. On Sat, Apr 20, 2013 at 2:13 AM, Hélio Miranda wrote: > So it gives me an error: > > local variable 'form' referenced before assignment > > > in views.py > > -- > You received this message because you are subscribed to the

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Can I have the ill-defined folder? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email t

Re: Upload Image

2013-04-19 Thread Hélio Miranda
So it gives me an error: local variable 'form' referenced before assignment in views.py -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr.

Re: Upload Image

2013-04-19 Thread Peith Vergil
Try this: In your forms.py *class DocumentForm(forms.ModelForm): class Meta: model = Document* *...* In your views.py *def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.sa

Re: Upload Image

2013-04-19 Thread Hélio Miranda
I still have the same problem. My question is whether I have the code, the image would be saved in? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+

Re: Upload Image

2013-04-19 Thread Peith Vergil
Maybe DocumentForm should inherit from ModelForm: *class DocumentForm(forms.ModelForm): class Meta: model = Document* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it,

Re: Upload Image

2013-04-19 Thread Hélio Miranda
has not changed and continues to keep me in the picture anywhere ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. T

Re: Upload Image

2013-04-19 Thread carlos
Hi se this code * fnewdoc = Document(docfile = request.FILES['docfile'])* * newdoc.save()* * * *diferent name fnewdoc != newdoc* * * *Cheers* On Fri, Apr 19, 2013 at 10:31 AM, Hélio Miranda wrote: > Been changing and now have the following code: > > Models.py: > *class Document(models.Model):*

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Been changing and now have the following code: Models.py: *class Document(models.Model):* * docfile = models.FileField(upload_to='documents/%Y/%m/%d')* Forms.py: *class DocumentForm(forms.Form):* *docfile = forms.FileField()* Views.py: *def index(request):* *if request.method == 'POS

Re: Upload Image

2013-04-19 Thread Tom Evans
On Fri, Apr 19, 2013 at 4:16 PM, Hélio Miranda wrote: > I draw the picture and then when I submite, gives me the following error: > > 'TestUploadForm' object has no attribute 'save' > Your form has no save() method. What do you want to happen when you call save()? If you want to save the image a

Re: Upload Image

2013-04-19 Thread Hélio Miranda
I draw the picture and then when I submite, gives me the following error: *'TestUploadForm' object has no attribute 'save'* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send a

Re: Upload Image

2013-04-19 Thread Tom Evans
On Fri, Apr 19, 2013 at 3:14 PM, Hélio Miranda wrote: > I'm trying to make a simple uplaod picture but I'm not getting. I'm doing > the following way: > > Models.py: > class TestUpload(models.Model): > model_pic = models.ImageField(upload_to='Temp/', blank=True, null=True) > > Forms.py: > cla

Re: Upload Image and pdf file

2012-09-04 Thread Dott. Tegagni Alessandro
The file settings.py is: http://dpaste.com/796111/ But the result is page not found, when i click on media file, that i upload. any ideas? Il giorno domenica 2 settembre 2012 15:53:48 UTC+2, Dott. Tegagni Alessandro ha scritto: > > The file urls.py is: http://dpaste.com/795211/ > If it is the he

Re: Upload Image and pdf file

2012-09-02 Thread Dott. Tegagni Alessandro
The file urls.py is: http://dpaste.com/795211/ If it is the help. Il giorno domenica 2 settembre 2012 14:51:21 UTC+2, Dott. Tegagni Alessandro ha scritto: > > The folder is empty. > > Il giorno venerdì 31 agosto 2012 08:47:55 UTC+2, Amyth ha scritto: >> >> Do you actually see anyfiles uploaded u

Re: Upload Image and pdf file

2012-09-02 Thread Dott. Tegagni Alessandro
The folder is empty. Il giorno venerdì 31 agosto 2012 08:47:55 UTC+2, Amyth ha scritto: > > Do you actually see anyfiles uploaded under static/finale if you manually > browse the folder? or is it empty ? > > On Thu, Aug 30, 2012 at 7:54 PM, Dott. Tegagni Alessandro < > tefar...@gmail.com > wrote:

Re: Upload Image and pdf file

2012-08-30 Thread Amyth Arora
Do you actually see anyfiles uploaded under static/finale if you manually browse the folder? or is it empty ? On Thu, Aug 30, 2012 at 7:54 PM, Dott. Tegagni Alessandro < tefari@gmail.com> wrote: > I have a project created with cms Django, and in this project i must > upload a image and pdf fi

Re: upload image

2012-06-17 Thread Satvir Toor
On Mon, Jun 18, 2012 at 6:29 AM, Satvir Toor wrote: > On Sun, Jun 17, 2012 at 12:36 PM, Kurtis Mullins > wrote: >>> On Sun, Jun 17, 2012 at 2:33 AM, Satvir >>> Toor  wrote: > >> Make sure you set up the Form enctype correctly. (> ... enctype="multipart/form-data">) > I did it. Problem solved. Tha

Re: upload image

2012-06-17 Thread Satvir Toor
On Sun, Jun 17, 2012 at 12:36 PM, Kurtis Mullins wrote: >> On Sun, Jun 17, 2012 at 2:33 AM, Satvir >> Toor  wrote: > Make sure you set up the Form enctype correctly. ( ... enctype="multipart/form-data">) I did it. Problem solved. Thanx Sir. >> MEDIA_ROOT = >> '/usr/local/lib/python2.7/dist-packag

Re: upload image

2012-06-17 Thread Kurtis Mullins
> > On Sun, Jun 17, 2012 at 2:33 AM, Satvir Toor > wrote: > but when i try to submit data it makes the upload file empty and gives > notification this field(file upload) is required. Make sure you set up the Form enctype correctly. () MEDIA_ROOT = > '/usr/local/lib/python2.7/dist-packages/d

Re: upload image

2012-06-16 Thread Satvir Toor
On Sun, Jun 17, 2012 at 5:31 AM, Mike Dewhirst wrote: > On 17/06/2012 5:16am, Satvir Toor wrote: > 1. Include the image in your other form href="{{MEDIA_URL}}somedir/image.png"> I followed the link which you suggest me. I made changes in settings.py file of the project as MEDIA_ROOT = '/usr/lo

Re: upload image

2012-06-16 Thread Mike Dewhirst
On 17/06/2012 5:16am, Satvir Toor wrote: I want to upload a image through django forms.I created a class and that file-upload element is visible into the browser.It makes me enable to choose the file. How to handle that image??? Can anybody explain what would be whole procedure to upload a image

Re: Upload image using GET

2011-05-01 Thread Javier Guerra Giraldez
On Sun, May 1, 2011 at 11:53 PM, Matias Hernandez Arellano wrote: > i only use this to test > def upload_image(request): >    if request.method == 'POST': >        return "request.FILES['image']" >    return "NO imagen subida" is this your view function? if so, it should return a response object

Re: Upload image using GET

2011-05-01 Thread Matias Hernandez Arellano
yes, thanks.. i try using POST but i get a error 500 i only use this to test def upload_image(request): if request.method == 'POST': return "request.FILES['image']" return "NO imagen subida" El 01-05-2011, a las 23:11, А. Р. escribió: > 2011/5/2 Matias Hernandez Arellano <...@ar

Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 Matias Hernandez Arellano <...@archlinux.cl>: > > And if it's not possible use GET to pass the image data to the django > application.. > how can i pass de data from a mobile application (without user actions like a > web form) to the django application, and upload, or copy de data into

Re: Upload image using GET

2011-05-01 Thread Matias Hernandez Arellano
Thrift: http://incubator.apache.org/thrift/ And if it's not possible use GET to pass the image data to the django application.. how can i pass de data from a mobile application (without user actions like a web form) to the django application, and upload, or copy de data into a new image?? Than

Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 msdark <...@gmail.com>: > The service is written in C++ and use thrift to create a Client with > python.. so i write a simple django application like and interface to > the C++ service. What is "thrift"? Do you really mean it? > > Now i need to upload an image to the django application

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-19 Thread robinne
Thanks for all your replies. I ended up using sorl-thumbnail, which I had already installed, but I didn't think it kept aspect ratio of image because you are required to enter w and h for thumbnail image size using ThumbnailField. A quick test shows that it resizes and keeps same aspect ratio. So,

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-19 Thread CrabbyPete
The Imagefile is just a pointer to file. Here is what I do to upload and resize an image. I hope it helps. file_to_open = settings.MEDIA_ROOT+'//profiles//'+ user.username+'-'+file.name fd = open(file_to_open, 'wb+') if file.multiple_chunks(): for chunk in file

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-18 Thread Alex Robbins
I think Satchmo uses http://code.google.com/p/sorl-thumbnail/ I think it uses PIL underneath a layer of abstraction. That might work for you if you are just wanting to generate alternate versions of uploaded images. Alex On Mar 18, 12:10 am, robinne wrote: > I can save an uploaded image to a Fil

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-18 Thread bruno desthuilliers
On Mar 18, 6:10 am, robinne wrote: > I can save an uploaded image to a FileField like this (where > "ProductFile" is a model) and "TempFile" is an ImageField: > > uploadedfile = request.FILES['uploadfile'] > ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(), > TempFile=uploade

Re: Upload image

2009-09-19 Thread Ramos
Hi: At the moment I just solve the problem, the pictures up. To fix the problem I did was: 1 - sudo apt-get install libjpeg62 libjpeg62-dev 2 - sudo easy_install - find-links http://www.pythonware.com/products/pil/ Imaging 3 - sudo invoke-rc.d apache2 restart While in another server

Re: Upload image

2009-09-19 Thread Ramos
Hi: Mike Ramirez Thanks for your response so quickly. I install what I recommended, but continued presenting the same problem. On Sat, 2009-09-19 at 17:14 -0700, Mike Ramirez wrote: > On Saturday 19 September 2009 16:49:49 Ramos wrote: > > imagingtk.c:20:16: error: tk.h: No such file or di

Re: Upload image

2009-09-19 Thread Mike Ramirez
On Saturday 19 September 2009 16:49:49 Ramos wrote: > imagingtk.c:20:16: error: tk.h: No such file or directory > To install PIL, you'll need the tk8.4-dev package I believe. http://packages.ubuntu.com/hardy/i386/tk8.4-dev/filelist (not sure what the latest version of tk is for hardy), Once PI

Re: Upload image in own form

2008-08-21 Thread Robvdl
Thank you very much, this worked perfectly. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send

Re: Upload image in own form

2008-08-20 Thread Julien Phalip
Hi, I think that you need to set the form's object instance when collecting the POST data too: form = WrestlerProfileForm(request.POST, request.FILES, instance=profile) That way, the image will be set with the existing one, and the form won't complain when validating. Hope it helps, Julien O

Re: Upload image or select from existing

2007-06-30 Thread [EMAIL PROTECTED]
Oh, thank you very much! Ho could i forget about that :) On 30 июн, 09:23, "Andrews Medina" <[EMAIL PROTECTED]> wrote: > 2007/6/29, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > > > Hello, > > > I have a model with ImageField, i want to let users to upload their > > own images or select existing f

Re: Upload image or select from existing

2007-06-29 Thread Andrews Medina
2007/6/29, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Hello, > > I have a model with ImageField, i want to let users to upload their > own images or select existing from a list (images are used for article > icon). How can i do that (esecially in admin if this is possible)? I can create a other m