pars in the django app I have made under INSTALLED_APPS within settings.py
When i run this python script directly from bash that includes:
#below 5 lines to run scripts 'standalone' in django
import django
from django.conf import settings
from pars import pars_defaults
settings.configure(default_settings=pars_defaults, DEBUG=True)
django.setup()
from pars.models import tb1, tb2
technologytitle=soup.find("h1").text
try:
technology=CMS(nm=technologytitle)
technology.save()
print("saved techology: {}".format(technologytitle))
except IntegrityError as e:
print("Integrity error occurring with saving: {} {}".format(technologytitle, e))
UPDATED Im getting an error of:
ModuleNotFoundError: No module named 'pars'
ive done a ton of research, but cant seem to figure out why this is happening.
UPDATED: settings.py
#code before
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'pars',
]
ROOT_URLCONF = 'secenumproject.urls'
WSGI_APPLICATION = 'secenumproject.wsgi.application'
directory structure:
secenumproject/
settings.py
# etc
secenumproject/pars
models.py
parse.py
# etc
Thanks