How to constantly run a python script on a Webserver - python

I have just coded a trading algorithm and some analytics software for the stock market which in itself works fine.
Since my computer is not always running or internetconnection is not running perfectly I would like to source the script out and put it on a Webserver for example, where it would run all day and night.
Do you guys now I could do that?
I would also like to build a user interface using django to monitor live performance.
Does anybody know what would be necessary to implement these steps?
Thanks in advance and kind regards
Marcel Kresse

This is very general question and the answer is close to "sky is the limit". As mentioned above, any cloud service provider will do.
Most (if not all) clouds have dedicated images for web servers and Django deployments. Have fun.

Related

Want to Use Whisper in My Flutter Project and Not Sure Where to Start

First I'd like to say that I know similar questions about calling Python code in Flutter have been asked before, but I think this particular case has some challenges.
Some notes about the app I'm aiming for:
Basically a note taking app, records a lecture or meeting or whatever and transcribes the text for you, with a few extra features thrown in. I'd like to have all speech being processed locally both to ensure it works offline and reduce the app's dependence on cloud services.
I'm trying to use Whisper, a new speech to text software that processes everything locally, which is a necessity for my app. I know I could make a Flutter plugin but I'm not sure if that's the best route to go about this for a few reasons:
I haven't done it before, so it would be quite a time investment to do this and just hope it works out.
One of the ways I've seen of doing this involves sending data over http between Python and Flutter, but Whisper would need a continuous stream of audio to work properly which I'm not sure this approach is suited for.
I'd really like to have 1 codebase that runs on any device.
I'd be fine with the app only working on pc for now, but I'd like to also have it working on Android and maybe IOS if reasonably possible. Any other routes I can take towards development are great too but I'd really like to stick with Flutter for this app if I can.
Just found that one: https://github.com/azkadev/whisper_dart
Did not tried it until now but seems to be worth the try.

Run python code in cloud without stopping

I have python code that depends on specific libraries like selenium and interaction with google chrome to extract data from the web.
my code works fine but i need a lot of records to do analysis, so i can't leave my computer on, to run the script for a month.
That's why I thought of running the script in a cloud service like aws but I don't have a clear idea of ​​how to do it, because I need the script to not stop
and I would rather not have to pay for it (or at least not that much money)
That said, my code opens a website, looks for a specific text data and saves it in a csv document.
I thank you in advance for the help
You will have to check the terms of each cloud service as many do have downtime/restarts on their free tiers.
The kind of task you're describing shouldn't be very resource hungry, so you may be better off setting up your own server using a Raspberry Pi or similar.

Real time co-editing notebook plataforms

I work as a DS in a ver small company, so all of the DS team is very "young" in this field.
We are currently experiencies issues with cooperation, especific at the writing code moment.
We've tried with VScode live share which is a great extension but, due to our pc's limitations goes hard to work when we are working with big df.
I was looking over deepnote, which sounds really great, but is has no support with MSsql server.
so, any alternative? Also we're thinking in cloud migration, like azure or AWS, but I was unable to find a proper way to do it or if there we can work in real time co-editting
so, any help or advice?

How to architect a web-based, 3D product designer using Blender?

