Accessing the website gives me Error 403 , it denies the access to it. Now I know what you meant when you said that setting django app for the first time is a pain.
Here is my apache2 error.log:
[Sat Jun 20 00:09:08.059177 2020] [authz_core:error] [pid 27955:tid 140025622669056] [client 80.6.211.165:59418] AH01630: client denied by server configuration: /home/anton/portfolio/venv/portfolio/wsgi.py
[Sat Jun 20 00:09:09.431907 2020] [authz_core:error] [pid 27955:tid 140025614276352] [client 80.6.211.165:59418] AH01630: client denied by server configuration: /home/anton/portfolio/venv/portfolio/wsgi.py
[Sat Jun 20 00:09:10.874735 2020] [authz_core:error] [pid 27955:tid 140025605883648] [client 80.6.211.165:59418] AH01630: client denied by server configuration: /home/anton/portfolio/venv/portfolio/wsgi.py
[Sat Jun 20 00:09:12.678584 2020] [authz_core:error] [pid 27955:tid 140025597490944] [client 80.6.211.165:59418] AH01630: client denied by server configuration: /home/anton/portfolio/venv/portfolio/wsgi.py
I copied the apache sites-available config file and made my own custom one django-project.conf were I added those settings:
Alias /static /home/anton/portfolio/static
<Directory /home/anton/portfolio/static>
Require all granted
</Directory>
Alias /media /home/anton/portfolio/media
<Directory /home/anton/portfolio/media>
Require all granted
</Directory>
<Directory /home/anton/portfolio/venv/portfolio>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /home/anton/portfolio/venv/portfolio/wsgi.py
WSGIDaemonProcess django_app python-path=/home/anton/portfolio python-home=/home/anton/portf$
WSGIProcessGroup django_app
My Project has the following structure:
Any help would be appreciated
EDIT: there is new trace back:
[Sat Jun 20 00:24:43.930132 2020] [core:notice] [pid 28238:tid 140135741098944] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jun 20 00:24:46.568074 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] mod_wsgi (pid=28241): Target WSGI script '/home/anton/portfolio/venv/portfolio/wsgi.py' cannot be $
[Sat Jun 20 00:24:46.568142 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] mod_wsgi (pid=28241): Exception occurred processing WSGI script '/home/anton/portfolio/venv/portfo$
[Sat Jun 20 00:24:46.568802 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] Traceback (most recent call last):
[Sat Jun 20 00:24:46.568888 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/portfolio/wsgi.py", line 16, in <module>
[Sat Jun 20 00:24:46.568894 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] application = get_wsgi_application()
[Sat Jun 20 00:24:46.568902 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in g$
[Sat Jun 20 00:24:46.568905 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] django.setup(set_prefix=False)
[Sat Jun 20 00:24:46.568912 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/lib/python3.6/site-packages/django/__init__.py", line 19, in se$
[Sat Jun 20 00:24:46.568916 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Sat Jun 20 00:24:46.568923 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 76, $
[Sat Jun 20 00:24:46.568926 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] self._setup(name)
[Sat Jun 20 00:24:46.568933 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 63, $
[Sat Jun 20 00:24:46.568936 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] self._wrapped = Settings(settings_module)
[Sat Jun 20 00:24:46.568942 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/home/anton/portfolio/venv/lib/python3.6/site-packages/django/conf/__init__.py", line 142,$
[Sat Jun 20 00:24:46.568954 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] mod = importlib.import_module(self.SETTINGS_MODULE)
[Sat Jun 20 00:24:46.568961 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
[Sat Jun 20 00:24:46.568964 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] return _bootstrap._gcd_import(name[level:], package, level)
[Sat Jun 20 00:24:46.568970 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Sat Jun 20 00:24:46.568976 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Sat Jun 20 00:24:46.568982 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
[Sat Jun 20 00:24:46.568988 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Sat Jun 20 00:24:46.568994 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Sat Jun 20 00:24:46.569001 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Sat Jun 20 00:24:46.569007 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Sat Jun 20 00:24:46.569024 2020] [wsgi:error] [pid 28241:tid 140135627290368] [remote 80.6.211.165:59620] ModuleNotFoundError: No module named 'portfolio'