Starting Django

Starting Django

Postby lewashby85 » Wed Sep 07, 2016 12:59 am

I thought I would give Python a chance at web development to see if it would be a good alternative to php but so far I'm pretty darn disgusted and discouraged, I'm hoping someone here can help me with that. I followed the link on youtube -> but it's only partially working. My site is located at `/var/www/html/django-test/mysite/` if I run `python3 runserver` and go to `localhost:8000` in my browser I see a default Django page, the part I can't get to work is getting this to run on apache alone. When I go to my browser and just try `localhost/django-test/mysite/` all I get is the directory structure in the browser as if I was viewing a ftp server in my browser. I followed all the instructions shown on the youtube video above but I can't get this to work. Below are some of my configurations.

TAIL END OF -> /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>

DocumentRoot /var/www/html/django-test/mysite
WSGIScriptAlias / /var/www/html/django-test/mysite/

ErrorLog /var/www/html/logs/error.log
CustomLog /var/www/html/logs/custom.log combined

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

LAST LINE OF /etc/apache2/apache2.conf
WSGIPythonPath /var/www/html/mysite

Even if I get this to work, this is a lot to setup and remember each time I want to start a project compared to php. Any and all help appreciated.
Last edited by micseydel on Wed Sep 07, 2016 3:43 am, edited 1 time in total.
Reason: Initial post lock.
Posts: 2
Joined: Tue Sep 06, 2016 11:28 pm

Re: Starting Django

Postby Crimson King » Wed Sep 07, 2016 9:51 am

Hey lewashby,

On your apache2.conf file you wrote WSGIPythonPath /var/www/html/mysite on the last line. According to your directory structure, shouldn't that be /var/www/html/django-test/mysite ?

Let us know if that worked for you.

User avatar
Crimson King
Posts: 166
Joined: Fri Mar 08, 2013 2:42 pm
Location: Dublin, Ireland

Re: Starting Django

Postby lewashby85 » Thu Sep 08, 2016 1:14 am

Thanks, but I made the appropriate change and the result was the same. I'm still just getting a directory tree I can navigate from the browser.
Posts: 2
Joined: Tue Sep 06, 2016 11:28 pm

Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests