Hi Anthony, Jim, The application is not compiled. I was trying to use routes files attached (applevel and web2py level) which I removed completely and still the error persists. They are not even in the application directory. I do think that before using the routes the application was working fine.
Here is the code for one function. There are multiple functions failing almost 20+ which were all working flawlessly before. No changes done to these. Function in default.py controller def cat_grid(): # Security Check: Checks for a valid session checksession() ## New Category Grid ---- db.cat.id.readable=False ### Query query = db((db.cat.workspace == user_workspace)) fields = (db.cat.categories, db.cat.workspace, ) headers = {'cat.catagories' : 'Category Name', 'cat.workspace' : 'Workspace', } default_sort_order = [~db.cat.categories ] links = [ lambda row: A(SPAN(_class='icon magnifier'),'View',_class='btn btn-small btn-default', _title='View Record',_href=URL("default","view_cat", args=[row.id])), lambda row: A(SPAN(_class='icon downarrow'),'Update',_class='btn btn-small btn-default', _title='Update Record',_href=URL("default", "update_cat",args=[row.id])), lambda row: A(SPAN(_class='icon downarrow'),'Delete',_class='btn btn-small btn-danger', _title='Delete Record',_href=URL("default", "delete_cat",args=[row.id])), ] catgrid = SQLFORM.grid( query=query, fields=fields, headers=headers, orderby=default_sort_order, user_signature=False, searchable=True, sorter_icons=(XML('↑'), XML('↓')), create=False, deletable=False, editable=False, csv =True, maxtextlength=64, paginate=10 ,ui='jquery-ui', links=links, details=False) #form category form_cat=SQLFORM(db.cat, submit_button='Save Category') if form_cat.accepts(request.vars,session): response.flash='New Category Added' elif form_cat.errors: response.flash='Form has errors' else: pass return dict(catgrid=catgrid, form_cat=form_cat) Checksession only checks for basic session validity and redirects the user to a certain url. def checksession(): if(logged_in_user==None): redirect(URL(r=request, f='login')) #print "Errors! No sesions defined." else: pass View is simple cat_grid.html in this case and is available in views\default\ folder {{extend 'layout.html'}} <div id="wrapper"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <i class="fa fa-cubes fa-fw"></i> Category List <div class="pull-right"> <div class="btn-group"> <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"> Actions <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{=URL('Target','default', 'configure_target')}}"><i class="fa fa-arrow-circle-left fa-fw"></i>Back</a> </li> </ul> </div> </div> </div> <!-- Adding Bootstrap Tabbing support --> <div class="tabbable"> <ul class="nav nav-tabs"> <li class="active"><a href="#tab1" data-toggle="tab">Category List</a></li> <li><a href="#tab2" data-toggle="tab">New Category</a></li> </ul> </div> <div class="tab-content"> <!-- Data for tab1 and setting the tab1 as active --> <div class="tab-pane active" id="tab1"> {{=catgrid}} </div> <!-- Tab content Data for tab2 --> <div class="tab-pane" id="tab2"> {{=form_cat}} </div> {{pass}} {{pass}} <!-- </ul> --> </div> </div> <!-- /.panel-body --> </div> </div> </div> </body> Note: I even uninstalled and updated my python version 2.7.13 (latest 2.7.x version). Also now I have just tried with latest web2py version 2.15.3. IE11 cache cleared. Same results on chrome. Let me know what might have gone wrong. Thanks, Rahul On Monday, August 14, 2017 at 8:11:22 PM UTC+5:30, Anthony wrote: > > Has the app been compiled? What happens if you reload routes or restart > the web server? > > On Monday, August 14, 2017 at 8:53:51 AM UTC-4, Rahul wrote: >> >> Hi All, >> I have an app and Off late I am strangely getting below error when >> accessing a page. I have the cat_grid function in by controller(default.py) >> as well have* .html *file in views. >> >> 1. Request URL: >> http://127.0.0.1:8000/Target/default/cat_grid >> 2. Request Method: >> GET >> 3. Status Code: >> 404 NOT FOUND >> 4. Remote Address: >> 127.0.0.1:8000 >> 5. Referrer Policy: >> no-referrer-when-downgrade >> >> I see this in the browser (chrome) >> invalid function (default/cat_grid) >> >> It was all working previously. However I am not sure how come I am >> getting this error for almost 60% of my functions. No ticket is thrown. I >> am confused as to what got changed. I am using web2py 2.14.6 stable. I did >> install a few plugins and then removed those too. but this is really >> annoying as I cannot figure out why it aint working. Please suggest this >> is killing me and my time badly. Any help and pointers would be highly >> appreciated. >> >> >> Rahul D. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*- # This is an app-specific example router # # This simple router is used for setting languages from app/languages directory # as a part of the application path: app/<lang>/controller/function # Language from default.py or 'en' (if the file is not found) is used as # a default_language # # See <web2py-root-dir>/router.example.py for parameter's detail #------------------------------------------------------------------------------------- # To enable this route file you must do the steps: # # 1. rename <web2py-root-dir>/router.example.py to routes.py # 2. rename this APP/routes.example.py to APP/routes.py # (where APP - is your application directory) # 3. restart web2py (or reload routes in web2py admin interfase) # # YOU CAN COPY THIS FILE TO ANY APPLICATION'S ROOT DIRECTORY WITHOUT CHANGES! # -*- coding: utf-8 -*- from fileutils import abspath from languages import read_possible_languages #possible_languages = read_possible_languages(abspath('applications', Target)) #NOTE! app - is an application based router's parameter with name of an # application. E.g.'welcome' routes_in = ( (r'/', r'/Target/default/index'), #(r'/images', r'/app1/images/images_list'), #(r'/contact', r'/app1/default/contact_form'), ) routes_out = [(x, y) for (y, x) in routes_in] routes_onerror = [ ('init/400', '/init/default/login'), ('init/*', '/init/static/fail.html'), ('*/404', '/init/default/handle_page_error'), ('*/*', '/init/error/index') ] #NOTE! To change language in your application using these rules add this line #in one of your models files: # if request.uri_language: T.force(request.uri_language)
# -*- coding: utf-8 -*- # This is an app-specific example router # # This simple router is used for setting languages from app/languages directory # as a part of the application path: app/<lang>/controller/function # Language from default.py or 'en' (if the file is not found) is used as # a default_language # # See <web2py-root-dir>/router.example.py for parameter's detail #------------------------------------------------------------------------------------- # To enable this route file you must do the steps: # # 1. rename <web2py-root-dir>/router.example.py to routes.py # 2. rename this APP/routes.example.py to APP/routes.py # (where APP - is your application directory) # 3. restart web2py (or reload routes in web2py admin interfase) # # YOU CAN COPY THIS FILE TO ANY APPLICATION'S ROOT DIRECTORY WITHOUT CHANGES! # -*- coding: utf-8 -*- from fileutils import abspath from languages import read_possible_languages #possible_languages = read_possible_languages(abspath('applications', Target)) #NOTE! app - is an application based router's parameter with name of an # application. E.g.'welcome' #app1 routes_app = ( #(r'.*?:https?://www.app1.com:\w* /$anything', r'app1'), #(r'.*?:https?://app1.com:\w* /$anything', r'app1'), (r'.*?:http?://127.0.0.1:\w* /$anything', r'Target'), ) #NOTE! To change language in your application using these rules add this line #in one of your models files: # if request.uri_language: T.force(request.uri_language)