Showing posts with the label django

[FIXED] ModuleNotFoundError: No module named 'rest_framework' (tried many solutions but not working)

Issue I have encountered this error. ModuleNotFoundError: No module named 'rest_framework'…

[FIXED] Mongoengine: ConnectionError: You have not defined a default connection

Issue In my new Django project I set up a MongoDB database and use mongoengine module but I can'…

[FIXED] Creating function to call api for pagination is calling duplicate value int

Issue I am building a simple app in react and django in which I am accessing API and paginating …

[FIXED] sql query or django filter for string

Issue hello i need a query that search in database and return a row that has most similarity from s…

[FIXED] Django - how to specify a database for a model?

Issue Is there a way to specify that a model (or app, even) should only ever use one particular dat…

[FIXED] size date not saving in cartitem model but the product is saving.. Any solution how to save the size data also?

Issue views.py def add_to_cart(request, pk): variant = request.GET.get('variant') …

[FIXED] Django Model isn't migrating even after i saved and added app to installedApps

Issue from django.db import models from django.contrib.auth import get_user_model user = get_user_…

[FIXED] How to get field value in django Model?

Issue I have this code: class Book(models.Model): name = models.CharField(max_length=70) a…

[FIXED] Python Django use mysql function SHA2('pass',256)

Issue I am creating application in Django and now I want create table with username and password. R…

[FIXED] AttributeError at /customers/f0e85ace-438f-4c61-a129-6d5986e6f346/ 'customer' object has no attribute 'get'

Issue I have just started django and struggling to find error. It seems like get() method is not b…

[FIXED] Why the ListView not showing data in the template?

Issue I'm working on my first Django project (the final project for codecademy's Django cla…

[FIXED] model doesn't have migrations

Issue I am working on the Django model. I migrate all the files of the app, but it is showing me th…

[FIXED] Django: Validate file type of uploaded file

Issue I have an app that lets people upload files, represented as UploadedFiles . However, I want t…

[FIXED] Django models DateTimeField index on Date

Issue Is it possible to index only the date aspect of a models.DateTimeField in Django? I cant se…

[FIXED] How to test model labels in Django?

Issue I have the following model.py from django.db import models class Url(models.Model): sho…

[FIXED] What's the difference between select_related and prefetch_related in Django ORM?

Issue In Django doc, select_related()

[FIXED] django import ipdb; ipdb.set_trace(); still want to run debugger even if commented. WHY?

Issue Ihave problem with IPDB. I comment out it after I do not use it but after I run the web page …

[FIXED] Ipdb not showing output with Django nose tests

Issue I'm running the most recent version of ipdb 0.10.0 and when I run the my django test suit…

[FIXED] ipdb is triggering ImportError

Issue ipdb is triggering an import error for me when I run my Django site locally. I'm working…

[FIXED] Send sms at a specific date and time in flask-restful?

Issue I have an API using flask restful that stores user information like mobile number,message,dat…