Hello, I need to solve this problem
When running python “update.workers.py” the error “ModuleNotFoundError > No module named ‘core’” is displayed
The name of my app is ‘core’
inside update.workers.py there is the following
//code//
from core.models import Workers
##To delete all workers
Workers.objects.all().delete()
##To create a worker
W=Workers.objects.create(code=‘0001’, name=‘Marcelino’)
W.save()
//end of code//
inside my models.py
//code//
from django.db import models
class Workers(models.Model):
code= models.PositiveIntegerField(primary_key=True, serialize=False,verbose_name=‘code’)
name= models.CharField(max_length=252, verbose_name=‘Full Name’)
def str(self):
return self.name
class Meta:
db_table = “workers”
verbose_name = “Worker”
verbose_name_plural = “Workers”
ordering = [“code”]
//end of code//
I have to say that my project runs without problems,
using python manager.py runserver
it opens my website and everything is fine
but when I try to run my update_workers.py it shows me that error