So I'm trying to create a 3D web product designer similar to:
Zazzle's Custom iPhone Builder:
http://www.zazzle.com/case_mate_iphone_5_5s_vibe_case_iphone_5_5s_case-179139058105217167
ShoesOfPrey: https://www.shoesofprey.com/3d/designer?p=20600P4
It seems that the 3D modeling (skinning, colors, etc) is done server side, with jpeg snapshots taken at a few angles and passed to the client. I have a blender script that does this on my computer, but I'm not sure what rendering engine they are running or how they are hosting it.
I would like to re-create this functionality exactly with other custom products (mugs, clothing, etc). I'm not worried about the front end design tools nor editing the 3D model with user inputs. I plan on using Django and Blender + python scripts to spit out images.
I want to know how to properly architect this app to get a working Version 1 prototype. I'm familiar with Django and front-end design tools, but have little to no experience with networking, hosting, scaling, setting up workers, load balancing, task queuing, passing data from render farm to django, etc.
That might be a bit too open ended, so I'll try to be more specific. Apologies for the noobness:
Question 1: What's a good hosting service for blender that lets me run the python scripts?
Question 2: Would Celery come in handy anywhere here? Not too sure about what it does or why it's important.
Question 3: Ideally, I'd like users to see a resulting image in <=1 second (doesn't have to be as fast as the examples). The app would need to handle maybe 100 simultaneous users at a time. Would I need a render farm, or can any server running python handle this load?
If there's anything I'm overlooking, please let me know! This is also my first stackoverflow post, and I'm a little disappointed in myself that it is a vague question without any code :(.
EDIT-- Question 4: A possible tech stack suggestion (Django + Blender + ???) that could be used to make a project like this would be helpful in getting me off the ground and looking into the right places for answers.

Django: vps or shared hosting? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you're new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?
I've been using Webfaction for shared hosting of Django. The price is pretty decent, they have good forums, and have a nice web-based interface to help get you setup. Despite the web interface, it doesn't impede you from having full control over your site form the command line. You can host all sorts of things, from Django to Rails, to PHP, and mysql. For smaller sites, it works nicely. I'm not sure how the performance works under high load, but you can always start small and upgrade to a vps. I've never had direct contact with the support personel there, but the documentation seems good. I don't mean for this to sound like a plug, but it's been pretty good for shared hosting. If you have any questions about it, I'll be glad to answer.
Django runs on GoogleAppEngine but php doesn't.
Your Django code will have to use Google's datastore models instead of Django's usual ORM, so there is some tie in to GAE - if you decide you want to host your own app later on it could be quite a lot of work.
If you go with a VPS obviously you can run Django and php together, but you'll need to choose a webserve, maybe a firewall, maybe load balancing later on.
Clicks per day isn't really useful, you need to know how many clicks per second you get at peak time.
Cheap hosting providers will provide less help than expensive ones.
Is one VPS going to be enough? What is the impact if it goes down? It's harder to do major upgrades if you only have one server.
With a VPS you need to back your data up somewhere. The hosting may do offsite backups for you, but it's a good idea to have some yourself too.
I don't know how easy it is to backup your data from GAE, but it's probably a good idea if the data is valuable.
Should i know something else to make a decision?
Django (albeit a subset) runs on Google AppEngine:
free for starters and pay as you grow.
auto-scale
resilient (backups are "automatic" i.e. datastore)
The drawback of course is you only have Python and Java as options...
If you want to know about setting up a VPS for Django:
Here's a blogpost about it. I used it when deploying a couple of Django-sites (and, yes, you can use Django+PHP and other stuff - I used Wordpress on the VPS too!).
I had never used a VPS before, and it was very easy to follow this guide.
Given your requirements, I would give it a try to hosting Django on Amazon EC2. If you take advantage of their free tier you can do so free for one year in a micro instance (618Mb RAM, 30Gb filesystem). You get full control of the machine, including SSH access. There are a number of freely available images that already bundle Django including the BitNami Django Amazon Machine Image which is also available for free (disclaimer: I am one of the BitNami developers). As your requirements change, it is relatively easy to resize the server to make it bigger without having to reinstall everything
Don't forget Heroku for simple django needs. Perhaps the easiest deployment out there and no need to figure out servers/ports etc.
Heroku is okay when you are starting small, but if you start getting popular - make sure you watch your usage lest you get a nice surprise on your credit card bill.
Some positives that you may not get with other more traditional providers:
Ability to run the latest version of django and other libraries.
By far and wide, the simplest deployment out there - there is definitely their killer feature.
Who doesn't like free postgresql?
A large menu of third party services that are already integrated with them. You just sign up and a few lines and a git push later you are up and running.

Categories

Resources