Web2Py Interview Questions & Answers

  1. Question 1. What Is Web2py Framework?

    Answer :

    Web2py is an open source web application framework. It is written in the Python programming language. It allows web developers to design and develop dynamic web application.

  2. Question 2. How Can We Install Web2py In Different Operating System?

    Answer :

    We can install Web2fy in different operating system by using following code:

    Operation System : Unix and Linux,OS X,Windows

    Command : python web2py.py,open web2py.app,web2py.exe

  3. Python Interview Questions

  4. Question 3. What Are The Protocols Supports In Web2py?

    Answer :

    Web2py supports various protocols like: XML, JSON, RSS, CSV, XMLRPC, JSON RPC, AND RPC, and SOAP.

  5. Question 4. How To Write A Hello World Program In Web2py?

    Answer :

    We can write a hello world program by using following code:

    def hello():  

            return ‘Hello World’  

  6. Python Tutorial

  7. Question 5. Who Is The Author Of Web2py?

    Answer :

    Massimo Di Pierro developed the author of Web2py.

  8. MySQL Interview Questions

  9. Question 6. What Is The Stable Version Of Web2py?

    Answer :

    Web2py stable version is 2.14.6 which is released on May 10, 2016.

  10. Question 7. What Are The Application Components Of Web2py?

    Answer :

    Web2fy consists of the following components:

    • Models: It represents data and database tables.
    • Views: It helps rendering the display of the data.
    • Controllers: It describes the application logic and workflow.
    • Languages: describe how to translate strings in the application into various supported languages.
    • Static files: Do not require processing (e.g. images, CSS style sheets etc).
    • ABOUT and README: It provide details of the project.
    • Errors: It stores error reports generated by the application.
    • Sessions: It stores information related to each particular user.
    • Databases: It store SQLite databases and additional table information.
    • Cache: It store cached application items.
    • Modules: Modules are other optional Python modules.
    • Private: It includes files are accessed by the controllers but not directly by the developer.
    • Uploads: Files are accessed by the models but not directly by the developer.
  11. MySQL Tutorial
    Oracle 11g Interview Questions

  12. Question 8. What Are The Databases And Their Drivers Support By Web2py?

    Answer :

    Web2py supports following databases and their drivers:

    Databases Drivers

    SQLite sqlite3 or pysqlite2 or zxJDBC (on Jython)

    PostgreSQL psycopg2 or pg8000 or zxJDBC (on Jython)

    MySQL pymysql or MySQLdb

    Oracle cx_Oracle

    MSSQL pyodbc or pypyodbc

    FireBird kinterbasdb or fdb or pyodbc

    DB2 pyodbc

    Informix informixdb

    Ingres ingresdbi

    Cubrid cubriddb

  13. Question 9. What Are The Crud Methods Of Web2py?

    Answer :

    Web2fy crud methods are :

    Methods                                                     Description

    crud.tables()                                      It returns a list of tables which is defined in the database.

    crud.create(db.tablename)                  It returns a create form for the table tablename.

    crud.read(db.tablename, id)                It returns a read-only form for tablename and record id.

    crud.delete(db.tablename, id)              It is used to deletes the record

    crud.select(db.tablename, query)         It returns a list of records selected from the table

    crud.search(db.tablename)                  Returns a tuple (form, records) where form is a search form

  14. PostgreSQL Interview Questions

  15. Question 10. Which Class Is Used To Send Email In Web2py Framework?

    Answer :

    In Web2fy Framework, gluon.tools.Mail class is used to send email. The mailer can be defined with this class.

    from gluon.tools import Mail  

        mail = Mail()  

        mail.settings.server = ‘smtp.example.com:25’  

        mail.settings.sender = ‘abc@example.com’  

        mail.settings.login = ‘username:password’  

  16. Oracle 11g Tutorial

  17. Question 11. What Is The Default Port Of Web2py?

    Answer :

    Web2py default port is 8000.

  18. SQL DBA Interview Questions

  19. Question 12. What Is Postbacks?

    Answer :

    A better pattern in web2py is to submit forms to the same action, which generates them. This mechanism is called as “postback” which is the main feature of web2py. In short, self-submission is achieved in postback.

  20. Python Interview Questions

  21. Question 13. How Can We Create A Model?

    Answer :

    We can create a model by using following code :

    db.define_table(‘company’, Field(‘name’, notnull = True, unique = True), format = ‘%(name)s’)  

    db.define_table(  

       ‘contact’,  

       Field(‘name’, notnull = True),  

       Field(‘company’, ‘reference company’),  

       Field(‘picture’, ‘upload’),  

       Field(’email’, requires = IS_EMAIL()),  

       Field(‘phone_number’, requires = IS_MATCH(‘[d-() ]+’)),  

       Field(‘address’),  

       format = ‘%(name)s’  

    )  

    db.define_table(  

       ‘log’,  

       Field(‘body’, ‘text’, notnull = True),  

       Field(‘posted_on’, ‘datetime’),  

       Field(‘contact’, ‘reference contact’)  

  22. Database Testing Tutorial

  23. Question 14. Describe The Workflow Of Web2py?

    Answer :

    Web2py workflow are given below :

    • The web server manages HTTP requests simultaneously in its own thread.
    • The HTTP request header is passed to the dispatcher.
    • The dispatcher manages the application requests and map the PATH_INFO in the URL of the function call. Every function call is represented in the URL.
    • All the requests for files included in the static folder are managed directly, and large file are streamed to the client.
    • Requests for anything but a static file are mapped into an action.
    • If the request header contains a session cookie for the app, the session object is retrieved; or else, a session id is created.
    • If the action returns a value as string, this is returned to the client.
    • If the action returns an iterable, it is used to loop and stream the data to the client.
  24. Question 15. What Are The Features Of Web2py?

    Answer :

    Web2py features are:

    • It is easy to learn.
    • It is portable.
    • It has standard library that supports many task.
  25. SQL Interview Questions

  26. Question 16. What Is The I/o Functions In Web2py?

    Answer :

    There are various I/O functions in Web2py that are given below:

    open(): It helps to open a file or document

    write(): It helps to write a string in file or document

    read(): It helps to read the content in existing file

    close(): This method closes the file object.

  27. Django Tutorial

  28. Question 17. What Is Cron In Web2py?

    Answer :

    In Web2py, CRON gives the ability to run the task within the specified interval of the time.

  29. Database Testing Interview Questions

  30. Question 18. What Is Rbac In Web2py?

    Answer :

    In Web2py, RBAC stands for Role Based Access Control. It is an approach to restricting system access to authorized used.

  31. MySQL Interview Questions

  32. Question 19. Which Method Is Used To Send An Email In Web2py?

    Answer :

    In Web2py, mail.send() method is used to send an email.

  33. Git (software) Tutorial

  34. Question 20. What Are The Protocols Used In Web2py?

    Answer :

    There are various protocols used in Web2py:

    XML

    JSON

    RSS

    CVC

    SOAP etc.

  35. Django Interview Questions

  36. Question 21. Does Web2py Support Multiple Database?

    Answer :

    Yes, Web2py supports multiple database.

  37. Question 22. What Is The Use Of Dal Object?

    Answer :

    DAL object is used to represents a database connection.

    Example:  db = DAL(‘sqlite://storage.sqlite’)

  38. Javascript Advanced Tutorial

  39. Question 23. How Can We Disable All The Table In Web2py?

    Answer :

    In Web2py, Migration is used to disable all the table.

    Example: db = DAL(…, migrate enabled=False)  

  40. Database Administration Interview Questions

  41. Question 24. Is It Possible To Skip The Gui And Start Web2py Directory?

    Answer :

    Yes, by using command line.

    Example: python web2py.py -a ‘your password’ -i 127.0.0.1 -p 8000  

  42. Oracle 11g Interview Questions

  43. Question 25. What Is The Process To Send Sms?

    Answer :

    The following code is used to send SMS:

    from gluon.contrib.sms utils  

    import SMS CODES, sms email  

    email = sms_email(‘1 (111) 111-1111′,’T-Mobile USA (abc)’)  

    mail.send(to = email, subject = ‘test’, message = ‘test’)  

  44. Flask Tutorial

  45. Question 26. In Which Language Web2py Was Written?

    Answer :

    Web2py was written in Python language.

  46. Git (software) Interview Questions

  47. Question 27. What Is Nginx?

    Answer :

    Niginx is a free, open-source web server. It is used to configure file.

  48. PostgreSQL Interview Questions

  49. Question 28. How Can We Delete The Records?

    Answer :

    We can delete the records by using following code:

    crud.delete(db.table name, id)  

  50. CouchDB Tutorial

  51. Question 29. Which Tag Is Used To Escape Python Code Embedded In Html?

    Answer :

    Web2py uses {{…}} tag to escape python code embedded in HTML.

  52. Javascript Advanced Interview Questions