I am building an app client and another app server (with mini flash games). I need to be logged on the client side to get a button which able an html page with an iFrame which in its turns ask to download the game inside it. so far so good.
On the server side the request from the client will need to check if the user exists, if it does it start to sending the game.
Well the game starts to be sent but stops and the client side is automatically logged out...
I breakpointed the logout method (# init.py) but it does get there... Anyone did already get the same problem.
I am newbie on Django and maybe this is a know problem but I didn't find anything like so far..
Thanks!
Related
My app successfully connects to Facebook using Facebook's Graph API, requests access to the pages I want to post to and redirects back to my app. That works like charm.
My problem is that if I created a new page on Facebook, I cannot add it to my app:
When I try to connect again, Facebook seems to know what I have requested earlier and I'm immediately redirected to my app without the request which pages I want to allow access to.
How to reconnect or what's the normal way to fix that problem?
I use Facebook's PHP Graph SDK 5.7.
#CBroe That didn't work either, but then I've cleared all permissions and chosen to reopen the site selector dialog, chosen all sites and closed, removed the information from my database and reconnected... Now the dialog appeared! Thank you for your help! Helped me a lot!
Requirement :-
working on a project with flask.
flask socketIo ...and i have almost completed the project.
Now i want to implement something which is very common on web development.
Right now i can show the status of background tasks in the UI, and events are getting send to specfic (request.sid ). Now if the user accidentally close his browser and and returns to the same page, for obvious reason he won't see anything ( which was happening in the existing session) but the initial page
I want to a way if the user again comes to the page, it should be redirected to the current status page.
Am trying to achieve something exactly like any cloud based solutions For example if i create an Ec2 instance from console and close it. Upon reopening it will still show the existing operations with current status ( running,pending ) etc..
How can achieve that ?
if the user accidentally close his browser and and returns to the same page, for obvious reason he won't see anything
This isn't really obvious. If your user is logged in to your application then you know them, and presumably you also know what background task each user has pending. When the user returns to the page and logs in again, you should be able to find the state of any background tasks associated with the user.
The only situation in which you would not be able to do this is if you don't require your users to authenticate, in which case when the user comes to your page the second time you have no way to know it is the same user that closed the page before. The fix for this problem is to use authentication, so that your users are always known to the server.
I'm using Facebook Marketing API. Starting from last week I get an error message when I try to send a request from my local machine.
The exact error I'm getting on my screen is the following:
RequestException in RequestException.php line 154:
(#3) App must be on whitelist
When I send a request from production server, the app is working fine and creates a campaign.
I went through all the possible settings in the app, to see if I'm able to configure it from there, but seems like the app is configured well.
App is also public:
This app is public and available to all users
Appreciate any help or tips!
App suddenly started working without making any changes to code or configuration. Must be an Facebook issue...
I had this issue when provide 'is_autobid' property to new campaign
Basically what I'm doing is building a desktop application that needs to connect to a web server, perform some calculations, and then have the resulting values sent back to it. The calculations change over time, and also need to stay somewhat secure, which is why I'm not just coding them into the desktop application.
The issue is that only authenticated users should be allowed to access the server. So what I'm looking for is a way to log-in to Django from my desktop application (i.e. the desktop application will pop up a window asking for a username and password, which will then be sent to the Django site, used to authenticate the user, and if valid, will return the results of the computation. It also needs to work as a session (the user enters their password at the beginning and then doesn't need to log-in again until they close the desktop application, even if multiple computations are performed).
I think I need to use session keys for this, and perhaps the RemoteUserMiddleware described here but I really have no idea where to start as far as coding this. Any suggestions or pointers in the right direction would be hugely appreciated.
Thanks,
-Morag
P.S. If this is important, the desktop application is written in VB.NET.
Interesting. I've never done anything like this, but here is, what I assume, is the basic idea:
1) Get a good view of Django sessions; the basic idea is:
One logs in using the django auth framework login service
Django will create a session for you and handle all the difficult stuff
Django returns a HttpResponse with a sessionid cookie. You will need to send this back with any request following to identify yourself and 'operate within the session'.
One logs out using the django auth logout service and the session is destroyed by Django.
2) Now, the rest is relatively easy.
Setup django urls.py with the appropriate urls for login/logout + computation service
Execute a post request to the login service with the appropriate parameters set
Catch the response, extract the 'sessionid' cookie and save it somewhere
On each subsequent request, include the sessionid
This should get you started. Good luck!
I have written a web app with a few JSP pages and Java servlets running on a Tomcat server. The app needs to be able to send location updates to one of the Servlets every x seconds. I have found the html5 watchPosition(sucess_callback, error_callback) function to get the location updates from the web page. I'm thinking.. once I get the update from this function.. I'll put code in the callback function to send the update to a Servlet. But adding the watchPosition function to every JSP page in the app seems cumbersome. What is the right way to send periodic GPS updates to the server no matter whatever webpage the user is viewing in the app?
I'm not sure whether you can create any code which continues to send location data when the user loads another web-page. The web is a stateless thing and when the user opens another page other code is executed. I suspect that the JSP is the codebase from which HTML is produced when sent to the mobile-phone. My idea would be to add the location sending functionality as AJAX requests in the Javascript. If your web-app is based on many links between pages and full loads it could also be an idea to implement Ajax for loading new content into the page.