Carl A. Posted December 12, 2011 Posted December 12, 2011 I have finally been able to make my hello-world django-app run. But this is only running when the project package is removed everywhere:in settings.py:ROOT_URLCONF = 'urls'instead of 'PROJECT-NAME.urls', which I use in the development side.also in the urls.py, all the referred classes require to have the project package removed. I'm sure it must be possible to use the project package, too!?! Could anyone point me to where this might be changed?
Carl A. Posted December 14, 2011 Author Posted December 14, 2011 dispatch.wsgi:import os, sys sys.path.append("/home/agon/public_html/udb"); os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' os.environ['PYTHON_EGG_CACHE'] = '/home/agon/.python_egg_cache' import django.core.handlers.wsgi _application = django.core.handlers.wsgi.WSGIHandler() def application(environ, start_response): environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO'] # Line X return _application(environ, start_response)If I have it like this, the urls fromROOT_URLCONF = 'udb.urls'cannot be found.If this value is changed toROOT_URLCONF = 'urls'then the page can't be found (404). In this thread, kuloto points out that it was helpful to comment out the "Line X" (see above).If I do this usingROOT_URLCONF = 'udb.urls'then again the udb.urls cannot be found.When usingROOT_URLCONF = 'urls'I have to remove the "udb" package from the classes/functions inside urls.py and THEN it works.(otherwise I'll get a ViewDoesNotExist inside urls.py). But as I wrote in the previous post, I would liketo keep the base/project package 'udb'. I hope this helps.
Guest xaav Posted December 14, 2011 Posted December 14, 2011 Change your dispatch.wsgi to this: import os, sys sys.path.append("/home/agon/public_html/udb"); sys.path.append("/home/agon/public_html"); os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' os.environ['PYTHON_EGG_CACHE'] = '/home/agon/.python_egg_cache' import django.core.handlers.wsgi _application = django.core.handlers.wsgi.WSGIHandler() def application(environ, start_response): environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO'] # Line X return _application(environ, start_response)
Carl A. Posted December 17, 2011 Author Posted December 17, 2011 Greatness! It works, but I still have to have the Line X commented out.Otherwise it will give a "Page not found" (404) error. I'm happy enough though.Many thanks. (May be marked [solved])
Krydos Posted December 18, 2011 Posted December 18, 2011 Glad your question got answered! Please spare a few minutes to take our brief survey: http://feedback.heliohost.org/ Your participation in this survey is greatly appreciated. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now