mod_wsgi icon indicating copy to clipboard operation
mod_wsgi copied to clipboard

i can't run my project. i really need help please

Open EagleSeer opened this issue 2 years ago • 12 comments

Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\Mabel Aboagye\AppData\Local\Programs\Python311\Lib\threading.py", line 1038, in _bootstrap_inner self.run() File "C:\Users\Mabel Aboagye\AppData\Local\Programs\Python311\Lib\threading.py", line 975, in run self._target(*self.args, **self.kwargs) File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception() File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise exception[1] File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\core\management_init.py", line 394, in execute autoreload.check_errors(django.setup)() File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django_init
.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Mabel Aboagye\Downloads\Курсовая\myvenv\Lib\site-packages\django\apps\config.py", line 193, in create import_module(entry) File "C:\Users\Mabel Aboagye\AppData\Local\Programs\Python311\Lib\importlib_init
.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1142, in _find_and_load_unlocked ModuleNotFoundError: No module named 'modeltranslation'

EagleSeer avatar May 15 '23 03:05 EagleSeer

I would need to see what mod_wsgi configuration you use, the name of the full directory path you have your Django project in, and what parent directory path the modeltranslation package is under.

Usually the problem is you haven't told mod_wsgi where your Django project is. That is, you haven't set WSGIPythonPath as explained in https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/modwsgi/.

GrahamDumpleton avatar May 15 '23 03:05 GrahamDumpleton

BTW, it is a really bad idea to have a space anywhere in the directory path used for things as it can break stuff when not quoted or escaped properly. This is relevant as you have a space in your username of Mabel Aboagye.

GrahamDumpleton avatar May 15 '23 03:05 GrahamDumpleton

Ак для синхронных веб серверов и приложений

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ak_django_kurs.settings')

application = get_wsgi_application()

EagleSeer avatar May 15 '23 04:05 EagleSeer

That is not the mod_wsgi configuration, that is the Django wsgi.py file contents. I need to see what you put in the Apache configuration for mod_wsgi. That is, what you were guided by documentation at https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/modwsgi/#basic-configuration to use. I still also need to see those directory paths I asked about.

GrahamDumpleton avatar May 15 '23 04:05 GrahamDumpleton

Can i send the all project? I'm new with django and also a french speaker

EagleSeer avatar May 15 '23 04:05 EagleSeer

Sorry no, I would rather not have you posting full source code here against the issue as is generally a bad idea. That also wouldn't help anyway as the Apache configuration file is separate to your Django project source code. So please can you try and provide the snippet of configuration from the Apache configuration file instead.

By the way, have you used python manage.py runserver Django management command to test that your code runs before trying to host it with Apache.

GrahamDumpleton avatar May 15 '23 04:05 GrahamDumpleton

I'm trying to find, but I can't see it

Le lun. 15 mai 2023, 07:15, Graham Dumpleton @.***> a écrit :

Sorry no, I would rather not have you posting full source code here against the issue as is generally a bad idea. That also wouldn't help anyway as the Apache configuration file is separate to your Django project source code. So please can you try and provide the snippet of configuration from the Apache configuration file instead.

By the way, have you used python manage.py runserver Django management command to test that your code runs before trying to host it with Apache.

— Reply to this email directly, view it on GitHub https://github.com/GrahamDumpleton/mod_wsgi/issues/836#issuecomment-1547169221, or unsubscribe https://github.com/notifications/unsubscribe-auth/A73OW76VQKTMC2QDEN22CWTXGGUWTANCNFSM6AAAAAAYBTL4QY . You are receiving this because you authored the thread.Message ID: @.***>

EagleSeer avatar May 15 '23 04:05 EagleSeer

Looking again at your Python trace back, I can't see that you aren't even using Apache/mod_wsgi.

The error states:

Exception in thread django-main-thread

and also references:

django\core\management\commands\runserver.py

So you are using python manage.py runserver and not Apache/mod_wsgi.

I would suggest asking your question on StackOverflow or some other Django forum as doesn't look to be anything related to Apache/mod_wsgi.

GrahamDumpleton avatar May 15 '23 04:05 GrahamDumpleton

i didn't run it

EagleSeer avatar May 15 '23 04:05 EagleSeer

What are you doing then to run your Django application?

GrahamDumpleton avatar May 15 '23 04:05 GrahamDumpleton

I'm using python manage.py runserver

EagleSeer avatar May 15 '23 04:05 EagleSeer

Which is what I said above I suspected you were doing.

The problem you are having has nothing to do with Apache/mod_wsgi which is what this issue tracker is for.

I suggest you ask about the problems you are having on StackOverflow. You will find people there who are more familiar with Django.

GrahamDumpleton avatar May 15 '23 04:05 GrahamDumpleton