No
I have a number of crontab scripts that run outside of py4web to do various tasks. Automated reporting, notifications, synchronizing data, etc.
They all use the same database and I'm too lazy to maintain the models file in 2 separate places.
I may have figured it out.
I created a setup.py file in my apps directory and then ran
---
python3 setup.py sdist
pip3 install --upgrade dist/my_app_name-0.1.tar.gz --user
---
This installed the app as a package. Now I can:
---
jim@pop-os:~/dev/py4web/apps$ python3
Python 3.8.6 (default, Jan 27 2021, 15:42:20)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from my_app_name.lib.administration import AuthUser
>>> AuthUser.update_user_names()
---
My setup.py looks like this:
---
from setuptools import setup
setup(
name="my_app_name",
version="0.4",
description="My App",
url="my_github_repo_link",
author="My Name",
author_email="my email",
license="MIT",
packages=["my_app_name"],
include_package_data=True,
install_requires=[
"dominate",
"fdfgen",
"googlemaps",
"jinja2",
"lxml",
"openpyxl",
"paramiko",
"pycrypto",
"pypyodbc",
"pymysql",
"pypdf2",
"pysftp",
"pysmb",
"python-dateutil",
"reportlab",
"xlsxwriter",
"xlrd",
"xlwt",
"zeep",
],
zip_safe=False,
)
---
So, maybe I have it working...
-Jim