I want User to be able to Earn from my website immediately they add a post on the website but am finding it difficult to add that feauture to my apps. I want an amount to be added to my website immediately a post is submitted. Please take a good look at my code* The ..
Category : django-views
I’m getting Noreverse match error for sports_detail when i click on category, What i’m doing is when i click on category all posts related mapped to that category will get render on sport_category page using List view. What i’m not getting is why i’m getting Noreverse match error for sports_details. Same thing i did for ..
after a long time of being able to always find my answers on here, I now need to actually ask my first question… I’m working on a form which takes an instance of a modal, loads it in there (is what it should do) after which the user can edit the contents and resave the ..
I have an autocomplete dropdown list that uses the list of cities from my database. I am using django-cities. I want to be able to display it as (city.name , city.country.name) in my HTML. But it says that city is a string. Could someone explain to me why in my destination_form.html that {{ city }} ..
I am having issue with setting up static_root ,i m using django 3.1, And trying to deploy my project on heroku server. so when i try to create new superuser by heroku run python manage.py createsuperuser then it returns following traceback. Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", ..
I am building chat app and I am using Django Version 3.8.1. I am stuck on Error. This view is for Chat with friend private. views. def chat_friend(request, pk): # Chat info friend = get_object_or_404(User, pk=pk) chat_box = ChatBox.objects.filter( user_1=request.user, user_2=friend).first() if not chat_box: chat_box = ChatBox.objects.filter( user_1=friend, user_2=request.user).first() for message in Message.objects.filter(Q(is_read=False), ~Q(message_sender=request.user)): message.is_read ..
get error when use this df = pd.read_csv(‘filename.csv’, usecols=[1,5,7]) return Response(df.to_json(),status=status.HTTP_200_OK) Source: Python..
I have a view that is used to update a field in my model. It’s represented as follows: stock_list = ArrayField(models.CharField()) Each value in the ArrayField is separated by commas. I used a custom serializer method to allow for my backend to separate the elements in my PATCH obj by commas. serializers.py: class StringArrayField(ListField): """ ..
can i please get an help in what i’m doing wrong? i have a boolean field in which i want when a user clicks on it, it updates in the database, but i can’t achieve my aim. my code is below for better understanding models.py class OrderItem(models.Model): designer_size = models.ForeignKey("Frame_Sizes_Designer", on_delete=models.CASCADE, blank=True) ***** class Frame_Sizes_Designer(models.Model): ..
The code below is getting error AttributeError: ‘WSGIRequest’ object has no attribute ‘request’. I want to reOrder the position of objects using JQuery sortable.js Drag and drop. the drag and drop frontend is working fine but when my code try to save the object position i’m getting the error ‘WSGIRequest’ object has no attribute ‘request’. ..
Recent Comments