I don't know if it has anything to do with the problem, but am curious why you have your checksession() function and don't use the web2py decorators for ensuring a user is logged in.
http://web2py.com/books/default/chapter/29/09/access-control#Decorators Is there a common use pattern in the 20+ failing functions that isn't used in the functions that are still working? -Jim On Tue, Aug 15, 2017 at 6:48 AM, Rahul Dhakate <rahul.dhak...@gmail.com> wrote: > Hi Anthony, > Thanks for getting back. No changes were made that would break > the system so badly. > And although today I did copy the single project on the same machine but > with a newly setup web2py 2.15.3. > I will try using this project on another machine by configuring it from > scratch. > > Does using routes do any magic to web2py or its app by copying/changing > any file for routes as 404 is a strange error to get. Again there was a > plugin called like hot table or something which I had installed online from > plugin links and later removed it suspecting it might be the culprit but to > no avail. > > Thanks, > > Rahul. > > ======= > > On Aug 15, 2017 17:02, "Anthony" <abasta...@gmail.com> wrote: > > If you've removed the routes files and restarted the server and still have > problems, it's not clear what would be causing some but not all of your > URLs to stop working, assuming you've made no other changes to the system. > You may need to set up everything from scratch. Do you have another machine > you could try? > > Also, if you just want to set up a particular application (and controller > and function) as defaults, it is much simply to use the parameter-based > rewrite system. > > Anthony > > > On Tuesday, August 15, 2017 at 4:50:37 AM UTC-4, Rahul wrote: >> >> 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","v >> iew_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","d >> elete_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 a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/to > pic/web2py/VvdzRTGdNDU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > > -- > 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 a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/web2py/VvdzRTGdNDU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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.