I try to write my first Web app using python and flask (Disclaimer: Sorry in advance for wrong terminology and not knowing obvious stuff). Testing the code on my laptop and everything works fine.
I tried to deploy it on Amazon Lightsail for the first time using this guide, because I used it throughout the development.
I tried to use flask run and flask db upgrade, but I get for both the following error message:
File "/home/ubuntu/app/venv/lib/python3.5/site-packages/ics/alarm/audio.py", line 31
self._sound: Optional[ContentLine] = None
This error does not occur on my local machine with the same code (I recommited the git code). I looked in the files on the server, but could not find a mistake.
This is my first big coding project. What would be the next steps in debugging?
Related
My team and I have set up an account with Hostinger and have a VPS set up with its own domain. Our current Operating System is CentOS 7 64bit with Webmin/Virtualmin/LAMP and we have Webmin set up as our Cpanel. As of right now we have our HTML pages showing but our Python code is not working.
We used SSH to download Python3, MongoDB, pymongo, and flask, but are still having trouble getting our Python code to work on our web application. From here we are unsure what to do and need guidance on what our next steps should be. Thank you in advance for any help given.
It sounds like what you've gone for on your VPS is a web hosting setup rather than a bare metal VPS setup. I can see why you think you'd want web hosting, but in reality Flask works differently in that it is its own application which needs to run rather than being served like an HTML page.
There is an excellent tutorial on how to do this here. It is designed for Ubuntu (which is a good setup if you are starting fresh) but there are also versions for different linux flavours.
I'm a newbie and learning Heroku systems. I want to run this CMS on Heroku. I ran it many times on my machine and on others' servers. But I don't have servers all the time. I want to make it on Heroku for contestants.
As always I tried to follow the docs of this app. The requirements and setup part runs fine. But the database creation and other parts I couldn't cope up with. As a result, it shows an application error. The app also uses Postgres. But the commands given for ubuntu, I don't know how I can make them in Heroku.
If it sounds stupid question please pardon me. If I have to learn about something please give me some resources to learn.
Or It it is not possible to run this app with heroku, is there any SSH tunelling trick to just make the contestant part online with heroku Or is there any way to just tunnel my localhost to heroku web app domain? Thank You Very Much.
I have been writing a pretty simple python quizz system (called game.py) and I am working to deploy it on heroku. The app functions exclusively within the confines of a python console, with no interface of any kind but that provided by a terminal.
As such, I would like to be able to have the application on Heroku simply be akin to what you obtain with a one-off dyno, available on the dashboard (or in a terminal with the CLI) with:
heroku run python game.py
The application works perfectly well in it's deployed form (exclusively from the Heroku git) and locally, but in order for the app to be available to a larger public, I would need to have such a console appear on the "https://[appname].herokuapp.com/" URL that you are given on deployment of the app.
Naively, I would think this to be unspeakably simple to pull off, but I have yet to find a way to do it.
The only reasonable thing I have found would have been to create a Procfile, but lacking any documentation on the commands available, I only have been able to try variations of:
web: run python game.py
Which doesn't create a web console. And:
web: bash
Which simply crash with error code h10, with no other information given.
Any help, any suggestion, any workaround you can think of would be extremely appreciated.
I'm running my app on my local machine and using the remote API to access a datastore on my production side. Everything was working great until I tried adding a second app in google app engine launcher (I believe this is what caused the issue) because I had to merge what I was working on with some more up to date code and wanted to test as I went along. Suddenly I can't even access the remote datastore anymore. I get the error
app s~buybottandrew cannot access app dev~buybottandrew's data
I tried clearing the local datastore which allows me to access the remote datastore once, then the problem comes up again.
I read suggestions on the default_partition flag and I've tried passing that as well, with a muitiplicity of different things including nothing and an empty string.
--default_partition=s~buybottandrew
It gives me the same error no matter the argument
dev_appserver.py: error: unrecognized arguments: --default_partition=s~buybottandrew
If I remove all my remote api code and deploy it when I test it on the production server everything works perfectly. I can't seem to narrow down what is going on for the life of me.
Any input would be greatly appreciated.
--default_partition was removed in the new SDK. If you want to use the legacy SDK function, you can use old_dev_appserver.py --default_partition
I'm trying to create a KhanAcademy (KA) clone on Google App Engine (GAE). I downloaded the offline version of KA (http://code.google.com/p/khanacademy/downloads/list) for Mac, and set it up with GoogleAppEngineLauncher (https://developers.google.com/appengine/). Because KA was produced on Python 2.5, I have the setup running through the Python 2.5 included in the KA offline version download, and I added these extra flags to the app (to essentially duplicate the functionality of the included Run file):
--datastore_path=/Users/Tadas/KhanAcademy/code/datastore --use_sqlite
As is, GAELauncher is able to get that up and running perfectly fine on a localhost. However, to get it up on my Google appspot domain, I need to change the application name in app.yaml. When I change "application: khan-academy" in app.yaml to a new name and try to run the local version via GAELauncher (or the included Run file), the site comes up but all the content (exercises, etc.) has disappeared (essentially, the site loses most of its functionality). If I try to "Deploy" the app in this state, I received a 500 Server Error when I try to go on the appspot website. Any ideas as to what could be going wrong?
Thanks.
The problem is that your 'clone' application does not have access to Khans Academy's AppEngine datastore so there is no content to display. Even if you do use all of the code for their application, you are still going to have to generate all of your own content.
Even if you are planning to 'clone' their content, too, you are going to have to do a lot of probably manual work to get it in to your application's datastore.