External request limit on IIS - django

I have deployed django application on IIS. The application requests external link (API) to extract some data.
What I have seen is, it makes requests but fails to complete full request. It goes for about 4 request sometimes it goes further 9 requests and stops there. No sign of error is shown.
While I perform same task from django shell, all requests are made. So I guess this is something related to IIS.
I am new to IIS and windows server app deployment.
I tried googling about this but I could not find any relevant answer.
Did anyone of you here faced similar problem? If so what can be the solution. Also can you guide me on this?

Related

Problem in hosting Django REST API on IIS

I was trying to host django REST API on IIS but it wasn't working properly. I worked with the same locally and it was working absolutely fine.
But when I hosted it on IIS then first of all its homepage with get method for all data from the database takes longer time to load and ended up with timeout error. And, when I tried to access other pages, the same problem occurred with them too. Only a page with post method opened but when I tried to submit data it raised an error.
I checked server configuration then I found that default error is timeout error. Now I am confused about why such things happened.
Can anyone please tell me if they faced similar issue or if they know some kind of compatibility issue or some prerequisite for hosting REST API using Django REST Framework? Or help me how can I find and fix the issue.
Are you using FastCGI? check the Authentication then try to disable windows authentication and enable anonymous authentication, try that if it will work.

Django development server hangs and suddenly does all requests on CTRL+C

I am using django for a REST API at my company and have a few people using the first small part of my app via a Samsung tablet. They connect via WiFi to a angular front-end on Apache, that makes API requests to my django development server.
But every now and again the server just freezes intermittently. The front end would work and you can navigate it, but no API calls are going through. And then when ever I press CTRL+C on the development server console, suddenly all the request go through. Depending on how long someone have struggle, there may be 20 API requests that all go through.
At these moments even when I change something in Django in vs-code, nothing happens server side, but when I press CTRL+C suddenly even ALL the server restarts also go through. So I can see that all the request are standing in line just waiting for the server to wake up and then they are all processed. It also looks to me if this mostly happens with the tablet (and not my desktop), where we are using Chrome.
I read that the server is now multi threaded, so that can not be the problem, and I also do not have anti-virus that can stop the server requests.
I do not really know what else to say, it has been 2 weeks of frustration now and continual searching for answer with no luck.
I suspect that the issue is with you using the dev server, where one request is taking too long. If you already have apache installed you can use mod_wsgi to connect to Django like described here
Django With Apache

How to make Django pass cookies when communicating with Node.js server using socket.io?

I am currently developing an instant messaging feature for my apps (ideally cross platform mobile app/web app), and I am out of ideas to fix my issue.
So far, I have been able to make everything work locally, using a Node.js server with socket.io, django, and redis, following what most tutorials online suggest.
The step I am now at consists in putting all that in the cloud using amazon AWS. My Django server is up and running, I created a new separate Node.js server, and I am using Elasticache to handle the Redis part. I launch the different parts, and no error shows up.
However, whenever I try using my messaging feature on the web, I keep getting an error 500:
handshake error
I then used the console to check the request header, and I observed that the cookies are not in there, contrary to when I am on localhost. I know it is necessary to authorize the handshake, so I guess that's where my error is coming from..
Furthermore, I have also checked that the cookies do exist, they are just not set in the request header.
My question is then: How can I make sure Django or socket client (not sure who's responsible here..) puts the cookies in the header??
One of my ideas was that maybe I am supposed to put everything on the same server, with different ports, instead of 2 separate servers? Documentation on that specific architecture problem is surprisingly scarce, compared to the number of tutorials describing how to make it work on local.
I hope I described the problem accurately enough! :)
Important note: I am using socket.io v0.9.1-1, only one compatible with a titanium mobile app.
Thank you for any help!
All right, so I've made some progress.
The cookie problem came from the fact I was making cross-domain request, adding a few lines enabled CORS, which didn't solve the cookie issue, but allowed me to communicate between servers (basically I set the headers of the response using express. I then passed necessary data in the query, even if not the most secure way to do it, I'm just building an MVP, and it's enough for now.
I haven't been able to make the chat work from my Titanium mobile app, but since I can use a webview to handle it, I will be fine.
Hopefully that will help someone.. If anyone needs me to post some code snippets I will gladly do so upon request!
Cheers

ColdFusion Site Keeps Crashing Every Day

I have a Windows Server 2008 with IIS 6. There are 5 ColdFusion 9 sites running on the server. There are 2 specific sites that keep crashing every day and I am not able to track down the cause of the crash. The site simply stops responding to any requests. At the time of crash the SQL server looks good (no deadlocks found).
In order to bring the site back online I just need to restart the ColdFusion server or IIS services. ColdFusion logs look good and there is no error found in the IIS logs of the site. There is enough space on the 'C' drive so that the logs can grow.
What else am I missing? Please help me to find the cause of crash.
If you are using apache server there might be location that was missing or wrongly declared. try to see the config or log files. if you are using IIS then there might be a connector problem. Try to create a new application pool

Rest Web Service,

i am approaching the development of Restful web services for the first time. I tried to follow this guide for Netbeans . I am stuck at the testing of the web service.
When i open the
http://localhost:8080/WebServicesTest/test-resbeans.html
page, none of the root resources appears in the left menu. (there should be entities.customer and entities.discountcode)
I really can't find a solution.
Thanks in advance to anyone who likes to give me a hint.
--------------- Edit
If i click on CustomerDB --> Deploy i get an error
In-place deployment at C:\Users\utente\Documents\NetBeansProjects\CustomerDB\build\web
GlassFish Server 4, deploy, null, false
C:\Users\utente\Documents\NetBeansProjects\CustomerDB\nbproject\build-impl.xml:1071:
The module has not been deployed.
See the server log for details.
The line 1071 of build-impl.xml is
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
I checked out the referenced tutorial.
Which exact path did you follow? Did you change anything?
Most likely your CustomerDB application is not deployed correctly (see GlassFish Server output in NetBeans) and thus is not able to expose the web service and thus is not displayed in the test page (nothing visible in the side bar).
I tried the tutorial myself and had that phenomenon when using another database ("test" instead of the sample db, which was not connectable in my installed environment), resulting in a message that "test__pm" resource was not found. I then created a conection pool and a jdbc reosurce for test and then it worked.