A concise tutorial on installing and creating a project for Django in Win7, djangowin7

Source: Internet
Author: User

A concise tutorial on installing and creating a project for Django in Win7, djangowin7

One of the most popular programming languages of python, this article describes how to install and develop the django framework of python.

The installation and creation project hello word of Django in Win7 is relatively simple. Here, commands and code are provided directly. If you do not understand it, you can refer to relevant materials.

1. installation:
The command is as follows:

pip install Django==1.6.5

2. Create a project

django-admin.py startproject web

Modify urls. py

url(r'^blog/index/$','blog.views.index'),

3. Create a project:

django-admin.py startapp blog

Modify:/blog/views. py

Add:

from django.http import HttpResponsedef index(req):  return HttpResponse("hello world");

4. Start the built-in Server

python manage.py runserver

Access page:
Http: // 127.0.0.1: 8000/blog/index/


Hello Word in C Language

I use Visual Studio 2005 (including C ++, which is actually vc8.0). If vc is used, it should be similar. Next I will explain how to compile and run Hello World in my environment!
1. Open vc from the Start Menu or in a shortcut. Choose file> new> project (or file> new> project ).
2. In the displayed dialog box, select visual c ++ on the left, win32 on the right, win32 console application (or win32 console Program), and name (or name) on the bottom) enter Helloworld (or your favorite name, which is the project name) and click OK (or OK ).
3. Click next or set the application settings program. Select console application console program for the application type program. Select the Empty project (Empty project or Empty project forgot Chinese) in the additional options of additional options, and click finish.
4. Open solution explorer to browse (the Chinese name is missing) (if not, you can call it out from view> solution explorer), right-click the source file, select add to add a new item.
5. Select code on the left and C ++ file on the right. Enter the name HelloWorld or your favorite name in the name column, and click add.
6. Copy the code to HelloWorld. cpp
# Include <stdio. h>
# Include <stdlib. h>
Int main (void)
{
Printf ("Hello World! \ N ");
System ("pause ");
Return 0;
}
Copy to HelloWorld. cpp.
7. Select build> build solution (create> build solution) on the menu, or press F7. Run debug-> start debuging (debug-> start debugging) or press F5. Or press f5. However, it is generally followed by f7.
In this way, you can compile and run the program Helloworld. The main problem is to create a new project first.

The younger brother just learned C # and asked how to write the simplest hello word C # program in VS2008, create a project, and select the program type

Console Application

1. Beginners

Public class HelloWorld
{
Public static void Main ()
{
System. Console. WriteLine ("hello world ");
}
}

2. Improved HELLO WORLD

Using System;
Public class HelloWorld
{
Public static void Main ()
{
Console. WriteLine ("hello world ");
}
}

3. command line format

Using System;
Public class HelloWorld
{
Public static void Main (string [] args)
{
Console. WriteLine (args [0]);
}
}

4. Constructor

Using System;
Public class HelloWorld
{
Public HelloWorld ()
{
Console. WriteLine ("hello world ");
}

Public static void Main ()
{
HelloWorld hw = new HelloWorld ();
}
}

5. Object-oriented

Using System;
Public class HelloWorld
{
Public void helloWorld ()
{
Console. WriteLine ("hello world ");
}

Public static void Main ()
{
HelloWorld hw = new HelloWorld ();
Hw. HelloWorld ();
}
}

6. From other classes

Using System;
Public class HelloWorld
{
Public static void Main ()
{
HelloWorldHelperClass hwh = new HelloWorldHelperClass ();
Hwh. writeHelloWorld ();
}
}

Public class HelloWorldHelperClass
{
Public void writeHelloWorld ()
{
Console. WriteLine ("Hello World ");
}
}

7. Inheritance

Abstract class HelloWorldBase
{
Public abstract void writeHelloWorld ();
}

Class HelloWorld: HelloWorldBase
{
Public override void writeHelloWorld ()
{
Console. WriteLine ("Hello World ");
... The remaining full text>

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.