What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-07 02:50:30
style django forms with crisp
{% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <form method="post"> {% csrf_token %} {{ form|crispy }} <button type="submit" class="btn btn-primary">Sign in</button&g... Add solution -
Html 2022-02-03 07:26:23
working with multiple html forms django
# views.py def _get_form(request, formcls, prefix): data = request.POST if prefix in request.POST else None return formcls(data, prefix=prefix) class MyView(TemplateView): template_name = 'mytemplate.html' def get(self, request, *args, *... Add solution -
Html 2021-11-13 14:14:21
how to send the data through url in html without using the form
<!DOCTYPE html> <html> <body> <form id="myform" method="post" action="/"> {% csrf_token %} <input type="hidden" name="flag" value="2"... Add solution -
-
Python 2021-10-19 06:21:09
django deleteview class
##### views.py ##### from django.urls import reverse_lazy from django.views.generic.edit import DeleteView from myapp.models import Author class AuthorDelete(DeleteView): model = Author success_url = reverse_lazy('author-list') ##### author_... Add solution -
-
Python 2021-10-02 08:32:05
django start python function when pressing button
index.html <form method="post"> {% csrf_token %} <button type="submit" name="run_script">Run script</button> </form> views.py if request.method == 'POST' and 'run_script' in request.POST: ... Add solution