Hi guyes!
Now I'm trying to install django framework and make python-based web. For this purpose, I installed apache2, python3.8.5 and libapache2-mod-wsgi-py3, and set a virtual host according to the django guide document. My work flow was like the following.
1. apt install apache2 apache2-dev libapache2-mod-wsgi-py3
2. apt install build-essential net-tools curl git software-properties-common python3
3. configured virtual host according to django guide document.
4. On my local account, I created virtualenv my domain under /var/www directory.
5. And I installed django, create django_app project like this "django-admin startproject django_app .".
6. And migrate my django project.
7. Next I browsed my site enagape.net, but I encountered the following errors.
mod_wsgi (pid=5672): Failed to exec Python script file '/var/www/enagape.net_git/django_app/wsgi.py'.
mod_wsgi (pid=5672): Exception occurred processing WSGI script '/var/www/enagape.net_git/django_app/wsgi.py'.
Traceback (most recent call last):
File "/var/www/enagape.net_git/django_app/wsgi.py", line 18, in <module>
application = get_wsgi_application()
File "/usr/lib/python3/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/lib/python3/dist-packages/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/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 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django_app'
Help me.
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/de43f585-89e1-42c6-bc88-f518fa5d7fd1n%40googlegroups.com.
No comments:
Post a Comment