johnnyboycurtis / webproject Goto Github PK
View Code? Open in Web Editor NEWbasic web project..exports data to Excel
basic web project..exports data to Excel
I am trying to follow along the tutorial to run a Django app with IIS server. Here are my settings:
Windows Server 2019, IIS10.
I am setting up my server and added CGI as shown in the image.
But, when i deploy the app, i get an error saying that the "FastCgiModule" is not in the list.
I looked in HandlerMappings to find that the FastCgiModule was indeed not in the list of modules that IIS considers.
Help and understanding about this is much appreciated.
Hi @Johnnyboycurtis
i followed step by step your youtube tutorial but when i start the Apache service and then go via browser to my localhost the page gives me an Internal Server Error. In the Apache log there are 2 particular lines:
[Thu Apr 21 16:56:18.626780 2022] [wsgi:error] [pid 6632:tid 1124] [client ::1:50605] mod_wsgi (pid=6632): Failed to exec Python script file 'C:/project/project/wsgi.py'.
[Thu Apr 21 16:56:18.626780 2022] [wsgi:error] [pid 6632:tid 1124] [client ::1:50605] mod_wsgi (pid=6632): Exception occurred processing WSGI script 'C:/project/project/wsgi.py'.
Any advice?
Thanks!
Microsoft has deprecated wfastcgi
so it shouldn't be used any more.
If people start cleanly with HttpPlatformHandler, the experience should be smooth,
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
</handlers>
<httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\python.log" startupTimeLimit="20" processPath="C:\Users\<user name>\AppData\Local\Programs\Python\Python310\python.exe" arguments=".\mysite\manage.py runserver %HTTP_PLATFORM_PORT%">
</httpPlatform>
</system.webServer>
</configuration>
Python/Django still takes care of everything including static files, and IIS/HttpPlatformHandler just passes requests on.
More details can be found from my blog post.
Not able to run the project on https. Even there is no solution on net for waitress and nginx on windows for https.
1-after I deploy my Django project in folder wwwroot could I delete it to prevent customer who buy it from me to reuse it or copy to another
2-could I make a pc or own dedicated computer encrypt folder and act as a local server for many connected pc in a company run by linux?
3-what about statics my project much static and java script will be static root how it works?
Could contact you email?
4- I deployed one project. www.cutisystem.com on DigitalOcean on domain work http but if I put https it naginex error
I use cerbot certificate
I tried the tutorial with exactly the same steps but I still keep getting this error with fastcgi
HTTP Error 500.0 - Internal Server Error
c:\python37\python.exe - The FastCGI process exited unexpectedly
Most likely causes:
•IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
•Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Module : FastCgiModule
Notification: ExecuteRequestHandler
Handler: Python FastCGI
Error Code: 0xc0000409
Requested URL: http://localhost:80/
Physical Path: C:\inetpub\wwwroot
Logon method: Anonymous
Logon User: Anonymous
More Information:
This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information »
Microsoft Knowledge Base Articles:
•294807
My system information is as follows:
Windows Server 2016
Python 3.7.7
Python packages:
asgiref 3.2.10
Django 3.0.7
et-xmlfile 1.0.1
jdcal 1.4.1
openpyxl 3.0.3
pip 19.2.3
pytz 2020.1
setuptools 41.2.0
sqlparse 0.3.1
wfastcgi 3.0.0
Environment
OS: Windows 10 Enterprise Evaluation (VM)
Build: 17763.rs5_release.180914-1434
Replicate
Possible Solution
I couldn't get static file configuration in settings.py to be respected by IIS, however, I was able to get IIS to serve static files directly via its own configuration.
I have used your web project application and followed the steps using nginx , but am getting 502 bad gateway message.
Then i checked the logs in nginx folder and it showed "No connection could be made because the target machine actively refused it".
Please help me to resolve the issue
Hi @Johnnyboycurtis,
Was able to create a working Django application and works fine in development (runserver). However, I'm currently stuck with my production build using Apache as the web server. Unfortunately, I am not able to resolve the issue.
Was able to install the Apache service successfully. However, after adding the Python-related parameters, the service stopped and doesn't want to start/restart. Attached is my httpd.conf and the Apache error log file.
Would it be possible for you to check and share your recommendations on how I can correct this problem?
Thanks a lot for the assistance.
I used waitress
with nginx
everything works okay, but when I login to the app i got error CSRF verification failed. Request aborted.
site available configurations
# mysite_nginx.conf
server {
# the port your site will be served on
listen 82;
server_name 172.30.1.196;
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location = /favicon.ico {
alias C:/Apache24/htdocs/fuel/assets/favicon.ico;
expires 7d;
}
location = robots.txt {
alias C:/Apache24/htdocs/fuel/frontend/templates/frontend/robortx.txt;
expires 7d;
}
# Django media
location /media {
alias C:/Apache24/htdocs/fuel/media; # your Django project's media files - amend as required
}
# Django static
location /static {
alias C:/Apache24/htdocs/fuel/assets; # your Django project's static files - amend as required
expires 7d;
}
# Finally, send all non-media requests to the Django server.
location / {
proxy_pass http://127.0.0.1:92; # See output from runserver.py
proxy_set_header Host $host; # send host header to django
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # send client ip to django
proxy_set_header X-Forwarded-Proto $scheme; # send protocal to django
#proxy_redirect http://127.0.0.1:91
}
}
Hi @Johnnyboycurtis how we can specify no of threads for handling req in apache mod_wsgi windows?
does mod_wsgi on windows support multiprocess?
Hello @Johnnyboycurtis I'm trying to host multiple django application on IIS but it's not working.
I saw your video it is very help full, but when I'm trying to host 2nd application on different port in different directory but not working.
I have created separate web.config file for 2nd application, but not running . giving below 500 error.
I also set permission to my application as you mention in your video
It would be great if help me in this I'm trying it from last 3 days but not works.
After I run runserver.py it didnt print any message
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.