Have you experienced the thing I have done like the following.
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 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 "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 961, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", 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+unsubscr...@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.
Re: Have you experienced the thing I have done like the following.
Yes, I did. It's work fine. 2021년 3월 26일 금요일 오후 11시 37분 8초 UTC+9에 mr.xof...@gmail.com님이 작성: > Are you running your manage.py runserver command in right directory > > On Fri, 26 Mar 2021, 19:06 Sangbom Suhk, wrote: > >> 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 >> 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 "", line 1014, in _gcd_import >> File "", line 991, in _find_and_load >> File "", line 961, in >> _find_and_load_unlocked >> File "", line 219, in >> _call_with_frames_removed >> File "", line 1014, in _gcd_import >> File "", line 991, in _find_and_load >> File "", 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...@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 >> >> <https://groups.google.com/d/msgid/django-users/de43f585-89e1-42c6-bc88-f518fa5d7fd1n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3d67ce5c-79a6-4405-8081-f83b873f54a4n%40googlegroups.com.
Re: Have you experienced the thing I have done like the following.
Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). March 26, 2021 - 23:48:29 Django version 3.1.7, using settings 'django_app.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. 2021년 3월 26일 금요일 오후 11시 43분 19초 UTC+9에 Sangbom Suhk님이 작성: > Yes, I did. It's work fine. > > 2021년 3월 26일 금요일 오후 11시 37분 8초 UTC+9에 mr.xof...@gmail.com님이 작성: > >> Are you running your manage.py runserver command in right directory >> >> On Fri, 26 Mar 2021, 19:06 Sangbom Suhk, wrote: >> >>> 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 >>> >>> 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 "", line 1014, in _gcd_import >>> File "", line 991, in _find_and_load >>> File "", line 961, in >>> _find_and_load_unlocked >>> File "", line 219, in >>> _call_with_frames_removed >>> File "", line 1014, in _gcd_import >>> File "", line 991, in _find_and_load >>> File "", 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...@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 >>> >>> <https://groups.google.com/d/msgid/django-users/de43f585-89e1-42c6-bc88-f518fa5d7fd1n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b99f9960-be50-46cb-bf4f-916b8d4b3364n%40googlegroups.com.
Re: Have you experienced the thing I have done like the following.
My wsgi.py content is like this """ WSGI config for django_app project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application """ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_app.settings') """ os.environ["DJANGO_SETTINGS_MODULE"] = "django_app.settings" application = get_wsgi_application() 2021년 3월 27일 토요일 오전 9시 9분 25초 UTC+9에 Kasper Laudrup님이 작성: > On 26/03/2021 13.34, Sangbom Suhk wrote: > > ModuleNotFoundError: No module named 'django_app' > > > > Without being an expert on the details, it seems like the WSGI module > cannot find your Django application. > > What's in your .wsgi file? > > Maybe this could help: > > > https://www.thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/ > > Kind regards, > > Kasper Laudrup > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/84a7f5f1-78d5-4e2c-a459-cd182e53a614n%40googlegroups.com.
Re: Have you experienced the thing I have done like the following.
Huray I resolve my problem! I found the solution from googling. https://stackoverflow.com/questions/24122175/django-mod-wsgi-exception-occurred-processing-wsgi-script Thanks. 2021년 3월 27일 토요일 오후 12시 51분 11초 UTC+9에 Sangbom Suhk님이 작성: > My wsgi.py content is like this > > """ > WSGI config for django_app project. > > It exposes the WSGI callable as a module-level variable named > ``application``. > > For more information on this file, see > https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ > """ > > import os > > from django.core.wsgi import get_wsgi_application > """ > os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_app.settings') > """ > os.environ["DJANGO_SETTINGS_MODULE"] = "django_app.settings" > > application = get_wsgi_application() > > 2021년 3월 27일 토요일 오전 9시 9분 25초 UTC+9에 Kasper Laudrup님이 작성: > >> On 26/03/2021 13.34, Sangbom Suhk wrote: >> > ModuleNotFoundError: No module named 'django_app' >> > >> >> Without being an expert on the details, it seems like the WSGI module >> cannot find your Django application. >> >> What's in your .wsgi file? >> >> Maybe this could help: >> >> >> https://www.thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/ >> >> >> Kind regards, >> >> Kasper Laudrup >> >> -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e3fb0d83-7a76-4e2b-be6f-9f585e5dbcban%40googlegroups.com.