Web2py--------------use Web2py to write Django examples--------development environment

Source: Internet
Author: User
Tags web2py

Let's start with the well-known example of XI.

The official example, I will give the code at the end;

============================ Environment ===================

The compiler uses VS code, the plugin is only Python,powershell, and the second plugin is not used in this tutorial,

In order not to create confusion, do not use the version manager,

PY version 2.7.12,

System, WIN10

Web2py version 2.14.6-stable+timestamp.2016.05.10.00.21.47

Currently the latest version

If you need to clean a bit, choose source code, if there is no py2 environment directly under for Windows can also

Other versions please download the package on GitHub (where the DAL is missing the core package, need to be downloaded separately, if the latest version can be omitted)

===========================write your first app ==============================

The first step in Django is to build a new application that is a project,web2py download that is already a complete project, and we start by building an app

Simple for Web2py

The first step

Let's start with the WEB2PY server and run the web2py.py file.

Here are some options, where choose password is the login password of the Select Admin interface, here we enter 1

And then we jump to the demo that Web2py did for us, we don't care about him here, keep working.

Step Two,

Click My Sites will enter the management interface, then enter the first step of the password we will enter the site management interface,

We can see that the system has prepared two demos for us,

Step Three:

On the right we'll see an input box for creating a new app, and we'll enter the same name as Django.

At this point we see that the app is successful and will jump to the page editor page of the app, click on the file to edit it, but the experience is not very good so we use vs code to edit

The app has been set up here.

We have access to our app from Http://120.0.0.1:8000/mysite,

We can see the results.

We see here, and the example is the same, except for the text in the picture changed to MySite, but no matter how our first app was built.

Fourth Step:

We open the directory under the Applications folder

You'll see the MySite app folder.

Then right-click with VS code and we'll see the entire project structure.

Here model is the mode of views is the view, controllers is the controller, is the so-called MVC model, others do not say, we basically will be in these folders to make changes enough to pull.

Web2py--------------use Web2py to write Django examples--------development environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.