Benjamin
Benjamin

Reputation: 1253

django apache setup troubles

I'm trying to deploy my new Django website onto an Apache2 server (running on a raspberry pi). Apache is running, and able to talk my app, but it isn't working properly; it's giving me a "Template not found error." It's trying to find the template/templates/main.html from my what I'm guessing is my drive root,

I was using the runserver command to develop everything and it was working perfectly. What I think the issue is that apache server is not running the WSGI script from the base of my application.

This is my hierarchy:

And Here is my site-available/default file:

<VirtualHost website.net:80>                                                          
    <Directory /var/www/website/website>                                  
            <Files wsgi.py>                                
                    Order deny,allow                              
                    Allow from all                       
            </Files>                                                
    </Directory>                                            
    ErrorLog ${APACHE_LOG_DIR}/website_error.log           
    CustomLog ${APACHE_LOG_DIR}/website_access.log combined                     
</VirtualHost>        

Any help is appreciated

Upvotes: 0

Views: 616

Answers (2)

Benjamin
Benjamin

Reputation: 1253

I wrote a tutorial on how to deploy Django w/ Apache and mod_wsgi. I figured if I was having troubles figuring it so, others probably are. It was written about two weeks back. If there are any corrections anyone wants to make on it, please tell me.

http://16bpp.net/pages/how-to-deploy-a-django-app-with-apache

Upvotes: 1

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

You cannot use os.path.abspath(). It relies on what the value of the current working directory is, which will not work under Apache. Go read:

Upvotes: 1

Related Questions