Install Django on Apache with mod_wsgi on Linux

BSDtutorial · 62K views · 2012 · 33:32

Open on YouTube

Web developmentCloud, DevOps & reliabilitytutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they followed when first deploying a Django project with Apache and mod_wsgi, usually in questions about errors that came up afterward.

Recommended by 1 people across 1 different months, 2013 to 2016.

What it is

A 33-minute screencast from the BSDtutorial channel showing how to install Django behind Apache using mod_wsgi on a Linux server. It walks through installing the packages, writing a WSGI script and creating an Apache virtual host.

What people said

Recommends user1834437 · 2014-01 · Stack Overflow · on “Django on apache wtih mod_wsgi (Linux) - 403 Forbidden”

Alright, so i am following this [this video] tutorial. When i try to access my site through my local server i get this peculiar error: Forbidden You don't have permission to access / on this server. Apache/2.4.6 (Ubuntu) Server at mysite.com Port 80 . Αs far as i am concerned i have done everything right (i implemented twice the proposed method) and this could easily be an OS error (i am running Mint 16 and error says (Ubuntu) ), however i am not experienced and therefore i need some help. I did some research but none of these ( 1 [LINK] , 2 [LINK] ) questions along with others, does not seem to answer my case. So here is mysite.conf file: <VirtualHost *:80> WSGIScriptAlias / /home/nick/Mysite/my

Cites user2078888 · 2013-02 · Stack Overflow · on “Django + Apache - wsgi trouble”

I've been working with Django locally and now I'm trying to push some code to a production Apache environment on an Ubuntu server I have running ( [this video] ). However, I just get a list of files in the directory and nothing else. First of all I ensured that Python was install by running the command Python at the terminal. I've installed apaache and mod wsgi with the following commands: sudo apt-get install apache2 sudo apt-get install libapache2-mod-wsgi And I've tested to see that its enabled. Here is my wsgi file firstweb.wsgi which is located in root: import os import sys sys.path.append('/var/www/firstweb') os.environ['DJANGO_SETTINGS_MODULE'] = 'firstweb.settings' import django.core.hand

Cites martintrapp · 2013-12 · Stack Overflow · on “Django + mod_wsgi - How to disable access to files outside of project folder?”

I'm not at home right now, I followed this tutorial to setup my vhost: [this video] "open and print out" - I meant that I was able to read the content of the file with my django app.

Cites Deepend · 2014-06 · Stack Overflow · on “Django application not visible”

I am trying to deploy a Django application for the first time using mod_wsgi with Apache on a Ubuntu 12.04 VM. I have been following several tutorials, especially Ayman Farhat blog [LINK] , this excellent YouTube video [this video] and of course the official Django Documentation This follows an earlier question I posted here [LINK] wondering why my Django survey did not simply work when I uploaded it to the /var/www/ (blush!) I have since been looking into mod_wsgi as per the answers. I'm not sure what stage I am missing. The project is able to start on the server via python manage.py runserver with no errors. I have also ran python manage.py collectstatic with no errors. I then restart Apache wi

Cites Deepend · 2014-06 · Stack Overflow · on “Configureing mod_wsgi on Apache2 for Django project”

I am having some issues in configuring the various elements of a mod_wsgi setup. This is my fist time using mod_wsgi so I have been following several tutorials, the main one being a YouTube video Install Django on Apache with mod_wsgi on Linux [this video] . From what I understand after following the below steps I should at least see the Django 'It Works' page. Setup Ubunto 12.04 Apache 2.2.22 Python 2.7.3 Django 1.6 I have created a WSGI script file firstweb.wsgi in my home directory /home/firstweb.wsgi Its contents are import os import sys sys.path = [‘/var/www/firstweb’] + sys.path os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘firstweb.settings’ import django.core.handlers.wsgi application = django.

Cites Zia · 2015-02 · Stack Overflow · on “Deploying Django on Apache and WSGI”

Although I have found a bunch of tech support to deploy Django over Apache using WSGI but infact they all have confused me unfortunately, and I couldn't get the Django running. I hope this to be real easy job but being a new comer I am facing difficulties. I have two Django projects namely website1 and website2 inside my /home/zia/Documents/Codes/Django/website1 and ..../website2 dir, respectively. The folder containing settings.py file is root/ inside the /website1 and /website2 dir. Apache, mod_wsgi everything is installed as required. How to edit apache2.conf and wsgi.py file to keep these two projects running over port 8080 and 8081? I am struggling with this issue for past few days and

Cites ksr89 · 2015-05 · Stack Overflow · on “Deploy django app with domain and subdomains using mod_wsgi”

I am new to django and this is my first project in django. So far, I have developed a django app. It is working fluently in my local machine but I’m unable to deploy it online. I have seen many tutorials on internet for deploying the app on server. But none of them seems to be working to me. May be I’m doing something wrong over here. [this video] [LINK] [LINK] [LINK] I followed these tutorials and tried to deploy the app on the server but I always gets 403 forbidden error. I tried to remove this error and referred other stackoverflow answer as well but no success.. 403 Forbidden error with Django and mod_wsgi [LINK] Apache mod_wsgi error: Forbidden You don't have permission to access / on this s

Cites aniket · 2015-05 · Stack Overflow · on “Running django webapp on apache using mod_wsgi”

I am new to working with apache and mod_wsgi. But I do have little experience in django, so from some tutorials [this video] I tried to run django app through apache webserver using mod_wsgi. I created mysite in /var/www/ then in mysite/application I created application.wsgi ... import os import sys sys.path.append('/var/www/mysite/application') os.environ['PYTHON_EGG_CACHE'] = '/var/www/mysite/.python-egg' os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() and in /etc/httpd/sites-available I created file named mysite.conf ... <VirtualHost *:80> ServerName mysite.com ServerAdmin id@somewhere.com ServerAlias mysi

Cites KKlalala · 2016-08 · Stack Overflow · on “django deploy - ubuntu 14.04 and apache2”

[LINK] and [this video] This was the first time I deploy a website.And these are the tutorials I followed. Now I can access to the server(by typing 10.231.XX.XX) from other machine and see the Apache2 Ubuntu Default Page. Then I tried to access my django project. I run: python manage.py runserver 8000 Validating models... 0 errors found August 03, 2016 - 09:44:20 Django version 1.6.1, using settings 'settings' Starting development server at [LINK] Quit the server with CONTROL-C. Then I type 10.231.XX.XX:8000 to try to acess the django page. But I failed. It said: This site can’t be reached 10.231.XX.XX refused to connect. Search Google for 231 8000 ERR_CONNECTION_REFUSED I have tried every thing