gkuhn1 / django-admin-multiupload Goto Github PK
View Code? Open in Web Editor NEWMulti file upload for django-admin app
Multi file upload for django-admin app
Hi im new to django, just trying to add multiple upload images to my blog Post model in Django admin panel. Right now I have a simple single image upload using ckeditor but I need to be able to simply upload multiple images without a convoluted rats nest of functions and widgets. I am unclear on your readme, where does the code block below this line go? Would be nice to have a clearer guide on how to integrate this easily.
Here is my simple Post model and post.html template:
class Post(models.Model):
user = models.ForeignKey(User)
title = models.CharField(max_length = 140)
body = models.TextField()
date = models.DateTimeField()
# image = models.ImageField(upload_to='uploads')
<div class="container">
<div class="col-md-12 text-center">
<h3> {{ post.title }} </h3> <br>
<h6> on {{ post.date }} </h6> <br>
<img src="{{ post.image.url }}" class="img-responsive center-block" align="left" height="35%" width="35%" alt="">
{{ post.body|safe|linebreaks }}
</div>
</div>
Hi,
I'm getting the error from title by default. App was installed into a virtualenv as:
pip install git+git://github.com/gkuhn1/django-admin-multiupload.git
Here is my admin.py where I'm using admin-multiupload.
My system is Django==1.6.5 && Python 2.7.8
Though after this change everything works like a charm.
diff --git a/multiupload/admin.py b/multiupload/admin.py
index 226a254..15b88c7 100644
--- a/multiupload/admin.py
+++ b/multiupload/admin.py
@@ -195,8 +195,8 @@ class MultiUploadAdmin(admin.ModelAdmin):
f.file.seek(0)
# Manipulate file.
- data = self.process_uploaded_file(f, object,
- request)
+ data = self.process_uploaded_file(f, object)
+ # request)
assert 'id' in data, 'Must return id in data'
response_data.update(data)
Am I doing something wrong or is it a real issue?
Hi there, thank you for doing this. I've been testing this out in dev for a few days now and decided to implement this in a personal page I have in production. Anyways, for some strange reason, this line is giving me a heck of a lot of trouble:
File: multiupload/templates/multiupload/upload.html
Line 28: <!--[if gte IE 8]><script src="{% static 'jquery/jquery.xdr-transport.js' %}"></script><![endif]-->
In my logs, I get something similar to missing static file manifest for jquery/jquery.xdr-transport.js
. I've been looking through the static files for the package and don't see this file anywhere. Any idea on what's going on?
For the moment, I decided to comment out that line and it seems to be running smoothly now. I'm not really supporting IE ๐ , but I'd like to know what causes this.
Does it support safari 5.1.7 for Windows?
Please add trans blocks into templates and use ugettext in .py files.
Added support for Django 2.0
Is there a way to use the app via inlines?
Hey.
I'm trying to use your app with the django-imagekit which I use to generate thumbnails. When I only use multiupload, everything works fine. When I only use django-imagekit to cache and display thumbnails everything works fine, too. But when I use both I always get an "OSError - decoder jpeg not available" error.
Is there a way to fix this? If needed I could also provide some code of mine.
Edit: Since I got no answer here I also opened an (more detailed) issue in the imagekit repo. You can see it here: matthewwithanm/django-imagekit#328
Hey,
I think in your last commit something broke... loading template tag 'raw' fails
TemplateSyntaxError: 'raw' is not a valid tag library: Template library multiupload.templatetags.raw does not have a variable named 'register'
<!--[if gte IE 8]><script src="{% static 'jquery/jquery.xdr-transport.js"></script><![endif]-->
It should be
<!--[if gte IE 8]><script src="{% static 'jquery/jquery.xdr-transport.js' %}"></script><![endif]-->
Thank you for an awesome module. We use it in edegal for uploading photos into a photo gallery.
The setup.py
file for django-admin-multiupload
states license="GPL"
, but there is no LICENSE
file in the repository. Please add one and clarify, whether the license is "GPL v2 only", "GPL v2 or later" or "GPL v3 or later".
Great job, thanks!
Please, add implement multiupload form into inline group and set loading or linking to FK in post_save function of FK object (gallery). It would be great to load files before saving first time.
Thanks.
django==1.6.8
django-autocomplete-light==2.0.3
class RentalAdmin(MultiUploadAdmin):
form = autocomplete_light.modelform_factory(Rental)
in console log:
TypeError: $(...).yourlabsWidget is not a function
$(this).yourlabsWidget();
It would reduce the number of confused emails I get from clients if parts of the UI were hidden or disabled when they weren't relevant.
About the only element that should always be active is the green 'Add Files'. All the other buttons plus the top 'toggle' checkbox are often irrelevant and should be disabled to make this clear.
make urlpatterns work with django 1.10
Hello,
I've done every task you said to install django-multiupload, but nothing happend. Could you help me, or show me code to implement this please ?
Thank you in advance !
Does the Title field work? How can I make it work when I type in a name into Title field and press Upload it will save it with the file?
Hi,
This module works almost perfectly except when a large (>3MB) image is selected, no thumbnail is shown.
There some deep changes in admin in Django 1.7 as well as json not bundled.
Hello,
Would like to tell you that's great multiupload.
It works on the iphone and ipad but with 1 problem, it recognizes each photo with name "image", so when you select 10 photos all are named 'image' and then when you upload them it rewrites the same file so you have 10x same images.
Thank you.
Great job
I found out why the upload was failing on 1.11.4
Error is "SyntaxError: Unexpected token < in JSON at position 0" because response is not a json but it is surrounded by <html><body>
On the line 220 here and line 236 it makes no sense, you have not used content_type = "text/html", I have removed it and it started working.
https://github.com/gkuhn1/django-admin-multiupload/blob/master/multiupload/admin.py
`content_type = "application/json"
# QUIRK HERE
# in jQuey uploader, when it falls back to uploading
# using iFrames
# the response content type has to be text/html
# if json will be send, error will occur
# if iframe is sending the request, it's headers are
# a little different compared
# to the jQuery ajax request
# they have different set of HTTP_ACCEPT values
# so if the text/html is present, file was uploaded
# using jFrame because
# that value is not in the set when uploaded by XHR
if "text/html" in request.META["HTTP_ACCEPT"]:
content_type = "text/html"
content_type = "text/html"`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.