How do I keep Django running on on my web server? [closed] - python

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am using dreamhost, and just finished a (as far as I can tell) successful installation of DJango on my VPS using Passenger.
Everything was installed from the shell via SSH - and I even launched the server using the command: python manage.py runserver 0.0.0.0:8888
There are 2 issues I am having with this:
Issue 1 (minor)
I have to access my domain at example.com:8888 - though I assume this could be fixed with some URL rewriting - yeah?
Issue 2 (relatively major)
As soon as I kill the terminal (ending my session) my site becomes inaccessible - how do I keep that from happening?

runserver is intended for development, not production. For running production Django applications on Dreamhost, see the Django page on their wiki.

Dreamhost doesn't allow long running processes, they are killed off quite aggressively, you will have to run it on a per connection basis using Passenger WSGI.

Related

If I'm deploying a Django website with Nginx, do I need a service such as Digital Ocean on top of that? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to launch a website I've written in Python/Django. I want to host it on an Nginx Web Server. However I'm not sure if I need a service such as Digital Ocean or Heroku. What benefits do these services provide that I can't get with only Nginx?
To run website you need to own machine with static ip address. It can be your own machine or you need remote machine provided by DigitalOcean, Heroku, AWS or other similar service.
Then you need to run nginx on this machine. But nginx only acts as proxy and it is not enough to run Django application. You need some wsgi server behind nginx, for example gunicorn.
Take a look at this article to understand more.

What is the difference between deploying application with Heroku or Personal VPS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to deploy my application but did not know which is the best:
Using Heroku or Using a VPS ?
Regards;
Let's assume by VPS you mean AWS.
Heroku runs on AWS.
What Heroku does is it makes your deployment easier for you. You don't have to install dependencies, you don't have to run load balancers, you don't have to do anything more than a
'git push'. This is good if all you want to do is check how your code runs during development.
However when going deploying your code for production, it would be better if you use a VPS service like AWS. It gives you much more control over the environment in which your code runs and will be easier to add tweaks.

Web2py launch script [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need a launch script which has access to "db" and other web2py modules. This script must be running constantly. I know that Web2py has launch parameters from which you can run python files in the web2py enviroment, but i don't know how that works. Can this parameter solve my problem and if so, how do I go about it? Thanks!
Look at section 4.17.1 of the web2py manual (or Google "web2py cron").
You can run a script on startup of web2py by registering it in the crontab file as:
"#reboot web2py *scripts/myscript.py"
web2py should be the username that it will run as, which should be the same as what web2py runs as. In my setup I have a user named 'web2py' to run the app.
The asterix before scripts/myscript.py indicates that you want to run the script in the web2py environment.
Keep in mind that you run the risk of locking issues if your script is trying to use the database at the same time as the normal web2py process.

Why my Django server not work suddenly? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am woking on Ubuntu 12, python2.6 and Django1.2.x which is my test server.
And I run a Django project on my test server using below command:
python manage.py runserver 0.0.0.0:8000
The server can work for most time(I let it run on 7X24 for other teammate to access it), but sometime it would suddenly not work:
Browser shows me that "server not available" when I try to access it.
And of course, the test server cannot get any request from my frontend, and no error throws on server side.
All will back to OK once I using my django project and run it again.
now I have 2 question:
Why does this issue happend?
How can I develop a shell script to detect this situation?
Actually, it looks like you're trying to use Django development for production purposes. There may be a lot of explanations, like apparmor config, or limitation of single-threaded server, but the problem doesn't worth investigating. Just install Apache2, or Nginx, or uwsgi, and that's it, you have good and stable server without shell watchdogs and other kludges. It would probably take about the same time as posting to SO

Does any webhosting service that supports python also supports django? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to learn python/django, these are installed on my desktop computer and all the examples run fine. My question is: If a webhosting service supports python (2.4), does the webhosting service supports django by default?
Thanks guys.
You can use Google App Engine, which is free and includes Django.
Yes, but if they only support Python via CGI then your application will be very, very slow. Best is WSGI, then FastCGI, then mod_python.
Not necessarily.Many web hosting companies(shared) claim to offer django but this is a big lie.Case in point,a2hosting claims to have django but don't offer it;its disallowed.I tried to compile my own python and install django and found out that that path is also closed.
Django is memory intensive and will only work on vps and dedicated accounts.Web faction though is the only web host that wont lie to you.
Try Fornex VPS. https://fornex.com/vds/
I use it and like very much. Month payment starts from 5 euros. And you can install apache 2 + wsgi.

Categories