Deploying django websites in apache2 server - django

I am looking for step by step details of how to deploy django websites in apache2 server with one example.
I am using ubuntu operating system
Please give some link or give the details.

There is a manual on Django website. There is also information about integration on ModWsgi website.

Firstly I suggest to read official documentation here, then try to see also Django Book. And then if you face some problems, we SO is ready to help! :) Also I don't know if these instructions work (never tried, because it just first result showed by google), but you can try.

I guess you already have searched Stack Overflow for questions similar to the one you have posted. Anyway, I'd like to point out here a significant post I have found.
mod_wsgi in apache and django (with a link for ubuntu too)
Hope this help.

Related

Django multiple sites using nginx and gunicorn

I am serving multiple websites using nginx and gunicorn and I would like to add another one. Sadly my lack of experience is limiting me, I have some experience with webdesign but always struggle on the server side...|-( (I am using Django because of my Python preference in scientific analysis).
My problem: The new site seems to refer to the port used by another. Checking the gunicorn status I see that the site is running although nginx seems to be unable to refer to the correct Django folder. Could someone point me in the right direction? I have been looking around for the last hour or so...
(I didn't include any code for now as I am not sure where the error might lie at this point...)
Next day update: So I finally came across a post mentioning that the origin of the error might lie on the browser side. I deleted my recent history, this has fixed the error. I believe I somehow loaded a https certificate belonging to one of the other sites, this is no longer the case!
I came across the solution, it was a browser side fix. The answer is provided in an update to the original question.

Can we install django application without source code?

I have a requirement where I need to develop a Point of Sale system.
I want to know if it is possible to install that small point of sale app
on some machine without source code ?
Thanks for all suggestions.
I just thought I'd mention this for anybody that finds this question useful in the future.
There was a discussion about turning a Django webapp into a local app here:
https://groups.google.com/forum/#!topic/django-users/-VGqvHew35g
They provide some interesting solutions for converting the webapp into a local/desktop app.
Django is a web framework. There's no need to install any code on a client machine, since you would access it via a web browser.

So, how do I try other people's Django sample code? Case in point: django-allauth

Sorry that this is very much a beginner's question, but yes, I'm only just beginning to learn Django and now want to learn how to implement a user registration.
For that, it appears that django-allauth does what I'm looking for. I've managed to install it and its dependencies, but fail to setup the included example app.
So how to get the "example" app running? Is there a brief guide on how to install and try other people's Django samples? Googling around wasn't helpful, but I may be looking for the wrong keywords.
I'm grateful for some pointers.
In this particular instance, the example "app" is actually a full Django project. Just change to the example directory and run python manage.py runserver from there.
Example code that comes with a Django app is usually not meant to be directly runnable; you must read it and make the changes to your project in order to integrate the app.

Idiots guide to getting a django project onto the web please

Help! I think i've gone in a bit over my head. I'm making a website for a friend who has already got a domain/hosting on the website 123reg. Keen to learn them i've been picking up python and django as i go, figured getting it online would be no problem because 123reg supports python (unspecified version).
So far i've been doing everything with the django test-server locally, i went to look into uploading it somewhere as a test and realised there's an awful lot i don't know and even with google its a bit overwhelming.
I found this link which will help me later i'm sure but right now, could someone help me understand What is Apache? I thought the server was the hardware a site was physically hosted on but i can't understand it at all now.. So i download Apache and then what? Can i just copy it into the root directory for the website on 123reg? Is their an installer? Will 123reg allow it to "run" or "serve" or whatever word's appropriate or will there be permissions issues?
And then once that's sorted there's mod_wsgi to look into, a cursory glance at the installation guide shows commands to be run, which confuses me further as i was not aware that a standard host like 123reg have any sort of inbuilt console window to be run on in which case how are you expected to execute these commands?
And another thing I didn't really think through, I'm using the built in sqlite database technology.. How will i be able to install it on my webspace? and then how will that effect my django configuration? or maybe i'll have to change to MySql v5 which 123reg says it supports?
I know these must be idiotic questions, I just wasn't sure where best to ask for help and SO has one of the most helpful and knowledgeable communities around. I did try having a google but everything was a bit overly technical for me.
You can't upload a Django site using FTP on a shared hosting provider and expect it to run. You'll need to configure it to run with their installed Apache, including configuration like mod_wsgi.
I very much doubt that 123-reg support this. You are unlikely to be able to run a Django site there. You should look for a more Django-friendly site - I recommend Webfaction.
Apache is the webserver software. It's already running on their machines. Don't try and install it lol, or they will certainly laugh at you.
To "run commands" you need to get a remote shell (console). This is typically done via Secure Shell (SSH). See this page regarding 123reg specifically: How do I connect using SSH (Putty)?
Django supports different databases, including SQLite and MySQL. SQLite is typically for small, simple databases, as the "database" is really just a local file that is manipulated by the SQLite engine. MySQL is the database of choice for many websites.

Does Hostmonster support Django

I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
I know this is an old question, but here is the answer: yes, Hostmonster does support Django
There used to be this Hostmonster KB article for details, including instructions on how to set it up, but that link appears to be dead these days, and the only article about Hostmonster article about Django is about troubleshooting. You can find instructions on how to set up Django on Hostmonster elsewhere.
http://www.hostmonsterforum.com/showpost.php?p=20003&postcount=7
I tried the archive the user posted there, and it worked like a charm.
Hostmonster uses cPanel (possible with CentOS), just like other host providers. If you research into cPanel , you are more likely to get your answer.
Generally, the answer is "no" since out-of-the-box cPanel does not support python 2.5 or mod_wsgi. But it does support Apache2, so it's possible that hostmonster could use mod_wsgi to run sites built with Django.
Well, if it support Python, you might be able to run Django using a FastCGI setup, as described here: FastCGI Docs. If it supports mod_python (which I guess it's what you mean), then sure, you can install it using the steps listed here: ModPython docs
There is a Github repository for hostmonster and Django it helps me:
hostmonster-django.markdown