Hi glenn, I have read the two above links multiple time could couldn't figure out the problem unfrotunately.
You can see some of the configurations:
(mobileenv) 21:50 ~/mobiletilbud (main)$ nano ../.virtualenvs/mobileenv/bin/postactivate
(mobileenv) 21:51 ~/mobiletilbud (main)$ python -i /var/www/www_mobiletilbud_dk_wsgi.py
>>> import mobiletilbud.settings
>>> print('\n'.join(sys.path))
/home/faisalakhlaq/mobiletilbud
/var/www
/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python38.zip
/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8
/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/lib-dynload
/usr/lib/python3.8
/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages
/home/faisalakhlaq/mobiletilbud
>>> exit()
(mobileenv) 21:53 ~/mobiletilbud (main)$ cat ../.virtualenvs/mobileenv/bin/postactivate
#!/bin/bash
# This hook is sourced after this virtualenv is activated.
set -a; source ~/mobiletilbud/.env; set +a
(mobileenv) 21:53 ~/mobiletilbud (main)$ echo $SECRET_KEY
(mobileenv) 21:55 ~/mobiletilbud (main)$
echo secret_key give nothing. I am trying to loaddata to the database and here is what I get.
(mobileenv) 21:55 ~/mobiletilbud (main)$ python manage.py loaddata datadump.json
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from
_command_line
utility.execute()
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 368, in execute
self.check()
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 392, in check
all_issues = checks.run_checks(
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/checks/model_checks.py", line 18, in check_all_mod
els
models = apps.get_models()
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/apps/registry.py", line 179, in get_models
self.check_models_ready()
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/apps/registry.py", line 141, in check_models_ready
raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
(mobileenv) 21:56 ~/mobiletilbud (main)$
And if I try to run the same command with Django-admin then this is shown
(mobileenv) 21:56 ~/mobiletilbud (main)$ django-admin loaddata datadump.json
Traceback (most recent call last):
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 368, in execute
self.check()
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/management/base.py", line 392, in check
all_issues = checks.run_checks(
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/core/checks/urls.py", line 35, in check_url_namespaces_
unique
if not getattr(settings, 'ROOT_URLCONF', None):
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/conf/__init__.py", line 83, in __getattr__
self._setup(name)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/conf/__init__.py", line 70, in _setup
self._wrapped = Settings(settings_module)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/site-packages/django/conf/__init__.py", line 177, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/home/faisalakhlaq/.virtualenvs/mobileenv/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mobiletilbud'
During handling of the above exception, another exception occurred:
Many thanks for any help in advance.