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c+`WN*j=h#!?uXjvLL3?wBQ$PMz&7oqRu|-g1q_
zGDtS9PnMlApEzm9PWSDl{_0xZzioTG;hEy-dAK(j3fCs+QVdDBZ*iO7y?uNNU#gH`l3Qd2zd
zC%3ZD;S~TttX|O8=l>Gjv+Qw+Ib~blmE4MmWK@Z0+l0L9(elhDOY&t*Nn5zUNJ!@!
z5U&Zz1U2(QxdpB9=|;1NBm#E|FwYP;KPYixv2AFO}XWH1AZt;
z)U)xSH_MK#joO@*Qf5LkTMaAK-GHIF3T~uF$%`=AdC>*gM$a#smM6M6+_ADq?CykK
z8U_H(>VzHJy#~YA|DaN^!IA(9N!_}+insuu7sIc7I^P)#GaI%ugBh8n2^oaH%jg#|hb0QrXiB6nujB<$f&~`3h5!Hn
diff --git a/fileupload/static/js/app.js b/fileupload/static/js/app.js
index 729eb1a..404b13d 100644
--- a/fileupload/static/js/app.js
+++ b/fileupload/static/js/app.js
@@ -40,7 +40,7 @@
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
- maxFileSize: 5000000,
+ maxFileSize: 100000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
}
diff --git a/fileupload/static/js/jquery.fileupload-validate.js b/fileupload/static/js/jquery.fileupload-validate.js
index 62f9fd3..de37447 100644
--- a/fileupload/static/js/jquery.fileupload-validate.js
+++ b/fileupload/static/js/jquery.fileupload-validate.js
@@ -71,7 +71,7 @@
maxNumberOfFiles: 'Maximum number of files exceeded',
acceptFileTypes: 'File type not allowed',
maxFileSize: 'File is too large',
- minFileSize: 'File is too small, min allowed size is 5MB.'
+ minFileSize: 'File is too small, min allowed size is 0.1MB.'
}
},
diff --git a/fileupload/static/js/main.js b/fileupload/static/js/main.js
index 049c3f1..47d960a 100644
--- a/fileupload/static/js/main.js
+++ b/fileupload/static/js/main.js
@@ -18,7 +18,7 @@ $(function () {
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
- minFileSize: 5000000,
+ minFileSize: 100000,
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
//url: 'server/php/'
@@ -40,7 +40,7 @@ $(function () {
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
//url: $('#fileupload').fileupload('option', 'url'),
- url: '/upload/view/',
+ url: 'https://ml.moldiscovery.com:8888/uploader/upload/view/',
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
diff --git a/fileupload/views.py b/fileupload/views.py
index 7fb24a4..cf799f6 100644
--- a/fileupload/views.py
+++ b/fileupload/views.py
@@ -65,7 +65,7 @@ def form_valid(self, form):
data = {'files': files}
response = JSONResponse(data, mimetype=response_mimetype(self.request))
response['Content-Disposition'] = 'inline; filename=files.json'
- send_email(data, self.request.user.username)
+ #send_email(data, self.request.user.username)
return response
def form_invalid(self, form):
diff --git a/settings.py b/settings.py
index 4328f30..390e6c3 100644
--- a/settings.py
+++ b/settings.py
@@ -1,12 +1,16 @@
import os
-DEBUG = True
+DEBUG = False
TEMPLATE_DEBUG = DEBUG
+ALLOWED_HOSTS = ['ml.moldiscovery.com','fileserver.lan','ajax.googleapis.com']
+
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
+SERVER_EMAIL = 'admin@ml.moldiscovery.com'
+
ADMINS = (
- # ('Your Name', 'your_email@example.com'),
+ ('SysAdmin', 'fabrizio@moldiscovery.com'),
)
MANAGERS = ADMINS
From 5bf157ef5020a4bdc4c6b3f6aa373405c8e355b8 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Fri, 15 Jan 2016 10:38:46 +0100
Subject: [PATCH 42/57] added last modified
---
fileupload/admin.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fileupload/admin.py b/fileupload/admin.py
index 3ae5990..42a8847 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -4,6 +4,7 @@
import tarfile
from django.contrib import messages
from django.conf import settings
+import os.path, time
def validate_size(files, maxsize):
total_size = 0
@@ -47,8 +48,12 @@ def file_size(obj):
return ("%s MBs" % (obj.file.size/1000000))
file_size.short_description = 'Size'
+def last_modified(obj):
+ date_text = "%s" % time.ctime(os.path.getmtime(settings.MEDIA_ROOT+obj.file.name))
+ return date_text
+
class FileAdmin(admin.ModelAdmin):
- list_display = ('slug','username', file_size)
+ list_display = ('slug','username', file_size, last_modified)
search_fields = ['slug', 'username']
ordering = ('username','slug')
actions = [make_download]
From 2ee84804094ba7986b2862e3f86aa59276e3c706 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 26 May 2016 08:31:43 +0200
Subject: [PATCH 43/57] manage script update
---
manage.py | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/manage.py b/manage.py
index 3e4eedc..f9726f9 100755
--- a/manage.py
+++ b/manage.py
@@ -1,14 +1,10 @@
#!/usr/bin/env python
-from django.core.management import execute_manager
-import imp
-try:
- imp.find_module('settings') # Assumed to be in the same directory.
-except ImportError:
- import sys
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
- sys.exit(1)
-
-import settings
+import os
+import sys
if __name__ == "__main__":
- execute_manager(settings)
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
From 874c41ca1c211f474fb58658d46cb8524fd20cfb Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 26 May 2016 09:41:21 +0200
Subject: [PATCH 44/57] archive files action added
---
fileupload/admin.py | 27 +++++++-
settings.py | 16 +++--
settings_dev.py | 159 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 197 insertions(+), 5 deletions(-)
create mode 100644 settings_dev.py
diff --git a/fileupload/admin.py b/fileupload/admin.py
index 42a8847..3504d2e 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -2,6 +2,7 @@
from django.contrib import admin
from django.http import HttpResponse
import tarfile
+import shutil
from django.contrib import messages
from django.conf import settings
import os.path, time
@@ -42,6 +43,30 @@ def make_download(modeladmin, request, queryset):
make_download.short_description = "Download selected files"
+
+def make_archive(modeladmin, request, queryset):
+
+ try:
+
+ for file in queryset:
+ archive_dir = os.path.join(settings.ARCHIVE_ROOT,file.username)
+ if not os.path.exists(archive_dir):
+ os.makedirs(archive_dir)
+
+ shutil.copyfile(settings.MEDIA_ROOT+file.file.name, os.path.join(archive_dir,file.slug))
+
+ file.delete()
+
+ messages.info(request, file.slug + " Archived Successfully")
+
+ except shutil.Error:
+ messages.error(request, "File Copy error, please contact the webmaster")
+ except :
+ messages.error(request, "There was an error, please contact the webmaster")
+
+make_archive.short_description = "Archive selected files"
+
+
def file_size(obj):
if obj.file.size < 1000000:
return ("%s bytes" % (obj.file.size))
@@ -56,7 +81,7 @@ class FileAdmin(admin.ModelAdmin):
list_display = ('slug','username', file_size, last_modified)
search_fields = ['slug', 'username']
ordering = ('username','slug')
- actions = [make_download]
+ actions = [make_download,make_archive]
admin.site.register(File,FileAdmin)
diff --git a/settings.py b/settings.py
index 390e6c3..5482b95 100644
--- a/settings.py
+++ b/settings.py
@@ -58,6 +58,8 @@
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'
+ARCHIVE_ROOT = os.path.join(MEDIA_ROOT,'archived')
+
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
@@ -137,11 +139,17 @@
'version': 1,
'disable_existing_loggers': False,
'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'class': 'django.utils.log.AdminEmailHandler'
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'filters': ['require_debug_false'],
+ 'class': 'django.utils.log.AdminEmailHandler'
}
},
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
@@ -149,4 +157,4 @@
'propagate': True,
},
}
-}
+}
\ No newline at end of file
diff --git a/settings_dev.py b/settings_dev.py
new file mode 100644
index 0000000..23fdb0c
--- /dev/null
+++ b/settings_dev.py
@@ -0,0 +1,159 @@
+import os
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+# uncomment this on production server and DEBUG=False
+#ALLOWED_HOSTS = ['ml.moldiscovery.com','ajax.googleapis.com']
+
+SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
+
+ADMINS = (
+ ('Fabrizio Buratta', 'fabrizio@moldiscovery.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': os.path.join(SITE_ROOT, 'db'), # Or path to database file if using sqlite3.
+ 'USER': '', # Not used with sqlite3.
+ 'PASSWORD': '', # Not used with sqlite3.
+ 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '', # Set to empty string for default. Not used with sqlite3.
+ }
+}
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# On Unix systems, a value of None will cause Django to use the same
+# timezone as the operating system.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'Europe/Rome'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale
+USE_L10N = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/home/media/media.lawrence.com/media/"
+MEDIA_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/media/'
+
+ARCHIVE_ROOT = os.path.join(MEDIA_ROOT,'archived')
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
+MEDIA_URL = '/media/'
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+STATIC_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/static/'
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = '/static/'
+
+# URL prefix for admin static files -- CSS, JavaScript and images.
+# Make sure to use a trailing slash.
+# Examples: "http://foo.com/static/admin/", "/static/admin/".
+ADMIN_MEDIA_PREFIX = '/static/admin/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+ # Put strings here, like "/home/html/static" or "C:/www/django/static".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '9%$in^gpdaig@v3or_to&_z(=n)3)$f1mr3hf9e#kespy2ajlo'
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.eggs.Loader',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+)
+
+ROOT_URLCONF = 'urls'
+
+TEMPLATE_DIRS = (
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+)
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'fileupload',
+ # Uncomment the next line to enable the admin:
+ 'django.contrib.admin',
+ # Uncomment the next line to enable admin documentation:
+ # 'django.contrib.admindocs',
+)
+
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'filters': ['require_debug_false'],
+ 'class': 'django.utils.log.AdminEmailHandler'
+ }
+ },
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
+ 'loggers': {
+ 'django.request': {
+ 'handlers': ['mail_admins'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
+ }
+}
From 8a106d5c82180d0c53b7f528a1d2c195229fe3bb Mon Sep 17 00:00:00 2001
From: root
Date: Wed, 10 Aug 2016 12:46:08 +0000
Subject: [PATCH 45/57] added wsgi file and minor fixes
---
core/wsgi.py | 58 ++++++++++++++
settings.py | 9 ++-
static/css/jquery.fileupload-ui.css | 114 ++++++++++++++++++++++++++++
3 files changed, 177 insertions(+), 4 deletions(-)
create mode 100644 core/wsgi.py
create mode 100644 static/css/jquery.fileupload-ui.css
diff --git a/core/wsgi.py b/core/wsgi.py
new file mode 100644
index 0000000..5151301
--- /dev/null
+++ b/core/wsgi.py
@@ -0,0 +1,58 @@
+"""
+WSGI config for finto project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+import sys
+import site
+
+ALLDIRS = ['/var/www/djuploader/lib/python2.7/site-packages']
+
+path = '/var/www/djuploader/dj-src'
+if path not in sys.path:
+ sys.path.append(path)
+
+# Remember original sys.path.
+prev_sys_path = list(sys.path)
+
+# Add each new site-packages directory.
+for directory in ALLDIRS:
+ site.addsitedir(directory)
+
+# Reorder sys.path so new directories at the front.
+new_sys_path = []
+for item in list(sys.path):
+ if item not in prev_sys_path:
+ new_sys_path.append(item)
+ sys.path.remove(item)
+sys.path[:0] = new_sys_path
+
+activate_this = '/var/www/djuploader/bin/activate_this.py'
+execfile(activate_this, dict(__file__=activate_this))
+
+# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
+# if running multiple sites in the same mod_wsgi process. To fix this, use
+# mod_wsgi daemon mode with each site in its own daemon process, or use
+# os.environ["DJANGO_SETTINGS_MODULE"] = "finto.settings"
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)
diff --git a/settings.py b/settings.py
index 5482b95..7b0689f 100644
--- a/settings.py
+++ b/settings.py
@@ -3,11 +3,11 @@
DEBUG = False
TEMPLATE_DEBUG = DEBUG
-ALLOWED_HOSTS = ['ml.moldiscovery.com','fileserver.lan','ajax.googleapis.com']
+ALLOWED_HOSTS = ['www2.moldiscovery.com','localhost','127.0.0.1','ajax.googleapis.com']
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
-SERVER_EMAIL = 'admin@ml.moldiscovery.com'
+SERVER_EMAIL = 'admin@www2.moldiscovery.com'
ADMINS = (
('SysAdmin', 'fabrizio@moldiscovery.com'),
@@ -51,7 +51,8 @@
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/media/'
+#MEDIA_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/media/'
+MEDIA_ROOT = '/var/media-storage/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
@@ -157,4 +158,4 @@
'propagate': True,
},
}
-}
\ No newline at end of file
+}
diff --git a/static/css/jquery.fileupload-ui.css b/static/css/jquery.fileupload-ui.css
new file mode 100644
index 0000000..693862f
--- /dev/null
+++ b/static/css/jquery.fileupload-ui.css
@@ -0,0 +1,114 @@
+@charset "UTF-8";
+/*
+ * jQuery File Upload UI Plugin CSS 8.8.1
+ * https://github.com/blueimp/jQuery-File-Upload
+ *
+ * Copyright 2010, Sebastian Tschan
+ * https://blueimp.net
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/MIT
+ */
+
+.fileinput-button {
+ position: relative;
+ overflow: hidden;
+}
+.fileinput-button input {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin: 0;
+ opacity: 0;
+ filter: alpha(opacity=0);
+ transform: translate(-300px, 0) scale(4);
+ font-size: 23px;
+ direction: ltr;
+ cursor: pointer;
+}
+.fileupload-buttonbar .btn,
+.fileupload-buttonbar .toggle {
+ margin-bottom: 5px;
+}
+.progress-animated .progress-bar,
+.progress-animated .bar {
+ background: url(../img/progressbar.gif) !important;
+ filter: none;
+}
+
+
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+ background: none repeat scroll 0 0 #005491;
+ border: 1px solid #515091;
+ color: #EEEEEE;
+ font-weight: bold;
+ margin: 0px;
+}
+
+.ui-widget-content {
+ border: 1px solid #555555;
+ height: 14px;
+ margin-bottom: 10px;
+ width: 80%;
+ background: #000000 url(../img/progressbar.gif) 50% 50% repeat;
+ color: #ffffff;
+}
+
+.ui-widget-header {
+border: 1px solid #798E9B;
+/*background: #388532 url(images/ui-bg_highlight-soft_44_444444_1x100.png) 50% 50% repeat-x;*/
+background: #005491 url(../img/ui-bg_highlight-soft_44_444444_1x100.png) 50% 50% repeat-x;
+color: #ffffff;
+font-weight: bold;
+}
+
+.ui-widget {
+ font-size: 0.92em;
+}
+
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
+ border-bottom-right-radius: 6px;
+}
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
+ border-bottom-left-radius: 6px;
+}
+
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
+ border-top-right-radius: 6px;
+}
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
+ border-top-left-radius: 6px;
+}
+
+/*.fileupload-loading {
+ float: right;
+ width: 32px;
+ height: 32px;
+ background: url(../img/loading.gif) center no-repeat;
+ background-size: contain;
+ display: none;
+}*/
+
+.fileupload-processing .fileupload-loading {
+ display: block;
+}
+.files audio,
+.files video {
+ max-width: 300px;
+}
+
+@media (max-width: 767px) {
+ .fileupload-buttonbar .toggle,
+ .files .toggle,
+ .files .btn span {
+ display: none;
+ }
+ .files .name {
+ width: 80px;
+ word-wrap: break-word;
+ }
+ .files audio,
+ .files video {
+ max-width: 80px;
+ }
+}
From 700759029520954a3f198b6fe47dab956990aa84 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Fri, 12 Aug 2016 08:25:18 +0200
Subject: [PATCH 46/57] fix file removal on the disk
---
fileupload/models.py | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/fileupload/models.py b/fileupload/models.py
index 9a09f77..95041c0 100644
--- a/fileupload/models.py
+++ b/fileupload/models.py
@@ -1,5 +1,10 @@
# encoding: utf-8
from django.db import models
+# Receive the pre_delete signal and delete the file associated with the model instance.
+from django.db.models.signals import post_delete
+from django.dispatch.dispatcher import receiver
+
+
def upload_dir_path(instance, filename):
return 'uploaded_files/%s/%s' % (instance.username, filename)
@@ -26,7 +31,13 @@ def save(self, *args, **kwargs):
self.slug = self.file.name
super(File, self).save(*args, **kwargs)
- def delete(self, *args, **kwargs):
- """delete -- Remove to leave file."""
- self.file.delete(False)
- super(File, self).delete(*args, **kwargs)
+ # use post_delete signal instead
+ #def delete(self, *args, **kwargs):
+ # """delete -- Remove to leave file."""
+ # self.file.delete(False)
+ # super(File, self).delete(*args, **kwargs)
+
+@receiver(post_delete, sender=File)
+def File_delete(sender, instance, **kwargs):
+ # Pass false so FileField doesn't save the model.
+ instance.file.delete(False)
From 11a96c4a4d5178ec52807132e86970e799fdab73 Mon Sep 17 00:00:00 2001
From: fab
Date: Fri, 12 Aug 2016 07:25:10 +0000
Subject: [PATCH 47/57] added apache and selinux configurations
---
deploy/apache/apache.conf | 52 +++++++++++++++++++++++++++++++++
deploy/selinux/djuploader2.0.te | 12 ++++++++
2 files changed, 64 insertions(+)
create mode 100644 deploy/apache/apache.conf
create mode 100644 deploy/selinux/djuploader2.0.te
diff --git a/deploy/apache/apache.conf b/deploy/apache/apache.conf
new file mode 100644
index 0000000..0612f85
--- /dev/null
+++ b/deploy/apache/apache.conf
@@ -0,0 +1,52 @@
+# WSGISocketPrefix
+WSGISocketPrefix /var/run/wsgi
+WSGIPythonPath /path_to_app:/path_to_virtualenv/lib/python2.7/site-packages
+
+###################
+# web uploads
+#
+
+# config from http://wiki.apache.org/httpd/NameBasedSSLVHosts
+ SSLEngine on
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
+
+ SSLCertificateFile /etc/ssl/certs/cert.com.crt
+ SSLCertificateKeyFile /etc/ssl/certs/cert.com.key
+ SSLCertificateChainFile /etc/ssl/certs/StandardSSLCA.pem
+ SSLVerifyClient None
+
+ ServerName "foo"
+ ServerAdmin "webmaster@foo"
+
+ CustomLog "/var/log/httpd/upload-access.log" combined
+ ErrorLog "/var/log/httpd/upload-error.log"
+
+ # Django file uploader
+ ###################################################
+ Alias /media/ /var/media-storage/
+ AliasMatch ^/([^/]*\.css) /path_to_app/static/css/$1
+ Alias /static/ /path_to_app/static/
+
+
+ Require all granted
+
+
+
+ Require all denied
+
+
+ WSGIScriptAlias /secureupload /path_to_app/core/wsgi.py
+
+
+ SSLRequireSSL
+
+
+ Require all granted
+
+
+
+
+# END WEBUPLOADS
+#################
+
+# /* vim: set expandtab tabstop=4 shiftwidth=4: */
diff --git a/deploy/selinux/djuploader2.0.te b/deploy/selinux/djuploader2.0.te
new file mode 100644
index 0000000..9e96269
--- /dev/null
+++ b/deploy/selinux/djuploader2.0.te
@@ -0,0 +1,12 @@
+
+module djuploader 1.0;
+
+require {
+ type httpd_t;
+ type var_t;
+ class file { getattr unlink };
+}
+
+#============= httpd_t ==============
+allow httpd_t var_t:file unlink;
+allow httpd_t var_t:file getattr;
From bded78e8b48c433aa26c0c68e3b2e59affa544f2 Mon Sep 17 00:00:00 2001
From: fab
Date: Mon, 22 Aug 2016 08:52:12 +0000
Subject: [PATCH 48/57] hostname changed and related fixes to jquery scripts
and django config
---
fileupload/admin.py | 4 ++--
fileupload/static/js/main.js | 2 +-
fileupload/views.py | 6 +++---
settings.py | 2 +-
static/css/jquery.fileupload-ui.css | 4 ++--
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/fileupload/admin.py b/fileupload/admin.py
index 3504d2e..c8d3c6b 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -24,8 +24,8 @@ def make_download(modeladmin, request, queryset):
tarred = tarfile.open(fileobj=response, mode='w:gz')
- if not validate_size(queryset,500000000):
- messages.warning(request, "Download group is too big, unselect some files or select just 1, max size of multple download: 500 MB")
+ if not validate_size(queryset,1000000000):
+ messages.warning(request, "Download group is too big, unselect some files or select just 1, max size of multple download: 1.0 GB")
else:
diff --git a/fileupload/static/js/main.js b/fileupload/static/js/main.js
index 47d960a..3a2add2 100644
--- a/fileupload/static/js/main.js
+++ b/fileupload/static/js/main.js
@@ -40,7 +40,7 @@ $(function () {
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
//url: $('#fileupload').fileupload('option', 'url'),
- url: 'https://ml.moldiscovery.com:8888/uploader/upload/view/',
+ url: 'https://upload.moldiscovery.com/secureupload/upload/view/',
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
diff --git a/fileupload/views.py b/fileupload/views.py
index cf799f6..0be5568 100644
--- a/fileupload/views.py
+++ b/fileupload/views.py
@@ -13,7 +13,7 @@
def send_email(response,user):
- FROMADDR = "uploads@ml.moldiscovery.com"
+ FROMADDR = "uploads@www2.moldiscovery.com"
LOGIN = FROMADDR
#PASSWORD = ""
TOADDRS = ["fabrizio@moldiscovery.com"]
@@ -23,7 +23,7 @@ def send_email(response,user):
for file in response['files']:
msg_content += "File Uploaded: "+ file['name'] + '\r\n'
msg_content += "File Size: "+ str(file['size']) + ' bytes\r\n'
- msg_content += "Download: https://ml.moldiscovery.com:8888/uploader"+ file['url'] + '\r\n\r\n'
+ msg_content += "Download: https://www2.moldiscovery.com/secureupload/admin/" + '\r\n\r\n'
msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n"
% (FROMADDR, ", ".join(TOADDRS), SUBJECT) )
@@ -31,7 +31,7 @@ def send_email(response,user):
server = smtplib.SMTP('localhost', 25)
#server.set_debuglevel(1)
- server.ehlo("ml.moldiscovery.com")
+ server.ehlo("www2.moldiscovery.com")
#server.starttls()
#server.login(LOGIN, PASSWORD)
server.sendmail(FROMADDR, TOADDRS, msg)
diff --git a/settings.py b/settings.py
index 7b0689f..7b0832d 100644
--- a/settings.py
+++ b/settings.py
@@ -3,7 +3,7 @@
DEBUG = False
TEMPLATE_DEBUG = DEBUG
-ALLOWED_HOSTS = ['www2.moldiscovery.com','localhost','127.0.0.1','ajax.googleapis.com']
+ALLOWED_HOSTS = ['upload.moldiscovery.com','www2.moldiscovery.com','localhost','127.0.0.1','ajax.googleapis.com']
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
diff --git a/static/css/jquery.fileupload-ui.css b/static/css/jquery.fileupload-ui.css
index 693862f..6d96259 100644
--- a/static/css/jquery.fileupload-ui.css
+++ b/static/css/jquery.fileupload-ui.css
@@ -80,14 +80,14 @@ font-weight: bold;
border-top-left-radius: 6px;
}
-/*.fileupload-loading {
+.fileupload-loading {
float: right;
width: 32px;
height: 32px;
background: url(../img/loading.gif) center no-repeat;
background-size: contain;
display: none;
-}*/
+}
.fileupload-processing .fileupload-loading {
display: block;
From 14070e290c6bcc6e171a590207498183dcf7acbf Mon Sep 17 00:00:00 2001
From: fab
Date: Fri, 24 Jan 2020 13:52:45 +0000
Subject: [PATCH 49/57] give some advise on max file upload size cause: systemd
privateTMP for httpd
---
fileupload/templates/fileupload/file_jquery_form.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fileupload/templates/fileupload/file_jquery_form.html b/fileupload/templates/fileupload/file_jquery_form.html
index b190ed6..1571158 100644
--- a/fileupload/templates/fileupload/file_jquery_form.html
+++ b/fileupload/templates/fileupload/file_jquery_form.html
@@ -50,7 +50,10 @@
- Molecular Discovery Secure File Upload.( TIP: Compress your files when possible. ) |
+ Molecular Discovery Secure File Upload.
+ MAX cumulative files upload size: 4 GB
+
TIP: compress or chunck big files before uploading
+ |
 |
From 6c601ac4776f1d458a3c78cdacf62493ad2653c3 Mon Sep 17 00:00:00 2001
From: fab
Date: Fri, 24 Jan 2020 14:16:56 +0000
Subject: [PATCH 50/57] minor
---
fileupload/templates/fileupload/file_jquery_form.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fileupload/templates/fileupload/file_jquery_form.html b/fileupload/templates/fileupload/file_jquery_form.html
index 1571158..e1d5c68 100644
--- a/fileupload/templates/fileupload/file_jquery_form.html
+++ b/fileupload/templates/fileupload/file_jquery_form.html
@@ -51,7 +51,7 @@
Molecular Discovery Secure File Upload.
- MAX cumulative files upload size: 4 GB
+
MAX aggregated files upload size: 4 GB
TIP: compress or chunck big files before uploading
|
 |
From a6c9defad8032d947e4bbe9995154a7d0579e48c Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 14 Mar 2024 08:42:34 +0100
Subject: [PATCH 51/57] added Date field migration
---
fileupload/admin.py | 8 +++--
fileupload/migrations/0001_initial.py | 36 +++++++++++++++++++
.../0002_auto__add_field_file_date.py | 33 +++++++++++++++++
fileupload/migrations/__init__.py | 0
fileupload/models.py | 14 +++-----
requirements.txt | 5 +--
settings_dev.py | 1 +
7 files changed, 83 insertions(+), 14 deletions(-)
create mode 100644 fileupload/migrations/0001_initial.py
create mode 100644 fileupload/migrations/0002_auto__add_field_file_date.py
create mode 100644 fileupload/migrations/__init__.py
diff --git a/fileupload/admin.py b/fileupload/admin.py
index c8d3c6b..b9e6c7f 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -6,6 +6,7 @@
from django.contrib import messages
from django.conf import settings
import os.path, time
+import datetime as dt
def validate_size(files, maxsize):
total_size = 0
@@ -74,13 +75,14 @@ def file_size(obj):
file_size.short_description = 'Size'
def last_modified(obj):
- date_text = "%s" % time.ctime(os.path.getmtime(settings.MEDIA_ROOT+obj.file.name))
+ date_text = "%s" % dt.datetime.fromtimestamp(os.path.getmtime(settings.MEDIA_ROOT+obj.file.name))
return date_text
class FileAdmin(admin.ModelAdmin):
- list_display = ('slug','username', file_size, last_modified)
+ list_display = ('slug','username', 'date', file_size, last_modified)
+ list_filter = ('username',)
search_fields = ['slug', 'username']
- ordering = ('username','slug')
+ ordering = ('username','slug', 'date')
actions = [make_download,make_archive]
diff --git a/fileupload/migrations/0001_initial.py b/fileupload/migrations/0001_initial.py
new file mode 100644
index 0000000..3d87f52
--- /dev/null
+++ b/fileupload/migrations/0001_initial.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding model 'File'
+ db.create_table(u'fileupload_file', (
+ (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
+ ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, blank=True)),
+ ('username', self.gf('django.db.models.fields.CharField')(max_length=50)),
+ ))
+ db.send_create_signal(u'fileupload', ['File'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'File'
+ db.delete_table(u'fileupload_file')
+
+
+ models = {
+ u'fileupload.file': {
+ 'Meta': {'object_name': 'File'},
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['fileupload']
\ No newline at end of file
diff --git a/fileupload/migrations/0002_auto__add_field_file_date.py b/fileupload/migrations/0002_auto__add_field_file_date.py
new file mode 100644
index 0000000..45648fa
--- /dev/null
+++ b/fileupload/migrations/0002_auto__add_field_file_date.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding field 'File.date'
+ db.add_column(u'fileupload_file', 'date',
+ self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Deleting field 'File.date'
+ db.delete_column(u'fileupload_file', 'date')
+
+
+ models = {
+ u'fileupload.file': {
+ 'Meta': {'object_name': 'File'},
+ 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['fileupload']
\ No newline at end of file
diff --git a/fileupload/migrations/__init__.py b/fileupload/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/fileupload/models.py b/fileupload/models.py
index 95041c0..8f40fa6 100644
--- a/fileupload/models.py
+++ b/fileupload/models.py
@@ -1,4 +1,5 @@
# encoding: utf-8
+from datetime import datetime
from django.db import models
# Receive the pre_delete signal and delete the file associated with the model instance.
from django.db.models.signals import post_delete
@@ -10,13 +11,8 @@ def upload_dir_path(instance, filename):
return 'uploaded_files/%s/%s' % (instance.username, filename)
class File(models.Model):
- """This is a small demo using just two fields. The slug field is really not
- necessary, but makes the code simpler. ImageField depends on PIL or
- pillow (where Pillow is easily installable in a virtualenv. If you have
- problems installing pillow, use a more generic FileField instead.
-
- """
file = models.FileField(upload_to=upload_dir_path)
+ date = models.DateTimeField(default=datetime.now, blank=True)
slug = models.SlugField(max_length=50, blank=True, verbose_name="file name")
username = models.CharField(max_length=50)
@@ -27,9 +23,9 @@ def __unicode__(self):
def get_absolute_url(self):
return ('upload-new', )
- def save(self, *args, **kwargs):
- self.slug = self.file.name
- super(File, self).save(*args, **kwargs)
+ # def save(self, *args, **kwargs):
+ # self.slug = self.file.name
+ # super(File, self).save(*args, **kwargs)
# use post_delete signal instead
#def delete(self, *args, **kwargs):
diff --git a/requirements.txt b/requirements.txt
index 23cb63a..8790390 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
-django<1.6
-pillow
+django==1.5.12
+pillow==6.2.2
+South==1.0.2
diff --git a/settings_dev.py b/settings_dev.py
index 23fdb0c..4806e13 100644
--- a/settings_dev.py
+++ b/settings_dev.py
@@ -125,6 +125,7 @@
'fileupload',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
+ 'south'
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
From c3d16a83dd2337152b2a436b4b7d13f2982cb407 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 14 Mar 2024 08:48:09 +0100
Subject: [PATCH 52/57] update db objects date with files last mod date
---
utils/update_datefield.py | 41 +++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 utils/update_datefield.py
diff --git a/utils/update_datefield.py b/utils/update_datefield.py
new file mode 100644
index 0000000..f8ca3e4
--- /dev/null
+++ b/utils/update_datefield.py
@@ -0,0 +1,41 @@
+import datetime as dt
+import os
+from fileupload.models import File
+from django.conf import settings
+
+
+def sync_slug(allobj):
+ """
+ fill slug field from file name when missing
+ """
+ for obj in allobj:
+ obj.slug = os.path.basename(obj.file.name)
+ obj.save()
+ print("fix missing slug: %s") % obj.slug
+
+db_files = File.objects.all()
+uploads_path = os.path.join(settings.MEDIA_ROOT,'uploaded_files')
+users = set()
+
+sync_slug(db_files)
+
+for f in db_files:
+ users.add(f.username)
+
+for user_dir in users:
+ user_files = os.listdir(os.path.join(uploads_path, user_dir))
+ print(user_dir + " " + str(len(user_files)))
+ for fname in user_files:
+ # only if there are duplicated
+ print("processa "+ " dir: "+user_dir +" name: " + fname)
+ qset = File.objects.filter(username=user_dir, slug=fname)
+
+ if not qset:
+ print("ERROR: file %s/%s not found") % (user_dir, fname)
+
+ if len(qset) > 1:
+ print("%s/%s is duplicated") % (user_dir, fname)
+
+ obj = qset[0]
+ obj.date = dt.datetime.fromtimestamp(os.path.getmtime(os.path.join(uploads_path, user_dir,obj.slug)))
+ obj.save()
\ No newline at end of file
From bed1a6a36ea7d690288ee00a0bd1e951ce7e410c Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 14 Mar 2024 11:25:05 +0100
Subject: [PATCH 53/57] avoid admin crash if files not found
---
fileupload/admin.py | 18 +++++++++++++-----
fileupload/models.py | 6 +++---
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/fileupload/admin.py b/fileupload/admin.py
index b9e6c7f..d1e01e7 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -69,14 +69,22 @@ def make_archive(modeladmin, request, queryset):
def file_size(obj):
- if obj.file.size < 1000000:
- return ("%s bytes" % (obj.file.size))
- return ("%s MBs" % (obj.file.size/1000000))
+ try:
+ if obj.file.size < 1000000:
+ return ("%s bytes" % (obj.file.size))
+ return ("%s MBs" % (obj.file.size/1000000))
+ except OSError:
+ return ("File Not found")
+
file_size.short_description = 'Size'
def last_modified(obj):
- date_text = "%s" % dt.datetime.fromtimestamp(os.path.getmtime(settings.MEDIA_ROOT+obj.file.name))
- return date_text
+ date_text = "File Not Found"
+ filepath = settings.MEDIA_ROOT+obj.file.name
+ if os.path.exists(filepath):
+ date_text = "%s" % dt.datetime.fromtimestamp(os.path.getmtime(filepath))
+
+ return date_text
class FileAdmin(admin.ModelAdmin):
list_display = ('slug','username', 'date', file_size, last_modified)
diff --git a/fileupload/models.py b/fileupload/models.py
index 8f40fa6..3fcee50 100644
--- a/fileupload/models.py
+++ b/fileupload/models.py
@@ -23,9 +23,9 @@ def __unicode__(self):
def get_absolute_url(self):
return ('upload-new', )
- # def save(self, *args, **kwargs):
- # self.slug = self.file.name
- # super(File, self).save(*args, **kwargs)
+ def save(self, *args, **kwargs):
+ self.slug = self.file.name
+ super(File, self).save(*args, **kwargs)
# use post_delete signal instead
#def delete(self, *args, **kwargs):
From e3322ae467b453644857ecc1975ec8461a4e8299 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 14 Mar 2024 12:21:26 +0100
Subject: [PATCH 54/57] details
---
fileupload/admin.py | 7 ++++---
utils/update_datefield.py | 3 ---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/fileupload/admin.py b/fileupload/admin.py
index d1e01e7..c924e8d 100644
--- a/fileupload/admin.py
+++ b/fileupload/admin.py
@@ -78,18 +78,19 @@ def file_size(obj):
file_size.short_description = 'Size'
+# deprecated
def last_modified(obj):
date_text = "File Not Found"
filepath = settings.MEDIA_ROOT+obj.file.name
- if os.path.exists(filepath):
+ if os.path.exists(filepath):
date_text = "%s" % dt.datetime.fromtimestamp(os.path.getmtime(filepath))
return date_text
class FileAdmin(admin.ModelAdmin):
- list_display = ('slug','username', 'date', file_size, last_modified)
+ list_display = ('slug','username', 'date', file_size)
list_filter = ('username',)
- search_fields = ['slug', 'username']
+ search_fields = ['slug', 'username', 'date']
ordering = ('username','slug', 'date')
actions = [make_download,make_archive]
diff --git a/utils/update_datefield.py b/utils/update_datefield.py
index f8ca3e4..809a589 100644
--- a/utils/update_datefield.py
+++ b/utils/update_datefield.py
@@ -29,13 +29,10 @@ def sync_slug(allobj):
# only if there are duplicated
print("processa "+ " dir: "+user_dir +" name: " + fname)
qset = File.objects.filter(username=user_dir, slug=fname)
-
if not qset:
print("ERROR: file %s/%s not found") % (user_dir, fname)
-
if len(qset) > 1:
print("%s/%s is duplicated") % (user_dir, fname)
-
obj = qset[0]
obj.date = dt.datetime.fromtimestamp(os.path.getmtime(os.path.join(uploads_path, user_dir,obj.slug)))
obj.save()
\ No newline at end of file
From e194c7ff0fe57aad17546ec2a87dd7f6227a0dac Mon Sep 17 00:00:00 2001
From: fburatta
Date: Thu, 14 Mar 2024 15:52:14 +0100
Subject: [PATCH 55/57] readme update
---
README.md | 39 +++++++++++++++++++++------------------
utils/update_datefield.py | 3 +++
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 8f185a9..863f189 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,8 @@
-[jQuery-File-Upload](http://aquantum-demo.appspot.com/file-upload) is developed by Sebastian Tschan, with the source available on [github](https://github.com/blueimp/jQuery-File-Upload). Example code is [ported to Django](https://github.com/sigurdga/django-jquery-file-upload) by Sigurd Gartmann ([sigurdga on github](https://github.com/sigurdga/)).
+Disclaimer
+==========
-Introduction
-============
-
-This is a small example on how to setup Sebastian Tschan's jQuery File Upload in Django. He has a working demo on his [webpage](http://aquantum-demo.appspot.com/file-upload) and a [github repository](https://github.com/blueimp/jQuery-File-Upload) with an example on how to do it in PHP.
-
-Here, you'll find a minimal Django project with a minimal app. You can run the example standalone by cloning the repository, running the migrations and starting the server.
-
-I want to give a thank to [Sebastian Tschan](https://github.com/blueimp), the original author, [Etay Cohen-Solal](https://github.com/et-cs), for the latest major update, and [Jørgen Bergquist](https://github.com/bergquis) for helping me over the first hurdles.
-
-Features
-========
+This project is a fork
-* Drag and drop files
-* Select multiple files
-* Cancel upload
-* Delete uploaded file (from database only)
-* No flash (or other browser plugins) needed
-* … more at the [upstream's features page](http://aquantum-demo.appspot.com/file-upload#features)
Requirements
============
@@ -37,6 +22,24 @@ Installation
* python manage.py runserver
* go to localhost:8000/upload/new/ and upload some files
+Developing with docker
+======================
+ $ docker run -ti --name uploaderdevel -p 8000:8000 -v /workdir/django_uploader:/devel python:2.7.18 bash
+ $ pip install -r requirements.txt
+ $ python manage.py runserver 0.0.0.0:8000
+
+Database migrations
+===================
+
+From existing DB
+ $ python manage.py schemamigration fileupload --initial
+ $ python manage.py migrate --fake
+
+
+Generate migration and apply
+ $ python manage.py schemamigration fileupload --auto
+ $ python manage.py migrate fileupload
+
License
=======
MIT, as the original project. See LICENSE.txt.
diff --git a/utils/update_datefield.py b/utils/update_datefield.py
index 809a589..b894412 100644
--- a/utils/update_datefield.py
+++ b/utils/update_datefield.py
@@ -1,3 +1,6 @@
+# This script can be invoked from python manage.py shell. It's aim is to update the Date Field of the fileupload model
+# with the dates of existing files in the media storage and associated to the model object
+
import datetime as dt
import os
from fileupload.models import File
From eef1d0087cda21ae97ecc40801e7ccfdab5c8643 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Mon, 18 Mar 2024 11:47:35 +0100
Subject: [PATCH 56/57] fix date null on creation DB error
---
README.md | 1 +
fileupload/models.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 863f189..a5596da 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@ Developing with docker
======================
$ docker run -ti --name uploaderdevel -p 8000:8000 -v /workdir/django_uploader:/devel python:2.7.18 bash
$ pip install -r requirements.txt
+ $ export DJANGO_SETTINGS_MODULE=settings_dev
$ python manage.py runserver 0.0.0.0:8000
Database migrations
diff --git a/fileupload/models.py b/fileupload/models.py
index 3fcee50..aff009f 100644
--- a/fileupload/models.py
+++ b/fileupload/models.py
@@ -12,7 +12,7 @@ def upload_dir_path(instance, filename):
class File(models.Model):
file = models.FileField(upload_to=upload_dir_path)
- date = models.DateTimeField(default=datetime.now, blank=True)
+ date = models.DateTimeField(auto_now_add=True, blank=True)
slug = models.SlugField(max_length=50, blank=True, verbose_name="file name")
username = models.CharField(max_length=50)
From 2562e32ce1301cb4c618ace3c364a167fd1c24d1 Mon Sep 17 00:00:00 2001
From: fburatta
Date: Mon, 18 Mar 2024 11:50:26 +0100
Subject: [PATCH 57/57] forgot migration file
---
.../0003_auto__chg_field_file_date.py | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 fileupload/migrations/0003_auto__chg_field_file_date.py
diff --git a/fileupload/migrations/0003_auto__chg_field_file_date.py b/fileupload/migrations/0003_auto__chg_field_file_date.py
new file mode 100644
index 0000000..24d9c92
--- /dev/null
+++ b/fileupload/migrations/0003_auto__chg_field_file_date.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'File.date'
+ db.alter_column(u'fileupload_file', 'date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True))
+
+ def backwards(self, orm):
+
+ # Changing field 'File.date'
+ db.alter_column(u'fileupload_file', 'date', self.gf('django.db.models.fields.DateTimeField')())
+
+ models = {
+ u'fileupload.file': {
+ 'Meta': {'object_name': 'File'},
+ 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ }
+ }
+
+ complete_apps = ['fileupload']
\ No newline at end of file