victoriagjh/sentiment_analysis

Upload the File

Closed this issue · 4 comments

Todo

  • upload the file to local
  • check the file type(txt, csv,json,excel etc..)
  • display the file at Second Page

Related Issues

#1 Basic Web Design

  • search the file extension of text
  • check the file name duplicated
    if file name is duplicated, file name is changed and can be read another file

def user_directory_path(instance, filename):
# file will be uploaded to MEDIA_ROOT/user_/
return 'user_{0}/{1}'.format(instance.user.id, filename)

class MyModel(models.Model):
upload = models.FileField(upload_to=user_directory_path)

#(https://docs.djangoproject.com/en/2.2/ref/models/fields/#filefield)

Implemented user can upload only "txt"