Please help me to set my home PC as a server (Windows 10 + Python + Django + Postgre SQL + Anaconda)
There are several instructions on how to set the server on the Internet, and surprisingly, many instructions differ from each other. I have absolutely no experience in setting a server. Probably, I’m making a stupid mistake somewhere that I can’t identify for 3 days. I am lost. I believe that most useful instructions are these (they are complete and new): https://www.codementor.io/aswinmurugesh/deploying-a-django-application-in-windows-with-apache-and-mod_wsgi-uhl2xq09e https://ostrokach.gitlab.io/post/apache-django-anaconda/
I followed the instructions and successfully downloaded the necessary modules, installed Wamp, made the changes as displayed in the guide and started it. What I see now: the Wamp icon glows green. When I load a localhost, the page loads endlessly but does not load.
Wamp error log shows following: [Fri Oct 11 14:50:33.823752 2019] [core:notice] [pid 1364:tid 808] AH00094: Command line: 'c:\wamp64\bin\apache\apache2.4.39\bin\httpd.exe -d C:/wamp64/bin/apache/apache2.4.39' [Fri Oct 11 14:50:33.840681 2019] [mpm_winnt:notice] [pid 1364:tid 808] AH00418: Parent: Created child process 15052 [Fri Oct 11 14:50:34.981629 2019] [mpm_winnt:notice] [pid 15052:tid 800] AH00354: Child: Starting 64 worker threads.
- Project name: turiumasina
- path D:/Users/PycharmProjects/turiumasina/
path to wsgi:D:/Users/PycharmProjects/turiumasina/turiumasina/wsgi_windows.py (I renamed wsgi to wsgi_windows, settings file is in turiumasina/turiumasina/)
I copied the output generated by the mod_wsgi-express command and pasted it at the end of C:\wamp64\bin\apache\apache\conf\httpd.conf
my httpd-vhosts.conf
ServerName localhost WSGIPassAuthorization On ErrorLog "logs/turiumasina.error.log" CustomLog "logs/turiumasina.access.log" combined WSGIScriptAlias / "D:/Users/PycharmProjects/turiumasina/turiumasina/wsgi_windows.py"
<Directory "D:/Users/PycharmProjects/turiumasina">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
Alias /static "D:/Users/PycharmProjects/turiumasina/static"
<Directory "D:/Users/PycharmProjects/turiumasina/static">
Require all granted
</Directory>
wsgi_windows.py
import os import sys import site from django.core.wsgi import get_wsgi_application site.addsitedir("C:/users/.conda/envs/turiumasina/Lib/site-packages") sys.path.append('D:/Users/PycharmProjects/turiumasina') sys.path.append('D:/Users/PycharmProjects/turiumasina/turiumasina') os.environ['DJANGO_SETTINGS_MODULE'] = 'turiumasina.settings' os.environ.setdefault("DJANGO_SETTINGS_MODULE", "turiumasina.settings") application = get_wsgi_application()I generated the "static" folder, wrote a line in the settings.py:
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
If I enter python manage.py runserver via pycharm, I can see my site through a browser (http://127.0.0.1:8000/). the Wamp icon glows green. When I load a localhost, the page loads endlessly but does not load.
I would like my site to be visible not only to me, but also to Internet users by entering my external IP.
If you need, I can send you the whole project and project settings