Re: Django/python free Training

2020-12-18 Thread yashwanth balanagu
Interested

On Fri, Dec 18, 2020 at 8:00 PM Parvez Khan Pathan <
iamparvezkha...@gmail.com> wrote:

> I'm interested
>
>
> On Fri, 18 Dec 2020, 7:57 pm Python Class, 
> wrote:
>
>> Hi guys,
>>
>> I am manucho from Kenya and am good developer with django and python and
>> i want to teach people what i know .I want to start a youtube channel for
>> Django and python based tutorials ..If intrested you can message me here on
>> concepts and projects you want covered and i will start immediately.
>>
>> Regards,
>> Manucho.
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/5c715780-23c4-4d31-9219-a1e7b92c14f1n%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADaFQ_%2BQQWj5Scj4pfw%3D5774ewucePhTHFR3e1btEOQeFpFPVQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM6tB-Dck2pnQ-FE5FuJU1H8NcjmxqcSkV95H38WikX0a7YMuw%40mail.gmail.com.


Re: Check this out guys

2020-09-18 Thread yashwanth balanagu
Frontend which language you used 

On Fri, Sep 18, 2020 at 1:20 PM 712189512 
wrote:

> Thanks ,more updates coming soon
>
> On Fri, Sep 18, 2020 at 9:39 AM Theresa Taye 
> wrote:
>
>> Lovely, you are doing well
>> On Sep 16, 2020 08:42, "712189512"  wrote:
>>
>>> Hi guys i have build this  *https://connectdjango.com
>>> * platform with django and i want you to
>>> check it out,you can post your questions there and and also post some
>>> tutorials too,let's all connect and keep on djangoing.Thanks
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAL-5MpUAbK%2BEZxt_qJo9jrsFqf0p%3DS3-JPXoMHv3X1jWDXY5NQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAENBRfMXEJ8skRESQwkYa_qvQD4H86dnS4v%2BS7UqW_ZwUs-SwA%40mail.gmail.com
>> 
>> .
>>
> --
> Gabrielstone
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL-5MpWs8eQqHJ%2BNEM%2BkU9kVTw-A_pQdg%2BgNsYbn%3DQCS%2BGvRwA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM6tB-D7gCwU-X17XOSbVwRaR6eAAQZWuFvzGWMzS17w-JCx_A%40mail.gmail.com.


Re: Django Admin

2020-09-09 Thread yashwanth balanagu
awsome

On Wed, Sep 9, 2020 at 9:54 PM RANGA BHARATH JINKA 
wrote:

> Hi,
>
> Use this.
> https://pypi.org/project/django-jazzmin/
>
> All the best
>
> On Wed, Sep 9, 2020 at 9:47 PM lada...@gmail.com 
> wrote:
>
>> Hello friends, I am developing a system and i want to use bootstrap admin
>> dashboard but i dont want to loose the features of django admin please how
>> do i go about it
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/26defa3e-1dc4-4f04-a958-3ace3b8ddbc6n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m314-scHwrLmU-401Vb3eQhD30J-aHt62FFbkTqkaTp8WyQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM6tB-B1U%3DGNn6u%2BVVdC-uxUSobh4Hb%3Djho%2BrZRtacr_T-GdQg%40mail.gmail.com.


In Postman post request is working when i was sending the image but in external template is not working any solution

2020-07-15 Thread yashwanth balanagu





Document



function postimage()
{
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange= function()
{
document.getElementById("image").innerHTML=xmlhttp.responseText; 
}
posted={
fname:document.getElementById("name").value,
picture:document.getElementById("image1").value.replace('C:\\fakepath\\', 
"http://127.0.0.1:8000/media/photos/";)

}

xmlhttp.open("POST","http://127.0.0.1:8000/api/v3/filedata/",true);
xmlhttp.setRequestHeader("Content-type","application/json");
xmlhttp.setRequestHeader("X-CSRFToken", '{{ csrf_token }}');
console.log(posted);
xmlhttp.send(JSON.stringify(posted));
}





 status data 
 sample image 



name:


person:




 Post 
 post image 




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f0038e27-743b-449a-9bc7-54e64ab1485co%40googlegroups.com.


How to change content type in django restframework api from json to multipart/form-data or form data

2020-07-15 Thread yashwanth balanagu


