I am pretty new to Django and still learning it, but I have to create something like medium.com. I want to show posts to users according to their interests. I added an interests field with a checkbox in a sign-up form. And of course, I added a category to the Post model. So, how can I show (to logged-in users
Tag: django
Heroku app: ModuleNotFoundError: No module named ‘pwa’
I am trying to deploy my app to heroku and I keep getting this error even though when I run locally it works perfectly fine. I have added django-pwa==1.0.10 to my requirments.txt file also so that heroku installs the package. Here are my installed apps in settings.py: Here is my directory Not really sure what to do as I am
How can i pass a dynamic url to another url
Im new to Django. So, my problem is that i want my dynamic url like this: “2332” is the dynamic part to pass to this: urls.py: html file: the Problem is at the “link”. How can i pass the stuff that is in the url to the new url Answer Your view should pass it to the context when you
Django React Serving Together Page not found (404)
I develop an application using Django and React. I want to serving Django and React together. I create an build in react. I use it in Django. This is urls.py ; and views.py; When I run development server there is no any error but when ı want to go url directly ; http://www.x.com:8000/accounts I got page not found (404) error.
The view urlshort.views.page_redirect didn’t return an HttpResponse object. It returned None instead
I’m making a url shortener with django. I have a form that has a long_url attribute. I’m trying to get the long_url and add it to a redirect view with a HttpResponseRedirect. When I go to the link, it gives me The view urlshort.views.page_redirect didn’t return an HttpResponse object. It returned None instead. Does anyone know why this is happening?
How can I fix my REST view to PATCH and serialize updates to an ArrayField() in my model?
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: Below is my view that I use, the
Local Django server unresponsive when adding function scheduling
I am trying to schedule a function to run everyday using the Schedule library. My local Django server however hangs and becomes unresponsive during the system check after saving the schedules to my code. It is only when I remove the schedule code the system check passes and the server runs without problem. I have copied the example directly from
415 UNSUPPORTED MEDIA – API Post Javascript – Django
I am trying to create an API on my Django server but I am struggling to create a post method called by Javascript. This is my APIview class componentFrameAPI(APIView): And this is my post request on Javascript. I continue to receive a 415 error and I really don’t know what I am doing wrong. NOTE: The GET method works fine.
Update Query list in Django
I’m having a trouble on how can I automatically update my amount_unpaid when the time I updated my amount_paidcolumn. The result of amount_unpaid should be subtract my amount – amount_paid = amount_unpaid . The way I updated my data is using list like the code below, please check this out, Any help is much appreciated Thanks in advance. AttributeError: ‘QuerySet’
How to autofocus a Charfield in a Django ModelForm
In my django app I want to set focus to the first CharField (task) when the page loads. my models.py is and forms.py is I have tried adding the following widget in my CharField (in models.py): but it gives an AttributeError: module ‘django.db.models’ has no attribute ‘TextInput’ I have also tried adding the following to the ListForm class (in forms.py):