Hi,
I'm working on a small website project at pythonanywhere.com.Website I'm working on has ASCII image converter in it. The website has no errors when I run it on my local server.
It also works well at pythonanywhere, but when I upload an image to convert it to ASCII image and submit, instead of keep running and converting the image to ASCII image, I keep getting "no such table" error. Once again, I had no such error when I ran this website on local server.
I didn't use database for my website and I would like to avoid using it as long as possible. My question is, is there a way for me to run my website without creating/using database on pythonanywhere.com? or do I have to create one?
P.S.: I use Python 3.8.5 and Django 3.1.1
You can find my views.py and models.py files below.
My views.py file is as following:
from django.shortcuts import render, HttpResponse
from django.http import HttpResponse
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from .models import FilesUpload
from .asciicode import main, give_result
import os
def home(request):
if request.method == "POST":
file2 = request.FILES["file"]
document = FilesUpload.objects.create(file=file2)
document.save()
main()
result_path = give_result()
print(result_path)
return render(request, "result.html", result_path)
#return HttpResponse("Your file was uploaded")
return render(request, "upload.html")
And this is my models.py file:
from django.db import models
# Create your models here.
class FilesUpload(models.Model):
file = models.FileField(upload_to='/home/seoapp/asciiconverter/media/images/')
[edited by admin: code formatting]