[image: Screenshot from 2020-07-15 14-16-15.png]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eff06e10-4c50-4af2-83a1-1ca5e04751bbo%40googlegroups.com.


why in views we use def(functions) and model we use class, why not we use def(fuction) in models and class in views

2020-06-18 Thread yashwanth balanagu
why in views we use def(functions) and model we use class, why not we use 
def(fuction) in models and class in views

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e4b1e4b-1a59-43d9-8835-4992e986f943o%40googlegroups.com.


Hey django developers, I got small issue that is hoow to specify the template_root but my loader is already specify the temppath" django.template.loaders.filesystem.Loader: C:\Users\Admin\projects\tel

2020-05-03 Thread yashwanth balanagu
from django.shortcuts import render,redirect
from .models import upload
import zipfile as ZipFile
import os, tempfile
from django.forms import modelformset_factory
from .forms import uploadForm
from rest_framework.views import APIView
from .serializers import *
from rest_framework.response import Response 
from rest_framework import viewsets
from rest_framework import status
import zipfile
from django.views import View 
from .import serializers
from file.models import upload
from .serializers import uploadSerializers
import os 
from zipfile import ZIP_DEFLATED
from django_zipfile import TemplateZipFile
from django.shortcuts import get_list_or_404, get_object_or_404
from django.http import HttpResponse
os.chdir("C:/Users/Admin/Desktop")



def home(request):
if request.method=="POST":
user=request.POST['user'];
image=request.FILES['image'];
upload.objects.create(user=user,image=image)
files=upload.objects.all();
return redirect('foundation')
else:
return render(request,'file.html')

def foundation(request):
files=upload.objects.all();
return render(request,'foundation.html',{'files':files})

class download(APIView):

def get(self,request,id):
obj = get_object_or_404(upload, pk=id)
context = {
'object': obj
}
response = HttpResponse(content_type='application/octet-stream')
response['Content-Disposition'] = 'attachment; filename=myfile.zip'

container = TemplateZipFile(response, mode='w'
, compression=ZIP_DEFLATED, template_root= '' ) #How to specify temp root

container.write_template('file.html', context=context)
 
container.close()
return response


class datalist(APIView):
def get(self,request):
datas=upload.objects.all()
serializer = uploadSerializers(datas,many=True)
return Response(serializer.data)

def post(self,request):
serializer=uploadSerializers(data=request.data)
if serializer.is_valid():
serializer.save()
return Response(serializer.data)
return Response(serializer.errors)

def delete(self,request):
serializer=upload.objects.all()
serializer.delete()
return Response(status=status.HTTP_204_NO_CONTENT)


class datadetail(APIView):
def get(self,request,id):
model=upload.objects.get(id=id)
serializer=uploadSerializers(model)
return Response(serializer.data)

def delete(self,request,id):
serializer=upload.objects.get(id=id)
serializer.delete()
return Response(status=status.HTTP_204_NO_CONTENT)








-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5499549-4306-4356-88d3-16ca1899ff43%40googlegroups.com.


Re: Django, Markdownx, image upload from admin after deployment

2020-05-02 Thread yashwanth balanagu
https://www.youtube.com/watch?v=0Ov1Yd1uCuA

once see this video

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dfefb5a7-de0b-4f00-8f79-2ab73e7c7a1e%40googlegroups.com.


