Thursday, June 26, 2014

Re: page not found errors for most urls but main landing page displaying okay

Is it possible that the app is getting confused because it is not running at the root of the domain (/) but instead on a subdirectory (/project/)?


On Wed, Jun 25, 2014 at 11:51 PM, Kelvin Wong <wongo888@gmail.com> wrote:
If you have access to your logs, check your logs to figure out where those requests are going.

You can also SSH into the server and temporarily turn on the DEBUG=True, TEMPLATE_DEBUG=True and let Django tell you what is going on.

Without seeing your fcgi script, my guess is that it is Apache not mapping the request to your WSGI file/fcgi script. Double check your htaccess file mod_rewrite directives.

K



On Wednesday, June 25, 2014 2:53:21 PM UTC-7, Lee wrote:
Thanks - it must be a problem with the site accessing templates but I can't figure it out. This django project works on another server but I have copied it to a shared host webserver  (Bluehost) and am running it with fcgi so maybe the problem is in the setup.

I am focusing on one url and template, but all have the same problem except the main landing page, which does work.

The url http://mysite/project/map/nav/ shows the right text without any styling
This is the url pattern for this page in urls.py.
url(r'^map/nav/$', 'citi_digits.views.mapNavigation', name='mav_nav'),

The view for this url references the template:
def mapNavigation(request):
    """
Loads the map navigation elements
"""
    #get all classes
    #get classes
    classes = Teacher.objects.values_list('className', flat=True)
    return render_to_response('map_navigation.html',{'classes':classes},context_instance=RequestContext(request))

In the settings.py the setting for templates is:
TEMPLATE_DIRS = (
    os.path.join(PROJECT_ROOT, '..', 'citi_digits','templates'),

I also tried an absolute path and put the templates in www but this did not work.

My static settings are:

STATIC_ROOT = '/home5/user/public_html/project/static/'
STATIC_URL = 'http://mysite.org/project/static/'

Lee



On Wednesday, June 25, 2014 3:36:52 PM UTC-4, Michael Lind Hjulskov wrote:
Hi

I had the exact same problem a few days ago. It was one of my templates that suddenntly was emty. very spooky
Or maybe you have an "extends" somewhere that is not correct
I would debug by looking in the relevant view and see which template is called, and the simplify that template to test if bug is in templates or elsewhere

Michael

Den onsdag den 25. juni 2014 21.08.35 UTC+2 skrev Lee:
I have copied a Django project to my web server from a repo and am getting the correct initial landing page for the website with the right styling when I go to the main URL. Most other urls give "page not found" errors. This includes the divs that are called on to make menus on the main page so the "Page not found" error is printing over the main landing page.

I'm not sure where to start with diagnosis - any thoughts would be appreciated.

I have checked the urls.py file and have tried to go directly to the URLs listed starting with http://mysite.org/project/ ...

urlpatterns = patterns('',
# index.html gives a page not found error
 url(r'^$', 'project.views.index', name='index'),


# These go to an unstyled page with correct text
    url(r'^signup/$', 'project.views.signUp', name='signup'),
        url(r'^login/$', 'project.views.login', name='login'),
        url(r'^logout/$', 'project.views.logout', name='logout'),


# These also give a page not found error

url(r'^$', 'project.views.index', name='index'),
url(r'^map/nav/$', 'project.views.mapNavigation', name='mav_nav'),
url(r'^interview/new/$', 'project.views.interviewSelect', name='interview_select'),
url(r'^interview/player/$', 'project.views.interviewPlayer', name='interview_player'),
url(r'^interview/retailer/$', 'project.views.interviewRetailer', name='interview_retailer'),
url(r'^popup/(?P<layer>.+)/(?P<neighborhood>.+)/(?P<perin>.+)/(?P<dol>.+)/(?P<sale>.+)/(?P<win>.+)/(?P<income>.+)/(?P<netwin>.+)/(?P<id>.+)/$','project.views.popup',name='popup'),


Lee

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2de669cf-c2cd-4013-b1ad-f54e73b5e933%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei0bOmfKfgk6M%2BJ%2BUxAQAdy4EmjkN_HcGCjQHGzwxS9vAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment