Configuring the Django Connection Orcale database

Source: Internet
Author: User
Tags dba install django pip install django

Django Installation, configuration process

Preparatory process:

Install Python and Pip (for the current version of Python, the PIP installation will be installed during the installation)

Django Installation process:

STEP1: Install Django with PIP.

Execute the following command at the command line:

    1. Pip Install Django
STEP2: Go to the directory where you want to create a new Django project

Execute the following command to create a project:

    1. Django-admin. PY startproject mysite

Where MySite represents the project name.

STEP3: Go inside the outer mysite folder, execute the following command and test if the service starts properly:
    1. Python mange. PY runserver 0.0. 0.0:8000

This service is primarily used for testing in the development process, not for formal operations.

You can now access the site through Ip:8000/.

The development server automatically overloads Python code as needed without having to restart the server specifically.

However, for operations such as adding files, you will need to restart the server manually.

At this point, we use the browser to access the localhost:8000 locally, if you can successfully see the following page, it means that the installation is successful:

STEP4: Configuring settings.py Files

In general, we need to modify the following configuration:

  1. ...
  2. Time_zone = ' Asia/shanghai '
  3. ...
  4. DATABASES = {
  5. ' Default ': {
  6. ' ENGINE ': ' django.db.backends.oracle ',
  7. ' NAME ': ' ORCL ', #数据库名称
  8. ' USER ': ' Hello ', #用户名
  9. ' PASSWORD ': ' Hello ', #密码
  10. ' HOST ': ' 127.0.0.1 ', #HOST
  11. ' PORT ': ' 1521 ', #端口
  12. }
  13. }

Where Time_zone is in order to set the time zone to Beijing, databases is configuring the Oracle database.

STEP5: After the configuration is complete, perform the following command to initialize the database
    1. Python manage. Py Migrate

After successful execution, the database initialization is complete and the entire installation configuration process is completed.

May be an error ora-01031:insufficient privileges

ORA-01031 Insufficient Permissions

Create a user with Oracle and Grant DBA authority

1) Creating User: Create users hello identified by Hello;

2) Grant DBA authority to grant CONNECT,RESOURCE,DBA to Hello;

Configuring the Django Connection Orcale database

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.