Yesterday I received my Raspbarri PI 3, which I ordered to experiment around. It's up and ruing with Ubuntu MATE, and coected to the network. Now I've got a few little Django projects (1.9) which I want to serve over the network for testing.
The problem is that when I attempt to access http: //nrzonline/ on my guest machine, it does show the files and folders of the on the server of the /home/www/nrzonline/ directory. But the files are plain text, and do not get executed as expected.
Currently I'll use the website 'nrzonline' as example:
<VirtualHost *:80>
ServerAdmin admin@server.com
ServerName nrzonline.nl
ServerAlias nrzonline
DocumentRoot /home/www/nrzonline/
WSGIScriptAlias /nrzonline/ /home/www/nrzonlne/nrzonline/wsgi.py
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/www/nronline/>
Options Indexes MultiViews
Options +ExecCGI
DirectoryIndex nrzonline/wsgi.py
AllowOverride All
Require all granted
</Directory>
AddHandler cgi-script .py
Alias /static/ /home/www/nrzonline/static/
<Location "/static/">
Options -Indexes
</Location>
</VirtualHost>
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('~/.virtualenvs/nrzonline/lib/python2.7/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('/home/www/nrzonline')
sys.path.append('/home/www/nrzonline/nrzonline')
os.environ['DJANGO_SETTINGS_MODULE'] = 'nrzonline.settings'
# Activate your virtual env
activate_env=os.path.expanduser("~/.virtualenvs/nrzonline/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
ease let me know if you need more details about the current setup, so I can add it to the question. Thank yo
127.0.0.1 localhost
[..cut..]
192.168.2.254 router
192.168.2.5 server nrzonline
# The following lines are desirable for IPv6 capable hosts
[..cut..]
Personally I think I'm on the wrong direction with enabling wsgi on apache2 , and invoking it within my available-sites/nrzonline.conf I Hope somebody can push me in the right direction where to take another good look at. Please let me know if you need more details about the current setup, so I can add it to the question.
Thank you.
برچسب:
نویسنده: استخدام کار