On 9 April 2010 19:41, MMRUser <[email protected]> wrote: > Thanks I managed to fix the problem, now I need to know how to server > static media on Apache. Before I used Django development server and > made some configurations to serer static media (settings.py and html > files), so I want to know, are those settings need to change or > remove, and the proper way of serving static media. I used the Alias > directory.. > > Alias /templates/ "sites/testproject"
The last argument must be an asbolute path, what you have isn't. There must also be a trailing slash on last argument. > <Directory "sites/testproject"> Not an absolute path here either. See examples in: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_Files This isn't a mod_wsgi issue per say, so also go look at Apache documentation on Alias directive. BTW, when using Django, the static files are those found under /media URL. Why are you using 'templates'? The Django integration guide at: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango shows the static media serving example as well specific to Django. Graham > Order allow,deny > Allow from all > </Directory> > > But this didn't go well.. > > On Apr 9, 1:16 pm, Graham Dumpleton <[email protected]> > wrote: >> On 9 April 2010 17:09, MMRUser <[email protected]> wrote: >> >> >> >> > I'm getting an import error on my server's log >> >> > raise ImportError, "Could not import settings '%s' (Is it on sys.path? >> > Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) >> > ImportError: Could not import settings 'myproject.settings' (Is it on >> > sys.path? Does it have syntax errors?): No module named >> > myproject.settings >> >> > but I appended it correctly in my django.wsgi script >> >> > import os >> > import sys >> >> > os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' >> >> > sys.path.append('F:/Apache Software Foundation/Apache2.2/sites/ >> > myproject') >> > import django.core.handlers.wsgi >> > application = django.core.handlers.wsgi.WSGIHandler() >> >> > Can't figure out the reason... >> >> > Python 2.6 >> > Apache 2.2 >> > mod_wsgi 3.0 >> >> You added the wrong directory, should be the parent directory of the >> site, not the site directory itself. >> >> This is explained in: >> >> http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango >> >> But better than that, have a big read of: >> >> http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html >> >> and use the WSGI script described at the end of the latter, it may >> save you a lot of potential problems. >> >> Graham > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
