当前位置:天才代写 > Python代写,python代做代考-价格便宜,0时差服务 > Level 3 web application Python代写CS专业留学生

Level 3 web application Python代写CS专业留学生

2018-03-28 08:00 星期三 所属: Python代写,python代做代考-价格便宜,0时差服务 浏览:643

Level 3

The Level 3 requirements concentrate on being able to log in and out of the
application and see a page customised for the user. To meet this level you must implement another
set of procedures in the module user.py, and one more procedure in interface.py
       and then extend your
web application to allow user login.

Unit Tests

This level adds four procedures in a new users
that deal with authenticating users
and managing user sessions, and another procedure
in the interface module to access images for a given user.
They act as an interface to the users and sessions tables in
the database.   These procedures are
   implemented in the module users.py; a version of
this file with just the procedure stubs is provided for you.

  1. check_login

    There is a procedure check_login in the users module
    that takes three arguments, a database connection, a user nick and a password, and returns
    True if the password is correct for this user and False otherwise.
    Note that the password is stored in the database in encrypted form.
    You can use the method db.crypt(text) to encrypt
    a password (where db is a database connection).

  2. generate_session

    There is a procedure generate_session in the users module
    that takes two arguments,
    a database connection and a user nick. If the nick doesn't correspond to
    an existing user, then it returns None.  If this user doesn't already
    have an active session (an entry in the sessions table) then a new
    entry is created.   If there is an existing entry, then the existing
    session id is retrieved. The procedure then creates a cookie in the
           Bottle response with the name sessionid and a value of the session id for this user.
    The procedure returns the sessionid.

  3. delete_session

    There is a procedure delete_sessions in the users module
    that takes two
    arguments, a database connection and a user nick.  The procedure
    removes all entries for this user in the sessions table. It does
    not return a value.

  4. session_user

    There is a procedure session_user in the users module
    that takes
    one arguments, a database connection, and
    returns the name of the logged in user if one can be identified or
    None if not.   This is done by finding the session id from the cookie
    in the Bottle request if present, and using it to look up
    the user in the sessions table.

Functional requirements


 

As for level two plus:

  1. Login Form

    As a visitor to the site, when I load the home page, I see a form with entry
    boxes for nick and password and a button labelled Login.

    • The login form will have the id 'loginform' and
        will use fields named 'nick' and 'password'.

    • The action of the login form will be   /login.

  2. Logging In

    As a registered user, when I enter my user nickname (eg. Bobalooba)
    and password (bob) into the
    login form and click on the Login button, the response is a
           redirect to the main application page (/). When my browser loads
           that page I see the normal home page with the login form replaced by the message "Logged in as Bobalooba" and a button labelled Logout.

    • The response generated by the successful login action
      is a redirect (302 Found) response that redirects the user
      to the home page.

    • The redirect response also includes a cookie with the
      name sessionid that contains some kind of random string.

    • The logout button will be in a form with id logoutform
                 and have an input submit field with
      the name logout.

  3. Failed Login

    As a registered user, when I enter my email address but get my password
    wrong and click on the Login button, the page I get in response contains
    a message "Login Failed, please try again".  The page also includes another
    login form.

  4. Posting a Job

    As a registered user, I can fill out a form on the main
           page to create a new job listing (position), when I submit the form I am redirected
           to the main page and my new position appears in the list.

       

    • The form to post a new position will have the id postform

    • The action attribute for the form will be the URL /post

  5. Logout Button

    As a registered user, once I have logged in, every page that I request
    contains my name and the logout button.

  6. Logging Out

    As a registered user, once I have logged in, if I click on the Logout
    button in a page, the page that I get in response is the site home
    page which now doesn't have my name and again shows the login form.

     

    • The response to a logout request is again a redirect
      (302 Found) response that redirects the user to the home
      page.

    • When I now request the home page, I see the login form again because
                   the session has been deleted.

Your Task

To achieve these requirements you will need to implement the new procedures
in interface.py and users.py and then make
use of these to extend your application to support user login and posting messages.

This may seem like a huge task but the number of features and tests listed
above are there to make your job as clear as possible.   Take each
task a step at a time and read the requirements clearly.

The following chapters in the notes may be useful:

代写CS&Finance|建模|代码|系统|报告|考试

编程类:C++,JAVA ,数据库,WEB,Linux,Nodejs,JSP,Html,Prolog,Python,Haskell,hadoop算法,系统 机器学习

金融类统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理

服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导

E-mail:850190831@qq.com   微信:BadGeniuscs  工作时间:无休息工作日-早上8点到凌晨3点


如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

qr.png

 

    关键字:

天才代写-代写联系方式