Re: {"image":["File extension “zip” is not allowed. Allowed extensions are: bmp, dib, gif, tif, tiff, jfif, jpe, jpg, jpeg, pbm, pgm, ppm, pnm, png, apng, blp, bufr, cur, pcx, dcx, dds, ps, eps, fit,

2020-04-30 Thread yashwanth balanagu
from rest_framework import routers, serializers, viewsets
import base64
from .models import upload
import zipfile
import os 



class Base64ImageField(serializers.ImageField):
"""
A Django REST framework field for handling image-uploads through raw post 
data.
It uses base64 for encoding and decoding the contents of the file.

Heavily based on
https://github.com/tomchristie/django-rest-framework/pull/1268

Updated for Django REST framework 3.
"""

def to_internal_value(self, data):
from django.core.files.base import ContentFile
import base64
import six
import uuid

# Check if this is a base64 string
if isinstance(data, six.string_types):
# Check if the base64 string is in the "data:" format
if 'data:' in data and ';base64,' in data:
# Break out the header from the base64 content
header, data = data.split(';base64,')

# Try to decode the file. Return validation error if it fails.
try:
decoded_file = base64.b64decode(data)
except TypeError:
self.fail('invalid_image')

# Generate file name:
file_name = str(uuid.uuid4())[:12] 
# 12 characters are more than enough.
# Get the file name extension:
file_extension = self
.get_file_extension(file_name, decoded_file)

complete_file_name = "%s.%s" % (file_name, file_extension, )

data = ContentFile(decoded_file, name=complete_file_name)

return super(Base64ImageField, self).to_internal_value(data)

def get_file_extension(self, file_name, decoded_file):
import imghdr

extension = imghdr.what(file_name, decoded_file)
extension = "zip" if extension == "jpeg" else extension #<--error 
line---> i am converting Base 64 data into zip file


#examplezip.write(serializers.ImageField,compress_type = zipfile.ZIP_DEFLATED)
#examplezip.close()

return extension

 
   


class uploadSerializers(serializers.ModelSerializer):

image=Base64ImageField(
   max_length=None, use_url=True,
   )
   
#image =  serializers.ImageField(max_length=None,use_url=True)
class Meta:
model = upload
fields = ('id','image','user')
extra_kwargs = {'user': {'required': False}}







On Thursday, April 30, 2020 at 2:05:25 PM UTC+5:30, yashwanth balanagu 
wrote:
>
> {"image":["File extension “zip” is not allowed. Allowed extensions are: 
> bmp, dib, gif, tif, tiff, jfif, jpe, jpg, jpeg, pbm, pgm, ppm, pnm, png, 
> apng, blp, bufr, cur, pcx, dcx, dds, ps, eps, fit, fits, fli, flc, ftc, 
> ftu, gbr, grib, h5, hdf, jp2, j2k, jpc, jpf, jpx, j2c, icns, ico, im, iim, 
> mpg, mpeg, mpo, msp, palm, pcd, pdf, pxr, psd, bw, rgb, rgba, sgi, ras, 
> tga, icb, vda, vst, webp, wmf, emf, xbm, xpm."]}
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f64709cf-3452-4658-9903-599c75e247c9%40googlegroups.com.


{"image":["File extension “zip” is not allowed. Allowed extensions are: bmp, dib, gif, tif, tiff, jfif, jpe, jpg, jpeg, pbm, pgm, ppm, pnm, png, apng, blp, bufr, cur, pcx, dcx, dds, ps, eps, fit, fits

2020-04-30 Thread yashwanth balanagu
{"image":["File extension “zip” is not allowed. Allowed extensions are: 
bmp, dib, gif, tif, tiff, jfif, jpe, jpg, jpeg, pbm, pgm, ppm, pnm, png, 
apng, blp, bufr, cur, pcx, dcx, dds, ps, eps, fit, fits, fli, flc, ftc, 
ftu, gbr, grib, h5, hdf, jp2, j2k, jpc, jpf, jpx, j2c, icns, ico, im, iim, 
mpg, mpeg, mpo, msp, palm, pcd, pdf, pxr, psd, bw, rgb, rgba, sgi, ras, 
tga, icb, vda, vst, webp, wmf, emf, xbm, xpm."]}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/72e536a4-4029-4a54-8423-a0681d90ec5a%40googlegroups.com.


Convert base64 into zipfile in django serializers

2020-04-30 Thread yashwanth balanagu
Convert base64 into zipfile in django serializers

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6b8ad29-c7d8-4a0a-8a96-e7b5c0e5ee0e%40googlegroups.com.


Attribute error:module 'django.db.models' has no attribute 'PhoneField'

2020-04-29 Thread yashwanth balanagu
Attribute error:module 'django.db.models' has no attribute 'PhoneField'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4707ee45-3b2e-4f0a-bc6b-adb8000e88bd%40googlegroups.com.


How to connect the external independent template(contains of javascript and ajax) with django backend to POST the zip file to external template

2020-04-25 Thread yashwanth balanagu
connect the external independent template(contains of javascript and ajax) 
with django backend to pass the image from front end and get the image in 
backend convert into the zip file and post to external javascript template

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f27870e-0a6d-4c74-baca-982306515809%40googlegroups.com.