I am trying to upload documets in appengine-django. Docs getting uploaded successfully with pure django code [ using python manage.py runsever ]. But when i am trying to run django with appengine project it gives me error ,
[Errno 30] Read-only file system: u'/home/nishant/workspace1/problemdemo/uploaded_files/1372313114_43_nishant26062013.zip'
This error caused because Developers have read-only access to the filesystem on App Engine.
Is there is another way to upload docs to google cloud sql ?
Here is my code ,
models.py
from django.db import models
import time
# Create your models here.
def get_upload_file_name(instance,filename):
return "uploaded_files/%s_%s" % (str(time.time()).replace('.','_'),filename)
class Candidate(models.Model):
title=models.CharField(max_length=20)
resume=models.FileField(upload_to=get_upload_file_name)
def __unicode__(self):
return self.title
forms.py
from django import forms
from actualproblem.models import Candidate
class TestForm(forms.ModelForm):
class Meta:
model=Candidate
fields=('title','resume',)
views.py
# Create your views here.
from django.shortcuts import render
from actualproblem.forms import TestForm
def sampletest(request):
if request.method=='POST':
form = TestForm(request.POST,request.FILES)
if form.is_valid():
form.save()
else:
form=TestForm()
return render(request,'profile.html',{'form':form})
How can i upload documetns to google cloud sql ?