Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Problems of object grabbing
I want to add course.tutor.add(self.request.user) to the function below but don't know how to do that, because i don't know how to do without slug and so on class FormWizardView(SessionWizardView): template_name = 'courses/create_course.html' file_storage = FileSystemStorage(location=os.path.join(settings.MEDIA_ROOT,'courses')) form_list = (CourseForm1,CourseForm2,CourseForm3,CourseForm4) def done(self, form_list, **kwargs): instance = Course() for form in form_list: for field, value in form.cleaned_data.items(): setattr(instance, field, value) instance.save() return redirect('courses:my_courses',username=self.request.user.username) -
How to add request.session/user data to Postman POST?
A web request POST has request.user and request.session as the follows that was logged on server. It's easy to add parameters and body etc. How to add the request.session/user data (or simulate ?) to Postman POST? request.user: { id: 1061, username: jhon, name: 'jhon, smith' } request.session: {'case_id': 777, 'profile_id': u'101'} -
Connecting Serializers in Django 'int' object has no attribute 'split'
This is the first time I started working with APIs in Django, and I'm building a web app that processes a lot of changes very quickly. After much research, I decided to use serpy instead of the DRF for the serializers, but I'm having trouble connecting multiple serializers. I don't think this is a serpy issue, but just a general lack of knowledge of working with serializers in general. I have a Membership model and a Project model, and when I request the Project model, I want to see the active Memberships associated with that project. Pretty simple stuff right. Here are my serializers: ###################################################### # Memberships ###################################################### class MembershipSerializer(LightWeightSerializer): id = Field() user = Field(attr="user_id") project = Field(attr="project_id") role = Field(attr="role_id") is_admin = Field() created_at = Field() user_order = Field() role_name = MethodField() full_name = MethodField() is_user_active = MethodField() color = MethodField() photo = MethodField() project_name = MethodField() project_slug = MethodField() is_owner = MethodField() def get_photo(self, obj): return get_photo_url(obj['photo']) def get_role_name(self, obj): return obj.role.name if obj.role else None def get_full_name(self, obj): return obj.user.get_full_name() if obj.user else None def get_is_user_active(self, obj): return obj.user.is_active if obj.user else False def get_color(self, obj): return obj.user.color if obj.user else None def get_project_name(self, obj): return … -
No reverse match error on redirect (django)
I encountered a NoReverseMatch at /login Reverse for '' not found. '' is not a valid view function or pattern name. template <form action="" method="post"> {% csrf_token %} <input type="text" name="username" placeholder="Username"><br> <input type="password" name="password" placeholder="Password"><br> <input type="submit"> </form> views.py def loginuser(request): if request.method == 'POST': username = request.POST['username'] password = request.POST['password'] user = auth.authenticate(username = username,password=password) if user is not None: auth.login(request, user) return redirect(request,'home') else: messages.info(request,'Invalid username or password') return render(request,'login.html') urls.py from django.urls import path from accounts import views urlpatterns = [ path('', views.signup, name='signup'), path('login',views.loginuser,name='login'), path('logout',views.logout,name='logout'), path('home', views.home, name='home'), ] -
back-end architecture to integrate with Cube.js
I'm looking for advise choosing a back-end architecture for a web app. In the app, users upload tabular data from multiple files. Their data is then processed, aggregated and visualized. Data is private and each user has their own dashboard. I believe Cube.js is an excellent choice for the dashboard, but I am wondering what back-end web framework I should integrate it with. I have experience of Django, but would use Express if it had significant advantages. Thanks for any advice! -
I am getting the error below every time I run the code and I do not know what is wrong
I am getting the error below. Any help is appreciated. I am probably missing something very important from the documentation. Kindly point out my mistake if you see it and enlighten me about many to many relations from Django. From the error presented does it mean that the .add() function cannot be used on querysets? Traceback Internal Server Error: /7/ Traceback (most recent call last): File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\music\songs\views.py", line 141, in Playlist_Add playlist.song.add(song) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\fields\related_descriptors.py", line 926, in add self._add_items(self.source_field_name, self.target_field_name, *objs) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\fields\related_descriptors.py", line 1073, in _add_items '%s__in' % target_field_name: new_ids, File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 844, in filter return self._filter_or_exclude(False, *args, **kwargs) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 862, in _filter_or_exclude clone.query.add_q(Q(*args, **kwargs)) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\query.py", line 1263, in add_q clause, _ = self._add_q(q_object, self.used_aliases) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\query.py", line 1287, in _add_q split_subq=split_subq, File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\query.py", line 1225, in build_filter condition = self.build_lookup(lookups, col, value) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\query.py", line 1096, in build_lookup lookup = lookup_class(lhs, rhs) File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\lookups.py", line 20, in __init__ self.rhs = self.get_prep_lookup() File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\fields\related_lookups.py", line 59, in get_prep_lookup self.rhs = [target_field.get_prep_value(v) for v in self.rhs] … -
How to get primary key of recently created record in django not the latest one
id = request.session['user-id'] Forum.objects.create(user_id=id, forum_name=self.name,tags=self.tags, description=self.desc,reply=0,status=0) Tags.objects.create(forum_id='?', tag=self.tags) How to get forum_id from recently created Forum object not the latest one forum_id? -
django multi tenant app: login and urls mapping best pra
I am struggling with sign in my tenants into their schemas. the login system works well. my issue is in the URLs organization. I wish that user sign in in the public domain and then get redirect to their own domain but that if they directly try to access their domains, it raises an error saying that they are not logged in. Currently, what happens is that it runs into a circle and never change page. I am fairly new to this and I am was wondering if someone has an idea about best practices in urls mapping for multi tenant app. public urls: urlpatterns = [ path('register', registration), path('login', login_view) ] urls urlpatterns = [ path('upload', login_required(Getfiles.as_view())), path('upload/Home', HomeView.as_view()), path('upload/Home/items', ItemPage.as_view()), ] Thank you in advance -
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request
Angular 8, Django 3. I am unsure why I am getting this error ONLY with a certain angular component. My entire web application works fine and I am accessing the backend and pulling data in all parts of the app with the exception of one component that keeps throwing this error. I have disabled CORS, i have the chrome plugin disabling CORS, i have the corsheaders package installed with CORS_ORIGIN_ALLOW_ALL = True. this is the component: DashboardComponent export class DashboardRestaurantComponent implements OnInit { constructor( private authenticationService: AuthenticationService, private restaurantservice : RestaurantService ) { this.authenticationService.currentUser.subscribe(x => this.user = x) } user; restaurants; ngOnInit() { this.get_owner_restaurants() } get_owner_restaurants(){ this.restaurantservice.getownerrestaurants().subscribe(x => this.restaurants = x) } } RestaurantService getownerrestaurants(): Observable<Restaurant[]>{ return this.http.get<Restaurant[]>(this.ownerrestaurantsUrl2) } DjangoView class RestaurantList(generics.ListAPIView): serializer_class = RestaurantSerializer queryset = Restaurant.objects.all() In other parts of the app I am accessing the same DjangoView with no problem, I dont get why all of the sudden I am having an issue.. -
how to import and display csv file in django project
I have two different project and one of them is a django project . I want to import the csv file and display it in html template . but since I'm a beginner I read a lot of articles and none of them helped me ? -
Deploy Django website to alias on ubuntu 18.04
I have a django application that I need to deploy. The hosting server runs on Ubuntu 18.04. My problem is that I don't have a dedicated domain, but I need to "append" the app to a domain already in use (i.e. I have www.mydomain.com that contains my not-django reseach group website, and I need my django app to be available at www.mydomain.com/new-content). Now my problem is how to write/modify the file on /etc/apache2/sites-available/. For a normal site I would do: Alias /face-perception /var/www/new-content/ <Directory /var/www/new-content> Order allow,deny Allow from all Options -Indexes </Directory> But online guides suggest me to have a structure like the following: <VirtualHost *:80> ServerAdmin webmaster@mydomain.com ServerName mydomain.com ServerAlias www.mydomain.com WSGIScriptAlias / var/www/mydomain.com/index.wsgi Alias /static/ /var/www/mydomain.com/static/ <Location "/static/"> Options -Indexes </Location > </VirtualHost > Is there any way I can achieve this? I tried combining the two in different ways but always ended up with being unable to restart apache or with a 404 error. Ps: for now I am not considering the option to use a dedicated domain as trough my institution it requires time and we need the app online as soon as possible to work remotely. -
Using Boot Strap To Insert New Rows In Comment Section (Python - Django)
I tried to use <div class="row">after looking at the Bootstrap material but the comments still appeared to be rendering in a series of columns and not rows. <article class="media content-section"> <!-- comments --> <h2>{{ comments.count }} Comments</h2> {% for comment in comments %} <div class="row"> <div class="media-body "> <a class="mr-2" href="#">{{ comment.name }}</a> <small class="text-muted">{{ comment.created_on|date:"F d, Y" }}</small> </div> <p class="article-content">{{ comment.body }}</p> </div> {% endfor %} -
How to make a video chat in DJango?
I want to make an app in django to make video calls with it. I have searched a lot, but I didn't find any good source or any example for it. Is there any api that we can use for making video calls? Or how we can do this simply? I read about webRTC and 0MQ but I didn't get the whole idea how I can do this? Thank you in advance. -
Django view isn't called while performing an AJAX call
I'm trying to setup an AJAX call in order to call a Django view, perform some calculations and then return the ouput into my html page. Unfortunately, the view doesn't seem to be reached. Not sure what is wrong but I have very limited AJAX experience. The idea is that when my slider sees a change in value, it triggers the AJAX call. The trigger seems to work as it displays my alert pop-up. But that's it, nothing else happens. Could you please help? Here is my html/AJAX code: <div class="slider-wrapper"> <span>Option 1 Imp. Vol.</span> <input class="toChange" id="rangeInput" name="rangeInput" type="range" value="{{Sigma}}" min="0" max="150" step="0.1" oninput="amount.value=rangeInput.value" /> <input class="toChange" id="amount" type="number" value="{{Sigma}}" min="0" max="150" step="0.1"oninput="rangeInput.value=amount.value" /> </div> <label>Ajax Test:</label> <span id="Atest"> <script type="text/javascript"> function inputChange () { var Sigma = document.getElementById("rangeInput").value; alert(); $.ajax({ url: '/finance/templates/optionstrategies/', type: 'POST', data: {'Sigma': Sigma, }, //dataType: "json", success: function(optionVal) { document.getElementById("Atest").innerHTML = optionVal; } }); } $(".toChange").change(inputChange); </script> And here is my view.py: def optionStrategies(request): errors='' if request.method == 'POST' and request.is_ajax(): print('ok') Type = request.POST.get('Type') V = request.POST.get('V') Q = request.POST.get('Q') S = request.POST.get('S') K = request.POST.get('K') r = request.POST.get('r') t = request.POST.get('t') Sigma = request.POST.get('rangeInput') BS = BlackScholes(Type = 'Vanilla', S = float(S), … -
Django redirect does nothing
I am currently try to redirect from one view to another view. However, nothing happens, the token gets printed and that's it. class SocialLoginInvUserAPIView(APIView): permission_classes = [AllowAny] @staticmethod def post(request): print(request.data["token"]) return redirect("login/") Here is the login url: url(r'login/$', LoginInvUserAPIView.as_view(), name='auth_user_login'), -
Django - Filtering Field In DeailView
Hi all, I've been building a Django app that allows users to stream and download music. However, there is one issue that I'm having with the artists profile pages; I'm trying to request the songs by the artist only in a DetailView as I'm treating it like a blog system. Is this possible in a DetailView? Or do I need to make a filter? I've been searching the web for days now and didn't really understand what I can do or how to get the specific data field from the model. Any help or guidance would be highly appreciated! class musicartist(DetailView): model = MusicArtist template_name = 'RS_MUSIC/artist.html' # override context data def get_context_data(self, *args, **kwargs): context = super(musicartist, self).get_context_data(*args, **kwargs) # add extra field current_band = MusicItems.objects.all().filter(artist=MusicArtist.title)[:1] context["songs"] = MusicItems.objects.filter(artist=MusicArtist.objects.all().filter(title=current_band)[:1]) return context -
Django form submission without reloading page
I have a django register form .On the event of an invalid form submission, page is reloading.I need to stay on that same page if the data entered is invalid. -
making dynamic template of the dictionary passed to the django
I'm working on coc api in which i want to display player information on the webpage and there are lot's of field in the response i want to display the result dynamically when any dictionary passed to the template it should arrange itself views.py: token = 'token' timeout = 1 api = CocApi(token, timeout) data = api.labels_clans() def index(request): data = api.players("#PJVVUCCJG") return render(request,"index.html", data) tried to print hierarchically: code: from cocapi import CocApi def getall(dictn, lvl=0): sep = " " for key, item in dictn.items(): if isinstance(item, list): print(lvl * sep + key + ":") for it in item: getall(it, lvl=lvl+1) print("") continue if isinstance(item, dict): print(lvl * sep + key + ":") getall(item, lvl=lvl + 1) continue print(lvl * sep + str(key) + ":" + str(item)) token = 'token' timeout = 1 api = CocApi(token, timeout) data = api.players("#PJVVUCCJG") getall(dict(data)) print(len(data)) print(data) Output: tag:#2U2RCLYLL name:killer townHallLevel:10 expLevel:115 trophies:1165 bestTrophies:2826 warStars:178 attackWins:72 defenseWins:10 builderHallLevel:7 versusTrophies:2422 bestVersusTrophies:2444 versusBattleWins:509 role:coLeader donations:70 donationsReceived:953 clan: tag:#LLQ0CULQ name:Thê BèäTlës clanLevel:11 badgeUrls: small:https://api-assets.clashofclans.com/badges/70/exHkY8LEWfWyugWdyfVDCvns2J7TgIoUgurt6DUFg4Q.png large:https://api-assets.clashofclans.com/badges/512/exHkY8LEWfWyugWdyfVDCvns2J7TgIoUgurt6DUFg4Q.png medium:https://api-assets.clashofclans.com/badges/200/exHkY8LEWfWyugWdyfVDCvns2J7TgIoUgurt6DUFg4Q.png league: id:29000006 name:Silver League I iconUrls: small:https://api-assets.clashofclans.com/leagues/72/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png tiny:https://api-assets.clashofclans.com/leagues/36/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png medium:https://api-assets.clashofclans.com/leagues/288/nvrBLvCK10elRHmD1g9w5UU1flDRMhYAojMB2UbYfPs.png achievements: name:Bigger Coffers stars:3 value:11 target:10 info:Upgrade a Gold Storage to level 10 completionInfo:Highest Gold Storage level: 11 village:home name:Get those … -
After comand ACTIVATE django activates but shows only half name of the folder
My Django project is in folder Django-projects. When I activate it the folder name becomes in round bracket, but only in one in the begining please look at printscrin. enter image description here -
Django channels function gets stuck
I created a simple Consumer in Django channels that receives some JSON data from an external source and whenever it receives the data, the consumer will broadcast it to some groups. Here is my code: def websocket_receive(self, event): data = event['text'] print(data) def broadcast_data(event): channel_layer = channels.layers.get_channel_layer() async_to_sync(channel_layer.group_send)( 'MYGROUP', { "type": 'TEST', "content": event['text'], }) broadcast_data(event) print('received') The problem with this code is that, for some reason, after receiving the first record it will freeze and do nothing, sometimes it will print the first two. It's very weird because this same code worked until some days ago; also, none of these is a blocking operation (receive the data, print it and broadcast it), there are no connections pending or nothing else. If i remove broadcast_data(event), the code will work and it will keep printing every record every time a new one arrives, so i'm thinking that the problem is inside broadcast_data. Can anyone help me find what is happening here? -
How do I get a value from a database of an element that is linked to another one with foreign key?
I have these models that are linked with a foreign key class Student(models.Model): id_student = models.AutoField(primary_key=True) first_name = models.CharField(max_length=45) last_name = models.CharField(max_length=45) date_of_birth = models.DateField() nationality = models.CharField(max_length=45) gender = models.CharField(max_length=1) street_name = models.CharField(max_length=45) street_number = models.CharField(max_length=45) postal_code = models.CharField(max_length=45) city = models.CharField(max_length=45) phone = models.CharField(max_length=45) email = models.CharField(max_length=45) study_id_study = models.ForeignKey('Study', models.DO_NOTHING, db_column='study_id_study') start_year = models.CharField(max_length=45) teacher_id_teacher = models.ForeignKey('Teacher', models.DO_NOTHING, db_column='teacher_id_teacher', related_name = 'tcr_id') class Meta: managed = False db_table = 'Student' class Teacher(models.Model): id_teacher = models.AutoField(primary_key=True) first_name = models.CharField(max_length=45, blank=True, null=True) last_name = models.CharField(max_length=45, blank=True, null=True) date_of_birth = models.DateField(blank=True, null=True) nationality = models.CharField(max_length=45, blank=True, null=True) street_name = models.CharField(max_length=45, blank=True, null=True) street_number = models.CharField(max_length=45, blank=True, null=True) postal_code = models.CharField(max_length=45, blank=True, null=True) city = models.CharField(max_length=45, blank=True, null=True) phone = models.CharField(max_length=45, blank=True, null=True) gender = models.CharField(max_length=1, blank=True, null=True) salary = models.CharField(max_length=45, blank=True, null=True) study_counselor = models.CharField(max_length=45, blank=True, null=True) picture_url = models.CharField(max_length=45, blank=True, null=True) class Meta: managed = True db_table = 'Teacher' I wanted to get the name of the teacher depending on teacher_id_teacher that we have in Student model, and which is foreign key as well seems easy but I have been trying to do this for two days with no success, Thanks you so much :) -
Django REST framework Ajax call only works on the first call
The tutorial I am following has this code which works when the page is first loaded, and then it does not. I have read all other questions on "ajax call works the first time only", but could not find a relevant cause. Given that the code works when the page loads, I think there is a binding problem in the jQuery portion that prevents the button to act once it is changed on the first call, but I cannot pinpoint what that is. I also tried visiting the url end-point (REST framework end-point) and every time I refresh the page, the count does update correctly. So, the problem must be somewhere in the front-end since it can clearly find the URL and update the count once but fails to call ajax on subsequent clicks. <li> <a class="like-btn" data-href="{{ obj.get_api_like_url }}" data-likes='{{obj.likes.count}}' href="{{ obj.get_api_like_url }}"> {{obj.likes.count }} | {% for person in obj.likes.all %} {{ person.userprofile.first_name }} {% endfor %}<i class="fab fa-gratipay"></i> </a> </li> In my jQuery code: $(function(){ $(".like-btn").click(function(e) { e.preventDefault(); var this_ = $(this); var likeUrl = this_.attr("data-href"); console.log("likeUrl: ", likeUrl); var likeCount = parseInt(this_.attr("data-likes")) | 0 ; var addLike = likeCount; var removeLike = likeCount; if (likeUrl) { … -
Django rest framework handle duplicates
I am building an app where I use django as backend and react native as front end. Right now I am building a login component which provides Facebook and Google login and the data returned from their API's is stored in my local database trough DRF. The problem is that when a user signs out and log in again DRF creates another record with exactly the same info. Now, the question is should I handle this in the backend (and if yes how) or in the front end (here I know how, but I think its not a good idea) Here are my django model, view and serializer: class RegisteredUsers(models.Model): userId = models.CharField(max_length=256) user_name = models.CharField(max_length=256) user_mail = models.CharField(max_length=256) photo = models.CharField(max_length=256) def __str__(self): return self.user_name class RegisteredUsersViewSet(viewsets.ModelViewSet): queryset = RegisteredUsers.objects.all() serializer_class = RegisteredUsersSerializer def get_queryset(self): mail = self.request.query_params.get('user_mail', None) if mail: qs = RegisteredUsers.objects.all().filter(user_mail=mail) else: qs = super().get_queryset() return qs class RegisteredUsersSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = RegisteredUsers fields = ('userId', 'user_name', 'user_mail', 'photo') lookup_field='user_mail' extra_kwargs = { 'url': {'lookup_field': 'user_mail'} } how can I validate that this account already exists and just log in the user? -
How to enforce using a char(n) datatype instead of nvarchar in Django queries with django-mssql-backend
I am using, python 3.7, django 2.2 and django-mssql-backend with a legacy Microsoft SQL Server 2012 database. I have generated a model using inspectdb. The model has a field called “ord_no” which is a CHAR(8) datatype in the database. Django correctly creates it as a CharField(max_length=8). Note – There is an index for this table on the ord_no column. Here is the simplified table definition: CREATE TABLE [dbo].[imordbld_sql]( [ord_no] [char](8) NOT NULL, [item_no] [char](30) NOT NULL, [qty] [decimal](13, 4) NULL, [qty_per] [decimal](15, 6) NULL, [ID] [numeric](9, 0) IDENTITY(1,1) NOT NULL ) ON [PRIMARY] GO Here is my models.py with a simplified version of the model in question with fields auto-generated through inspectdb I've also created a custom model manager that converts the ord_no parameter into a CHAR(8) field for demonstration purposes. models.py from django.db import models class OrderBuildManager(models.Manager): """ Django automatically use nvarchar(16) instead of char(8) when using the ORM to filter by work order. This method casts the ord_no parameter to a char(8) so SQL can use an index on the ord_no column more efficiently (index seek vs index scan) """ def get_order(self, ord_no): qs = super(OrderBuildManager, self).get_queryset().extra( where=('ord_no = CAST(%s as CHAR(8))',), params=(ord_no,)) return qs class OrderBuild(models.Model): ord_no … -
'MultiValueDict' object has no attribute 'name'
I am using jQuery - Filer.js for file upload, when I upload any file it returns Error like "'MultiValueDict' object has no attribute 'name'" settings.py MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') fileupload.html <div class="card-block"> {% csrf_token %} <input type="file" name="files[]" id="filer_input1"> </div> views.py from django.shortcuts import render,redirect from django.http import HttpResponse, HttpResponseRedirect from django.core.files.storage import FileSystemStorage def StorePartyMappingIndex(request): return render(request,'storepartymapping.html') def StorePartyMappingfileupload(request): if (request.method == 'POST'): file = request.FILES fs = FileSystemStorage() fs.save(file.name,file) # Error line return HttpResponseRedirect('/mapping/fileupload') else: return render(request,'fileupload.html') jquery: $(document).ready(function(){ 'use-strict'; $("#filer_input1").filer({ limit: 2, maxSize: 3, extensions: ['csv', 'xlsx', 'xls'], changeInput: '<div class="jFiler-input-dragDrop"><div class="jFiler-input-inner"><div class="jFiler-input-icon"><i class="icon-jfi-cloud-up-o"></i></div><div class="jFiler-input-text"><h3>Drag & Drop files here</h3> <span style="display:inline-block; margin: 15px 0">or</span></div><a class="jFiler-input-choose-btn btn btn-primary waves-effect waves-light">Browse Files</a></div></div>', showThumbs: true, theme: "dragdropbox", templates: { box: '<ul class="jFiler-items-list jFiler-items-grid"></ul>', item: '<li class="jFiler-item">\ <div class="jFiler-item-container">\ <div class="jFiler-item-inner">\ <div class="jFiler-item-thumb">\ <div class="jFiler-item-status"></div>\ <div class="jFiler-item-info">\ <span class="jFiler-item-title"><b title="{{fi-name}}">{{fi-name | limitTo: 25}}</b></span>\ <span class="jFiler-item-others">{{fi-size2}}</span>\ </div>\ {{fi-image}}\ </div>\ <div class="jFiler-item-assets jFiler-row">\ <ul class="list-inline pull-left">\ <li>{{fi-progressBar}}</li>\ </ul>\ <ul class="list-inline pull-right">\ <li><a class="icon-jfi-trash jFiler-item-trash-action"></a></li>\ </ul>\ </div>\ </div>\ </div>\ </li>', itemAppend: '<li class="jFiler-item">\ <div class="jFiler-item-container">\ <div class="jFiler-item-inner">\ <div class="jFiler-item-thumb">\ <div class="jFiler-item-status"></div>\ <div class="jFiler-item-info">\ <span class="jFiler-item-title"><b title="{{fi-name}}">{{fi-name | limitTo: 25}}</b></span>\ <span class="jFiler-item-others">{{fi-size2}}</span>\ </div>\ {{fi-image}}\ </div>\ <div class="jFiler-item-assets jFiler-row">\ <ul class="list-inline pull-left">\ <li><span …