I have a bottle+mongo application running in openshift. when I git-clone the application to my local computer neither the database nor the env-variables get download on my computer --just the python files. Should I have to mimic the mongo part in my local computer to developed locally? Or I missing something here.
Yes. You have to run your own Mongodb server locally or port forward and use the OPENSHIFT Mongodb.
Related
I am new to Python / Azure VM world.
I have created Python/Django website using PyCharm IDE.
Created Azure VM with Python/Django installed
on Azure VM , I can run : Python manage.py runserver and i can access it using Azure URL from externally.
Question:
to run/deploy a python website on VM, do we have to run Python manage.py command or there is any other way ?
in case I have to deploy multiple websites what i should do ?
and python manage.py session also gets expired pretty soon and site is not accessible anymore , how to keep it running ?
Regards Shakeel
after some research I found the solution, answer to my own question is for my requirements I can use NGINX and GUNICORN :)
I have successfully developed a Django app. The requirement is to deploy the app over an on-premise server. The application is accessible on the intranet using the development environment. Is any web server is preferred to deploy this application locally (or) should I leave the terminal running the server as it is so that the users can access the application as they are already doing it? I am using a unix server.
If the question is actually on deployment model, I suggest to take a look at django docs on deployment. Depending on load, uWSGI/Gunicorn [+ nginx] will be good choice.
Independent of tools you use, no need to leave running terminal on your server. There's a lot of tools to "daemonize" processes. Simplest would be supervisor
Yesterday, I installed an apche web server and phpmyadmin on my raspberry-py. How can I connect my raspberry-pi to databases in phpmyadmin with python? Can I use MySQL? Thank, I hope you understand my question and sorry for my bad english.
Your question is quite unclear. But from my understanding, here is what you should try doing: (Note: I am assuming you want to connect your Pi to a database to collect data and store in an IoT based application)
Get a server. Any Basic server would do. I recommend DigitalOcean or AWS LightSail. They have usable servers for just $5 per month. I recommend Ubuntu 16.04 for ease of use.
SSH into the server with your terminal with the IP address you got when you created the server
Install Apache, MySQL, Python, PHPMyAdmin on the server.
Write your web application in any language/framework you want.
Deploy it and write a separate program to make HTTP calls to the said web server.
MySQL is the Database server. Python is the language that is used to execute any instructions. PHPMyAdmin is the interface to view MySQL Databases and Tables. Apache is the webserver that serves the application you have written to deal with requests.
I strongly recommend understanding the basics of Client-Server model of computing over HTTP.
Alternatively, you could also use the approach of Using a DataBase-as-a-service from any popular cloud service provider(Eg., AWS RDS), to make calls directly into the DB.
I'm running django development server remotely using
python manage.py 0.0.0.0:8000
The project is available through Dropbox. I make the changes locally in my system and they are available to my testers when I checkin code to Dropbox folder.
The problem I'm facing is that the development server does not reload the code automatically. It somehow keeps running the same old code.
The development server on the same machine run on 127.0.0.1:8001 behaves as expected.
Is there a way to force reloading of files when django development server is run remotely?
Thanks for the help.
I've made a simple Flask app which is essentially a wrapper around sqlite3. It basically runs the dev server locally and you can access the interface from a web browser. At present, it functions exactly as it should.
I need to run it on a computer operated by someone with less-than-advanced computing skills. I could install Python on the computer, and then run my .py file, but I am uncomfortable with the files involved being "out in the open". Is there a way I can put this app into an executable file? I've attempted to use both py2exe and cx_freeze, but both of those raised an ImportError on "image". I also tried zipping the file (__main__.py and all that) but was greeted with 500 errors attempting to run the file (I am assuming that the file couldn't access the templates for some reason.)
How can I deploy this Flask app as an executable?
Host it.
Since you created it in Flask, and its a web app - hosting it should be trivial. Dump it on any of the PaaS providers like Heroku, Google App Engine, OpenShift or spin up a micro instance on EC2 and host it there.
Creating an executable is not the solution.
Why distribute it at all? If the user you want to use it is on the same local network as the Flask application, just give them the IP address and they can access it via a browser just as you are doing, and no access to the source code either!