I got this following error while running django project "ProgrammingError at /admin/ Table 'django_session' doesn't exist".
SOLUTION:
This error you will get, when you're not migrated the django model.
CODE:
import datetime from django.db import models import os from django.db import models def getFileName(request,filename): now_time=datetime.datetime.now().strftime("%Y%m%d%H:%M:%S") new_filename="%s%s"%(now_time,filename) return os.path.join('uploads/', new_filename) class Category(models.Model): name=models.CharField(max_length=150,null=False,blank=False) image=models.ImageField(upload_to=getFileName,null=True,blank=True) description=models.TextField(max_length=500,null=False,blank=False) status=models.BooleanField(default=False,help_text="0-Show,1-Hidden") created_at=models.DateTimeField(auto_now_add=True) def __str__(self): return self.name
python manage.py makemigrations
python manage.py migrate
After completing migrations create super user
python manage.py createsuperuser
SOLUTION:
pip install matplotlib
VIDEO GUIDE:
Post your comments / questions
Recent Article
- FieldError: Cannot resolve keyword 'id' into field in Django project
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
- ImportError: cannot import name 'url' from 'django.conf.urls' - Django Error
- How to Enable Virtualization in BIOS Security Settings in Intel Processors For Android Studio?
- Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it.
- AttributeError: 'NoneType' object has no attribute 'get_text' - Python
- ModuleNotFoundError: No module named 'openpyxl' - Python
Related Article