I am trying to deploy Django on local host and "tunnel" using ngrok. The ngrok works but the IIS (Internet Information Manager) gives 500 Error <handler> scriptProcessor could not be found in <fastCGI> application configuration. Reference into fastcgi shows that this feature is deprecated but what is the replacement for serving Django using local server and ngrok. I also pip installed pyngrok. Can you suggest a clear solution?
FastCGI was deprecated in Django 6+ years ago, their docs say WSGI is the preferred alternative, and they provide a tutorial for types of WSGI deployments to get you started.
But you wouldn't use ngrok in this case, you'd serve it up with something like nginx or apache using a wsgi mod (also shown in their tutorial). Where you'd use ngrok is in development with Django's built-in dev server, and that's the full example provided in pyngrok's documentation.
Usually I'd provide actual sample code here, but what you're asking about are full end-to-end solutions, which is why I'm providing links. Without the full context and examples of what you've built, it's hard to tell you where it's going wrong—hard to provide specific solutions without specific examples of the problem. But these tutorials tutorials are for exactly what you're doing, so hopefully they can help you debug your own solution.
Related
I deployed a React-Application with the Staticfile Buildpack to Cloudfoundry on the SAP Cloud Platform which has different routes (e.g."/login", etc.)
When I access the app with the provided URL (e.g. "www.exampleurl.com") and navigate through my app everything works, the different pages with different routes are working as expected.
My problem now is that, everytime I want to reload a page or if I want to access the application with an additional path attached initally e.g "www.exampleurl.com/todo-route" instead of just "www.exampleurl.com/" I get an 404 Not Found nginx error.
Is this problem related to the application router I need to configure before deploying my application or is it something different.
Unfortunately, I am not getting smarter from reading the documentation and resources on this are very rare in general.
I would appreciate some advice very much. Thank you in advance.
For people having trouble with single-page applications as well:
I found an answer already myself.
Refering to this post:
Deploy single page application Angular: 404 Not Found nginx
You need to add a "Staticfile" file in your dist or build folder with "pushstate: enabled".
You can also refer to the cloudfoundry documentation for the staticfile buildpack: https://docs.cloudfoundry.org/buildpacks/staticfile/index.html
Hope that will help some people on the way.
I have a Django website as an on-going development which I have running on Ubuntu 16.04.1. It is an intranet and so sits within a corporate network.
It currently works nicely with Nginx, Gunicorn and Supervisor.
However, I would now like to implement single sign on so that users who have already authenticated into their workstations don’t have to sign into the application. As I understand from, the Django documentation, setting the REMOTE_USER environment variable is key and, during my efforts, I have been able to set this variable in my current Nginx config and it authenticates to the Django site.
However, the network environment means that I am looking for a solution that uses with NTLM or Kerberos (rather than Based Auth, which I believe would make this much easier for me although I’m currently unfamiliar with all of them.)
In trying to find internet posts that would help be do this (including on here), I’m not 100% sure that it would actually be possible.
Does anyone know if it is using recent versions of nginx (1.10) ? If not, am I likely to have more success with some sort of Apache set up ( using mod_wsgi instead of Gunicorn as this post this post would insinuate.
I'm new to mezzanine and Django. I have set up a site, everything is working but I can only launch the server on "development". I would like to access de site on the port 80 on the internet instead of internally, as I have no way other than redirecting the port via SSH to access it. I would like to know how to do that.
And another question, is Nginx included with Mezzanine automatically ? Cause I have a tuned up Nginx server there and I'm not sure what I need to do, if run it with my existing Nginx server or with the one included with Django if that is how it works .... thank you for bring some light on this.
NGINX is not included with Mezzanine, it's an entirely separate piece of software, similar to Apache.
Mezzanine includes a fabric script which can automatically set up a production server if you'd like to use it, and will install NGINX on the server for you, among many other things.
Given your question, I can't recommend enough that you read and understand all the related documentation on this topic. Start with the Mezzanine link below, it references many other documentation sites - Django, Fabric, NGINX, plus more.
Enjoy the adventure: http://mezzanine.jupo.org/docs/deployment.html
apache + python + mod_wsgi + django +svn:
I have alreaady get my django project running under http://. Then My boss ask me to get it run in https.
I would like to know what is the difference between http and https? And how can I make my django project run under https?
Thanks
`Oh sorry, I think I have to correct somethings here.
I got my boss wrongly. In fact, he wanted me to build and run django project with svn on apache server and he also wanted it running under https.
So, can anyone tell me or provide me some link of related information of how to setup these? (actually I have very little knowledge about what svn is doing. I think my boss wanted to use svn for managing the website source code.)`
*If possible, please tell more about svn. Thanks!
The Apache documentation has various documentation about HTTPS and setting it up to use it.
http://httpd.apache.org/docs/2.2/ssl/
You just need to put your mod_wsgi configuration within a VirtualHost setup for HTTPS.
I use Django for my website and I want to know whether there is a work around for testing secure pages in Development server. As a temporary workaround, I wont use HTTP to check the webpages in dev server, which I think is not a correct way? What do you think?
You might consider mod_wsgi, since it can be used for development, testing, and deployment. mod_wsgi can be configured to detect any changes to you make to your Python code and automatically restart, same as the development server.
I tend to do most of my development on my local machine, but use an actual reference implementation server for testing. It's running mod_wsgi under apache, with a self-signed certificate. A recent detailed article by Graham Dumpleton is available here:
http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html
This looks helpful -- using stunnel to route HTTPS requests to django dev server.
The Django development server is very basic and intended for local testing only. It does not support ssl/https. You'll have to run it using Apache, NGINX, or some other web server that supports SSL in order to test.
You can now use FakeSSLMiddleware