What do you want to save?
Add Code snippet
New code examples
-
Python 2021-08-31 08:49:02
django update replace regex
>>> from django.db.models import Value >>> from django.db.models.functions import Replace >>> Author.objects.create(name='Margaret Johnson') >>> Author.objects.create(name='Margaret Smith') >>> Author.objects.u... Add solution -
Python 2021-08-30 16:05:01
autoslugfield django 3
# models.py from django.db import models from django_extensions.db.fields import AutoSlugField class MyModel(models.Model): title = models.CharField(max_length=42) slug = AutoSlugField(populate_from=['title', 'description', 'get_author_name']) Add solution -
Python 2021-08-28 05:43:01
how to connecct id's in the models of jdango
from django.db import models # Create your models here. class Contact(models.Model): name = models.CharField(max_length=50) email = models.CharField(max_length=50) contact = models.CharField(max_length=50) content = models.TextField() ... Add solution -
Python 2021-08-28 00:14:01
python date range widget
from django import forms from bootstrap_daterangepicker import widgets, fields class DemoForm(forms.Form): # Date Picker Fields date_single_normal = fields.DateField() date_single_with_format = fields.DateField( input_formats=['%d/%m... Add solution -
Python 2021-08-27 22:41:02
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: auth
# foo/apps.py #### #The problem is that with the changes to apps in Django 1.7, apps are required to have a unique label. #By default the app label is the package name, so if you've got a package with the same name as one of your app modules (foo in this... Add solution -
Python 2021-08-27 16:54:01
django forbidden (csrf cookie not set.)
# Error: forbidden (csrf cookie not set.) # ------------------------- SOLUTIONS ----------------------------- # 1º - In your views.py file: def funtion(request): var = request.POST['name_from_element'] #instead of GET ... 2º -... Add solution -