Apr-19-2023, 11:10 AM
(sorry for the Google translator)
os Ubuntu 20.04 lts server x64
What is done:
mkdir django & cd django
. env/bin/activate
test project django created
~/django/test_site/test_site
created ~/django/test.py
upstream django {
server 127.0.0.1:8000;
}
server {
......
location = / {
proxy_pass http://127.0.0.1:8000;
}
execute
:~/django$ uwsgi --http :8000 --wsgi-file test.py
OK. i seе "Hello World"
Further, any attempts to connect the test project and uwsgi were unsuccessful
1. everywhere indicated for testing: uwsgi --http :8000 --module mysite.wsgi
but I don't have such file mysite.wsgi, I only have ~/django/test_site/test_site/wsgi.py !!!
2. It seems to me that this file (wsgi.py) is not correct by default. What else should be there?
3. Accordingly, if i use the ini file for uwsgi, what is there to indicate? example from here from here
does not clarify this question.
4. And I haven't tried sockets yet!
And most importantly: run for tests from a virtual environment or not? Is the virtual environment necessary only for development apparently?
os Ubuntu 20.04 lts server x64
What is done:
mkdir django & cd django
. env/bin/activate
test project django created
~/django/test_site/test_site
created ~/django/test.py
def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"] # python3nginx:
upstream django {
server 127.0.0.1:8000;
}
server {
......
location = / {
proxy_pass http://127.0.0.1:8000;
}
execute
:~/django$ uwsgi --http :8000 --wsgi-file test.py
OK. i seе "Hello World"
Further, any attempts to connect the test project and uwsgi were unsuccessful

1. everywhere indicated for testing: uwsgi --http :8000 --module mysite.wsgi
but I don't have such file mysite.wsgi, I only have ~/django/test_site/test_site/wsgi.py !!!
2. It seems to me that this file (wsgi.py) is not correct by default. What else should be there?
3. Accordingly, if i use the ini file for uwsgi, what is there to indicate? example from here from here
does not clarify this question.
4. And I haven't tried sockets yet!
And most importantly: run for tests from a virtual environment or not? Is the virtual environment necessary only for development apparently?