I am trying to test the new Spotify iOS SDK on a device, and this requires setting up a spotify_token_swap ruby file for oauth authentication.
I've never used ruby before and am a bit lost.
I also tried a python version of this file but also can't get it to work.
Does anyone have any advice on ruby script hosting, or any experience on working with the Spotify iOS SDK that could help?
Thanks
You can use this python service instead:
Download Google App engine here
Install the launcher
Go to chrismlarson's spotify-token-swap-gae and download the project, it will have everything you need.
In Google app engine launcher, Press add excisting project
Go Google app engines website and create a project, here you will get an app-id
in app.yaml , replace spotifyauth with the app-id
Press deploy
Done, you can now access it on the web at app-id.appspot.com/swap
Before I got this solution, I've spend hours in the jungle of Python and Ruby, Cheers!
There's another good alternative which you can deploy on Heroku:
https://github.com/bitstatic/spotify-swap-service-postgres
Just be mindful that you have to:
Probably edit config/environments.rb and change /mydb to /development
Run rake db:create
Run rake db:create_migration NAME=user_tokens
Edit db/migration/{dateandtime}_user_tokens.rb and replace it with:
class UserTokens < ActiveRecord::Migration
def up
create_table :user_tokens do |t|
t.string :username
t.string :refresh_token
end
end
def down
drop_table :user_tokens
end
end
Run rake db:migrate
Most of this is covered in the Readme, and it even includes a helpful guide on setting up Postgres on your localhost! Once the migrations are set up it's a simple git push heroku master.
Good luck!
ps. Let Spotify know that setting up a token swap server is a lot of work, and they can follow Facebook's example of having 60-day tokens, by commenting on this issue: https://github.com/spotify/ios-sdk/issues/159
Related
I am new to Python deployment. I have a Python Web API made in Flask. Want guidance on how to publish the python code as web API so that Dot Net program can consume it and take benefit of Python / ML.
Apologies for such generic question, but any help or approach or documentations on the same would be grateful.
Thanks In Advance!!!..
As far as I know, if you want to deploy python application to the IIS. I suggest you could follow below steps:
1.Install Python on your server.
2.Install wfastcgi on your server.
3.Install the IIS(contol panel->Programs->Programs and Features->Turn Windows Features on or Off) with the CGI
4.Create a new IIS web app for the paython project folder.
5.Modify the handler mapping to add python handler. Notice: Modify the path based on your python and wfastcgi path
Run your application
More details, you could refer to below article:
https://www.storehubs.com/Blog/deploy-python-flask-application-iis/
https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2019
I am pretty new Google app engine, and though I have hacked around with alot of languages, I am finding the google documentation a little overwhelming. I have successfully launched a static site, and successfully run some python code from the console. But I have not run any python from my static site.
I am a Small company trying to setup a google app engine static/dynamic website that I only want to expose to my Gsuite users.
I have some python code I want to run on my app engine, which will download a file from gdrive/teamdrive, process the file, create a new file from the results and then upload the resulting file to the same folder.
I may also at a later date have this static/dynamic website also interfacing with Cloud SQL(mysql) or an external database.
my Questions
What authentication method to use to only expose this website to my gsuite users?
Though I have worked through some of the GDrive api examples whats the best and easiest method of passing GDrive text files to my python code? (though I have hacked around with python lots in the past, the html and python combination perplexes me)
Thanks!
You would use OAuth2.0 to acquire a token which you can then use to interact with that user's files through the GDrive API (see "About Authorization" as well as this quickstart Python example).
I'm new using python on openshift and I follow this tutorial to learn more about it https://developers.openshift.com/en/python-flask.html, then there is a thing that I can't find info in openshift docs or https://developers.openshift.com/en/python-flask.html
I suspect is defining the execution order of https://developers.openshift.com/en/python-repository-layout.html
Am I right or I missing something else?
It is used to automatically deploy your application.
See this link.
Check also this link
I am trying to use Bulkloader of google app engine but unfortunately could not understand what to do from documentation. It says add this part to app.yaml
builtins:
- remote_api: on
ok i have added. Then says that i have to execute this command
appcfg.py update
but i don't have any appcfg.py file. And also what is the command which executes this line?
Please somebody tell me what i am missing I use AppEngineLauncher to upload my project to server.. I have naver used a command to update or upload it.
Thanks in advance..
If you're using App Engine Launcher, simply click the Deploy button; it runs appcfg.py update. appcfg is installed as part of the SDK.
In order to call it globally you must set the python path to include google appengine library, or call it from its excact location
~/google_appengine/appcfg.py update ~/project/path_to_your_yaml_file/
where ~ stands for you home folder.
For those using the the Java GAE SDK, it comes wtih appcfg.sh, but doesn't support full features of apppcfg.py. You need to also install the Python GAELauncher. On Mac, it installs appcfg.py in /usr/local/bin.
Working only with my local datastore, I did not have an app.yaml, nor did I need to update it as per the uploading data GAE documentation. Just needed to update the web.xml with the RemoteApiServlet.
Main gotcha is the Authentication error while connecting to the local data store. It may be specific to Mac and the Charles proxy work around mentioned in that thread likewise worked for me. I did have to modify the default proxy port from 8888 to avoid conflict with my app. The workaround is tedious and the trial version of Charles comes with limitations such as shutdown after 30 minutes.
To use the main database for development, first download it from app engine:
bulkloader.py --dump --url http://<app name>.appspot.com/_ah/remote_api --filename dump.bin
It will ask for an email and password (use your google login details).
To upload it to the development environment, make sure remote_api is
enabled in app.yaml
https://developers.google.com/appengine/docs/python/tools/uploadingdata#Setting_Up_remote_api
Then run:
bulkloader.py --restore --url http://localhost:8080/_ah/remote_api --filename dump.bin --application dev~<app name>
This time for the email, just leave it blank and hit enter.
Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code?
I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit. I don't mind if things are broken on the live site since the project is for personal use mainly and for learning.
Anyone have any thoughts on how to tie into the subversion commit for the Code repository and/or how to kickoff the deployment to AppEngine? Ideally the solution would not require anything manual from me nor any type of server/listener software on my machine.
Google Code Project Hosting now supports Post-Commit Web Hooks, which ping a project-owner-specified URL after every commit. This would eliminate the need to regularly poll your Google Code repository.
Made By Sofa had a blog post about their workflow with Google App Engine. In the second last paragraph they have attached a subversion hook that when when someone commits code it will automatically deploy to Google App Engine. It would take a little bit of tweaking (because it works on the server side not the client) but you could do the same.
You'd probably have to have some glue on another computer which monitored SVN commits and deployed a new version for you. Google Code has yet to develop and release an API (which they need to do soon if they're serious about this whole development thing), but GAE can be deployed to with relative automated ease, so I wouldn't have thought it should be that difficult. The deployment process, however, will vary with each project, so that's something you need to sort out yourself (you might wanna take a look at the fabric deployment system). Then, just set a cron job going which updates a local SVN checkout on the middle machine, and you're done.
Very interesting, but not yet possible, AFAIK. I have been looking for that option in Google Code with no success.
The only solution I can figure out is to install something in your machine that checks for changes in your SVN repository.
I'll be happy to hear about other approaches.
For those of us who are using Github, this feature from the GAE team would make us all seriously consider switching to Google Code...