+
+
+# =========
+# = Admin =
+# =========
+@login_required
+@staff_required
+def import_book(request):
+ """docstring for import_book"""
+ book_import_form = forms.BookImportForm(request.POST, request.FILES)
+ if book_import_form.is_valid():
+ # try:
+ book_import_form.save()
+ # except:
+ # return HttpResponse("Error importing book: %r" % (sys.exc_info(),))
+ return HttpResponse("Book imported successfully")
+ else:
+ return HttpResponse("Error importing file: %r" % book_import_form.errors)
\ No newline at end of file