robertabranca Posted June 18, 2012 Share Posted June 18, 2012 Hi, Why does my URL point to my directory of files instead of to my index page? How do I name/place my index page so that it becomes the page people see when they enter the URL www.yourtrustedlibrarian.net? Roberta Branca Quote Link to comment Share on other sites More sharing options...
Byron Posted June 18, 2012 Share Posted June 18, 2012 I'm seeing your index page. Clear your cache. Quote Link to comment Share on other sites More sharing options...
medreda Posted July 4, 2012 Share Posted July 4, 2012 Hello I have the same problem And after clearing the cache it is the same thing Quote Link to comment Share on other sites More sharing options...
Byron Posted July 5, 2012 Share Posted July 5, 2012 @medreda: Post your page url. Quote Link to comment Share on other sites More sharing options...
medreda Posted July 5, 2012 Share Posted July 5, 2012 here it is: pydevstore.co.cc So, the broblem is how to make the server run my python/django app. For more information, here is my /public_html/expert2/dispatch.wsgi file: import os, sys sys.path.append("/home1/medreda/public_html/expert2")os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'os.environ['PYTHON_EGG_CACHE'] = '/home1/medreda/.python_egg_cache' import django.core.handlers.wsgiapplication = django.core.handlers.wsgi.WSGIHandler() and my /public_html/expert2/.htaccess file : RewriteEngine OnRewriteBase /RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ medreda/dispatch.wsgi/$1 [QSA,PT,L] and my /public_html/.htaccess file: # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST>order deny,allowdeny from allallow from all</Limit><Limit PUT DELETE>order deny,allowdeny from all</Limit>AuthName pydevstore.co.ccAuthUserFile /home1/medreda/public_html/_vti_pvt/service.pwdAuthGroupFile /home1/medreda/public_html/_vti_pvt/service.grpOptions -Indexes By the way, is it normal to have 2 .htaccess files as i have shown ? Quote Link to comment Share on other sites More sharing options...
Byron Posted July 5, 2012 Share Posted July 5, 2012 You originally posted because your files were showing in your index. You need to create an index file, either index.html, index.htm, index.php, etc. You can have several .htaccess files on your site. I have no idea what could be wrong with your python/django app. Quote Link to comment Share on other sites More sharing options...
medreda Posted July 5, 2012 Share Posted July 5, 2012 thanks any way Quote Link to comment Share on other sites More sharing options...
Byron Posted July 5, 2012 Share Posted July 5, 2012 If you'll add this to your root .htaccess file, it will stop directory listing without creating an index file: -Indexes Unzip this django test on your site: http://area51.heliohost.org/djangotest.zip and then edit the dispatch.wsgi in two places to match your site's path. Also make sure the path to PYTHON_EGG_CACHE is correct and be sure to chmod it to 777. Quote Link to comment Share on other sites More sharing options...
medreda Posted July 6, 2012 Share Posted July 6, 2012 Thanks for assistanceyour files doesn't work for me. But, i've some half solution:i just used 2 htaccess, one in public_html folder with this code: RewriteEngine OnRewriteBase /RewriteRule ^(media/.*)$ - [L]RewriteRule ^(admin_media/.*)$ - [L]RewriteRule ^(dispatch\.wsgi/.*)$ - [L]RewriteRule ^(.*)$ /dispatch.wsgi/$1 [QSA,PT,L] and the other in my project folder: RewriteEngine OnRewriteBase /RewriteRule ^(media/.*)$ - [L]RewriteRule ^(admin_media/.*)$ - [L]RewriteRule ^(dispatch\.wsgi/.*)$ - [L]RewriteRule ^(.*)$ expert2/dispatch.wsgi/$1 [QSA,PT,L] and dispatch.wsgi file like this; import os, sys sys.path.append("/home1/medreda/public_html/expert2") ### EDIT LINE ABOVE TO YOUR SITE ### os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'os.environ['PYTHON_EGG_CACHE'] = '/home1/medreda/.python_egg_cache' ### YOU NEED TO CREATE THE DIRECTORY ABOVE ### def application(environ, start_response): """Simplest possible application object""" output = "Hello World from hosted WSGI" status = '200 OK' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] It gives me : Hello word in my browser with this URL pydevstore.co.cc(for information it doesn't call any web app here). But when i use this code for the wsgi file (given in the example): import os, sys sys.path.append("/home1/medreda/public_html/expert2") ### EDIT LINE ABOVE TO YOUR SITE ### os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'os.environ['PYTHON_EGG_CACHE'] = '/home1/medreda/.python_egg_cache' ### YOU NEED TO CREATE THE DIRECTORY ABOVE ### import django.core.handlers.wsgiapplication = django.core.handlers.wsgi.WSGIHandler() it gives an error (when i call my django app) So could you say what does it mean, please Quote Link to comment Share on other sites More sharing options...
Byron Posted July 6, 2012 Share Posted July 6, 2012 If it doesn't work for you then you've got something wrong. Here's those files on one of the heliohost test sites: http://area51.heliohost.org/djangotest/dispatch.wsgi You probably need to start from scratch and then go from there. Quote Link to comment Share on other sites More sharing options...
Ice IT Support Posted July 30, 2012 Share Posted July 30, 2012 @medreda I received a 500 error upon viewing your site. Are your .htaccess files configured correctly? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.