These are chat archives for django/django

11th
Feb 2017
cs89gr
@cs89gr
Feb 11 2017 04:26
hello is here someone
Batur
@Batur24
Feb 11 2017 04:28
hello, @cs89gr
:hand:
cs89gr
@cs89gr
Feb 11 2017 04:29
@Batur24 hi can you help me my friend ?
Batur
@Batur24
Feb 11 2017 04:29
what's your problem?
I am free currently, I am happy to help. :smile:
cs89gr
@cs89gr
Feb 11 2017 04:30
thnx you
i create a convert with base 64 using images but work only with png files i want to work and with tiff
look my code
def convert_to_base64(image_file):
    base64_string = base64.encodestring(image_file)
    return "data:image/png;base64,"+base64_string
@csrf_exempt
def index(request):
    form = ImageUploadForm(request.POST or None, request.FILES or None)
    if request.method == "POST" and form.is_valid():
        image_file = request.FILES['image'].read()
        base64_string = convert_to_base64(image_file)
       return render_to_response("blog/success.html", {"image_file":base64_string})
    return render_to_response('blog/calc.html', {'form': form}, RequestContext(request))
Batur
@Batur24
Feb 11 2017 04:35
I see, wait a moment
cs89gr
@cs89gr
Feb 11 2017 04:35
thnx you th
cs89gr
@cs89gr
Feb 11 2017 04:55
@Batur24 are you here ?
Batur
@Batur24
Feb 11 2017 04:56
Yeah, I am here. Not familiar with base64 package, find information about it. :worried:
cs89gr
@cs89gr
Feb 11 2017 04:57
how other method to use for this task without base 64?
Batur
@Batur24
Feb 11 2017 04:58
Not sure either, let me google for a while. :cry:
cs89gr
@cs89gr
Feb 11 2017 04:58
ok thx you btw i give you time
Batur
@Batur24
Feb 11 2017 05:09
could you print type(image_file) of your tiff file?
Bon Osonwanne
@osonwanne
Feb 11 2017 06:51
Check out the web app I built using Django to help find small properties and manage rental portfolio: www.smallplex.com
Alexandro Pequeno
@Argestis
Feb 11 2017 07:31
Anyone good with flask? (:
Serdar Gokhan Kaya
@serdargkaya
Feb 11 2017 09:29
Hello
Kha
@nlhkh
Feb 11 2017 12:09
hi
I have a question about CreateView form, basically if you have {{ form.as_p }}, then all your fields will be listed. Now what I want is to group these fields to improve the visual. How can I do that?
Kha
@nlhkh
Feb 11 2017 12:28
in a template, I can get a value from a model with model.field_name
but what if I want the name, not the value?