I am attempting to follow set up the python xmpp server for GCM as detailed here:
https://developer.android.com/google/gcm/ccs.html
The website I used for hosting is pythonanywhere.com
My issue is that when I saw import xmpp, it says that no such module is found.
Should I be trying to install it on their server? I realize that this issue is probably really basic, but I have looked online for the last hour or so without much fruit. I see all these variations on XMPP and am not sure if I have to deal with any of those or if I can just do exactly what the google demo is saying.
Thanks for your time,
-Alper
PythonAnywhere doesn't support raw TCP socket connections or websockets, so XMPP may not work. But then again, from reading wikipedia, it does look like there's a pure-HTTP alternative, so it might work.
Check out this guide to installing new modules: https://www.pythonanywhere.com/wiki/InstallingNewModules. My suggestion would be to use a virtualenv for your web app, and install flask and xmpp into that...
You will have to download and install the missing python package. You may do this manually via SSH if the provider gives you access, or there may be a way to include a requirements document such that the server looks and downloads needed packages automatically. It all depends on the host, the access they allow you, and their automation features.
Related
I'm using Debian 8 alongside Plesk Onyx (latest version). Now I want to install Seafile, which is dependent also from Python. I found tutorials on the Internet, however, none which describes how to set this up under Plesk within a subscription. So I neither want the port to be 8080, nor a 'separate' web server by Seafile itself. I want to access my seafile then under https://cloud.mydomain.com, is there any way to do this? And if there's no definite guide, what would be the rough steps (with regard to Seafile's program architecture and how it works)?
Not sure if still relevant, but anyway: Yes, it is definitely possible. Seafile installation should proceed according to normal installation process described in Seafile's Manual.
Redirecting the traffic from the frontend servers to Seafile/Seahub is a trickier, a more detailed description, using FastCGI, can be found here:
https://andre-hoeche.de/blog/2016/07/install-seafile-5-1-on-debian-7-10-with-apache-2-2-and-plesk-10-5/
I am trying to build a GAE application that shell use GCM API.
(I am working with Eclipse Juno, having GWT, ADT installed).
I am using Google's python example, and I can't make it work, I'd be really grateful
if you could advise me where am I loosing my way.
First it's probably important to note that I have created a project in the Console, activated
the API, and got my project whitelisted by Google. So far so good?
I have created a python GAE project, based on Google's example in the following link -
http://developer.android.com/google/gcm/ccs.html
At this point I face the following difficulty -
client = xmpp.Client('gcm.googleapis.com', debug=['socket'])
The Client class is not recognized by the pre-interpreter. When I check in the XMPP package,
it looks though this class actually doesn't exist there... - how to handle this one?
I've tried to add the GCM APIs to the project, thinking that this might be the problem,
but the G->Add Google APIs...->Selection proposes all APIs but GCM.
My next step was to try installing google-api-python-client-gae-1.2.
I've found the following guide -
https://developers.google.com/api-client-library/python/start/get_started#simple
I've installed the lib, and then paid attention to the fact that in GAE, all source should be present in the project lib - so I have manually copied "apiclient" lib's content to my src lib.
Nevertheless, for the following line I've added from Google's example -
service = build('my_service', 'v1', developerKey=api_key)
when I run the GCC application, the following error occurs:
from apiclient.discovery import build
ImportError: No module named apiclient.discovery
I'm struggling through those issues quite a while, please help...
You're mostly headed in the wrong direction.
App Engine's XMPP API lets you send and respond to XMPP messages. See the docs:
https://developers.google.com/appengine/docs/python/xmpp/
There's no "Client" class. You have to code against the API provided by the XMPP service.
You're better off just using the HTTP connection server instead of XMPP. It's more straightfoward:
http://developer.android.com/google/gcm/http.html
http://developer.android.com/google/gcm/server.html says
Note that Google AppEngine does not support connections to CCS
I have a small application written in python using TwistedWeb. It is a chat server.
Everything is configured right now as for localhost.
All I want is to run this python script on a server(shared server provided by Fatcow.com).
I mean that the script will be working all the time and some clients will connect/disconnect to it. Fatcow gives me python 2.5 without any custom libraries. Is there a way and a tutorial how to make it work with TwistedWeb?
Thanks in advice.
the easy_install/pip modes of installation are very likely to fail because of broken dependencies. You will have to download the tar and build it yourself. See the attached link for more info on installing the same on CENTOS.
http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#CanIinstallTwistedusingeasy_installorpip
I have contacted Fatcow.com support. They do not support SSH connections and do not support Python 2.7 with Twisted library, especially python socket application as server. So it is dead end.
Question resolved.
I have a server that I'd like to use to maintain persistent connections with a set of devices, just so that they can pass simple messages back and forth. It's a trivial task, but selecting a server-side platform has been suprrisingly difficult (especially since I have no administrative privileges - it's a dedicated commercial server).
My best idea so far is to write a TCP server in Python. The Twisted platform seems suitable for the task, and has a lot of good reviews. However, my server has Python 2.7 but not Twisted, and the admins have been reluctant to install it for me.
Is there any way that I can just upload a Twisted package to the server and reference it in my libraries without installing it as a framework?
I'm not sure what you mean by "installing it as a framework". If you are using an OS X server hosting environment, then maybe you're talking about Framework with a Capital F. However, OS X server hosting isn't a very common environment so I'm guessing that's not it.
If you just want to know how to install a Python library in your home directory, then the general answer is:
$ python setup.py install --user
This Just Works™ on Python 2.7 (assuming the package uses distutils, which Twisted does, and you unpack the source .tar.gz and change your working directory to the directory that is the root of the contents of that .tar.gz), so you should be done after that.
Use virtualenv to create your private Python libraries installation.
I have developed a few python programs that I want to make available online.
I am new to web services, and I am not sure what I need to do in order to create a service where somebody makes a request to an URL (for example), and the URL triggers a Python program that displays something in the user's browser, or a set of inputs are given to the program via browser, and then python does whatver it is supposed to do.
I was playing with the google app engine, which runs fine with the tutorial, and was planning to use it becuase it looks easy, but the problem with GAE is that it does not work well (or does not work at all) with some libraries that I plan to use.
I guess what I am trying to do is some sort of API using my WebFaction account.
Can anybody point me in the right directions? What choices do I have in WebFaction? What are the easiest tools available?
Thank you very much for your help in advance.
Cheers
Well, your question is a little bit generic, but here are a few pointers/tips:
Webfaction allows you to install pretty much anything you want (you need to compile it / or ask the admins to install some CentOS package for you).
They provide some default Apache server with mod_wsgi, so you can run web2py, Django or any other wsgi frameworks.
Most popular Python web frameworks have available installers in Webfaction (web2py, django...), so I would recommend you to go with one of them.
I would also install supervisord to keep your service running after some reboot/crash/problem.
I would be glad to help you if you have any specific question...