Category "django"

saving data into two tables at the same time with a single form

I would like to save data in two tables at the same time using a single form in Django. Any help would be appreciated. class Category(models.Model): name =

I can't display data from database on web page using Python and Django

I have a big problem. I want to display data from my database( SQLite) on a webpage( the data should be present in an HTML table). I have checked my request wit

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

Inherinting Django SetUpTestData method called for each child

Inheriting a mother class make its classmethod setUpTestData called for each child class. This is what I excepted but not what I want. Here is a minimalist exam

Route53 DNS issue with Django Elastic Beanstalk app

Not sure what I am doing wrong here. My zone is public and I have simple routing for the A records pointing to the EB alias. I even tried a CNAME to no avail. B

Route53 DNS issue with Django Elastic Beanstalk app

Not sure what I am doing wrong here. My zone is public and I have simple routing for the A records pointing to the EB alias. I even tried a CNAME to no avail. B

How to filter choices in Django2's autocomplete_fields?

In Django 2.0, autocomplete_fields was added, which is great. Without autocomplete_fields, I can change the queryset of a ForeignKeyField using formfield_for_f

django.db.utils.IntegrityError: NOT NULL constraint failed after reseting migrations

I need to save an object that contains a file and some other data. Although the file is stored on the /media folder, the entity is not saved in the database sin

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Here's my settings.py: INSTALLED_APPS = [ 'rest_framework', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'd

Django Model Field for html5 Range Slider

I'm looking for a Django Model Field to render a HTML5 range slider like: <input type="range" min="1" max="100" value="50"> This question comes close to

A MultiSelectField with a select2 widget is not properly working for EDIT in Django

I have a form I am trying to understand its behaviour in Django. The form code looks like : class RequestForm(forms.ModelForm): TIMEPOINTS = (

Private Object Field in Django Admin

I'm wondering what the best way to have an editable field (by admins) for some object in Django admin that can't be viewable on the public site. For example, a

How to restart Dramatiq in Windows on code update or server restart?

I am using Django-Dramatiq with Dramatiq and RabbitMQ. I have it all working, but I am not sure the proper way to deploy to a Windows Server. If the server re

'RegisterAPI' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method

I am trying to display a register_view here and I'm getting the error. I have made some changes to the views fil,e but i am still getting the errors and i don't

Not all files called with django static appear

I have index.html file in template file and I have js, css, image, files in my static file. I am writing the codes correctly, but the site does not appear prope

Issue with Django logout URL redirection

I have configured login and logout redirect setting in Django settings as below - LOGOUT_REDIRECT_URL = '/login/' LOGIN_REDIRECT_URL = '/locations/' However,

django ajax project- basket - collecting values in array

in my Django store I have a basket which in views.py has the class: class BasketAddView(View): def post(self, request, *args, **kwargs): basket = B

PasswordResetDoneView not using custom template in Django

PasswordResetDoneView.as_view is not loading custom template I'm using Django 2.2 version I have created a custom template and add the path to accounts app url

Django Not Found: /assets/js/main.js How Can I Solve this?

This is the error I am facing Not Found: /assets/vendor/venobox/venobox.css Not Found: /assets/vendor/boxicons/css/boxicons.min.css Not Found: /assets/vendor/ow

Trying To Retrieve Name Instead of Primary Key, But Django Rest Framework complains of Value Error. If I try to fix it, I got other errors too

My Models: def upload_to(instance, filename): return 'images/{filename}'.format(filename=filename) class StreamPlatform(models.Model): name = m