Django Paper link PostgreSQL database

Source: Internet
Author: User
Tags postgresql install django django tutorial

1. Original address: http://my.oschina.net/slhong/blog/96159

Basic description before configuration:

    • Win7 +python2.7.3+postgresql9.22+ Django1.4.3
    • Psycopg2-2.4.6.win32-py2.7-pg9.2.2-release
Steps to use:

    1. Install Python
    2. Installing Django
    3. Installing PostgreSQL9.22
    4. Install psycopg2-2.4.6.win32-py2.7-pg9.2.2-release, download here
    5. Test whether the installation was successful
Note that the main instructions here are whether the test installation was successful:

    1. After you install Python, open a command prompt. Enter Python and see if you can see the interactive environment of Python. If not, set the environment variables for Python.
    2. After you install Django, after the command is entered in Python. Enter import Django--django.version at the interactive prompt, and the input Django.verison in my own test environment will return an error, so enter the uppercase VERSION. If entered correctly, the Django version you installed will be returned.
    3. Since we want to test whether the database is successfully installed, we need to test it with Django to create a new project. This is the Django tutorial.
    4. To facilitate the description, I create a new project, the path is: D:\Pydata\mysite
    5. We need to create a new data in PostgreSQL before the test, and the new one is pydata.
The following is a detailed description of the test:

1. First we go through the command line prompt into our new project,

2. Use your favorite editor to open the MySite directory settings.py find databases, fill in the relevant database information, depending on your own circumstances vary. :

3. Enter python manage.py shell-->from django.db Import connection-->cursor = Connection.cursor If no error is returned indicating that the database connection was successful,

4 You can then use Django to manipulate the database ...

Django Paper link PostgreSQL database

Related Article

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.