Category "django"

How can I get .vscode folder and settings.py file on my django project

I was following a tutorial on django . The tutor was using Mac OS he got the .vscode folder and settings.py in json But I can’t access that on my windows

How to run Django admin site on Android

This is what am facing with with Django on my Android I'm using Pydroid on my phone. Python and Django are fully functional. But when I try to run Django admin

Why can't I save a custom field to another table?

I'm trying to follow this tutorial: https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html concerning h

Adding Flutterwave in to django template and view

I have created flutterwave developer account, as you can see down here i have setup everything except template and views.py file settings.py file FLUTTERWAVE_SE

Django can't save userprofile instance during saving forms

I am getting this error Cannot assign "<QuerySet [<UserProfile: UserProfile object (131)>]>": "BlogComment.userprofile" must be a "UserProfile" ins

Object is not subscriptable python error django

I have this function where i am using models 'Start' and 'End' that contain fields latitude and longitude.. and I am trying to match them with a field called el

Python PIL save method rotates image

I have a little issue with saving image with PIL. In my Django project I have the following save method: from PIL import Image class Photo: image = models.

how to get json object out of django paginator value

am trying to get a Json value out of Django Paginator object so that i can return it back to html file as a json response via JsonResponse method.Please help He

Django rest framework jwt {"detail": "You do not have permission to perform this action."}

I am trying to make a request using django-rest-framework and django-rest-framework-jwt but The response that I get detail": "You do not have permission to perf

Update array of ManyToMany field in Django REST framework

I have a Model Plot which looks like this: from django.db import models class Plot(models.Model): class SUNSHINE(models.TextChoices): NONE = N

How do I fix the error of my django form not having cleaned_data attribute?

I have this form: class RegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ["username", "emai

How to filter a Django model to display only the logged-in user's data?

Trying to solve this for a week now. How do I filter my model to display only the data assigned to the specific logged-in user? My views.py code below is not wo

How to create sitemap with dynamic sub sitemap structure in django?

I'm trying create a dynamic generate sitemap in django and i hit the wall. Action I'm trying to code: in url.py i have url: re_path(r'sitemap-jobs.xml$'...) the

CSS not loading properly when html element appended using jquery in django template

I'm working on an ecommerce app where trying to get products using ajax and append the product list using .append method and data is being appended the problem

Why the html custom form is not working django

I have a contact page with a simple form. Here is views.py: def contact_view(request): if request.method == 'GET': form = ContactForm() else: form = Con

Django unable to serve static files from s3 bucket

I created a few models and pushed my project to a development server on an AWS EC2 instance. I used Django storages and followed the docs to configure my settin

Rendering database data to browser in Django

I am having difficulties with showing database data in browser with Django. I have, for show my issue, just one date in my database. When I go to the Django She

Django: How to return an inline formset with errors

I have created a form to sign up a user by having them create a User object and a UserProfile object as follows: class UserCreationForm(UserCreationForm): c

How to have multiple one to one relations to a specific model

I have a scientific info model that has a one-to-one relationship to my User model. this is my model: class ScientificInfo(models.Model): id = models.AutoFi

How to delete multiple records from different classes in django?

It seems that whenever I run it and delete records I get server error (500) but it deletes the the data of class Bscs1_1 but for the rest of the classes it does