How to use 'django import request' in Python

Every line of 'django import request' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
59@view_config(route_name=Tag.get_action_routename('import'),
60 renderer='/default/import.mako',
61 permission='import')
62def myimport(request):
63 return import_(Tag, request)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

293def import_form(request):
294 logger.info("__ input_forms import_form __")
295 if request.method == "POST":
296 json_file = request.FILES['file']
297 json_string = json_file.read()
298 json_data = json.loads(json_string)
299
300 template_options = json_data["template"]
301 form_options = json_data["form"]
302
303 template = ConfigTemplate()
304 template.name = template_options["name"]
305 template.description = template_options["description"]
306 template.action_provider = template_options["action_provider"]
307 template.action_provider_options = template_options["action_provider_options"]
308 template.type = template_options["type"]
309 template.template = unquote(template_options["template"])
310
311 template.save()
312
313 input_form = InputForm()
314 input_form.name = form_options["name"]
315 input_form.description = form_options["description"]
316 input_form.instructions = form_options["instructions"]
317 input_form.json = unquote(form_options["json"])
318 input_form.script = template
319
320 input_form.save()
321
322 return HttpResponseRedirect("/input_forms")
323 else:
324 form = ImportForm()
325 context = {'form': form}
326 return render(request, 'input_forms/import.html', context)

Related snippets