Giter Site home page Giter Site logo

django-polls's Introduction

Sample application based on django tutorial

https://docs.djangoproject.com/en/3.2/intro/

Configuration

  • Install django-tibero from github repository
    pip3 install git+https://github.com/cpyang/django-tibero.git  
  • Modify mysite/settings.py with Tibero as default database
    Using django-tibero module
      DATABASES = {
          'default': {
              'ENGINE': "django_tibero",
              'HOST': "127.0.0.1,8629",
              'USER': "tibero",
              'PASSWORD': "tmax",
              'NAME': "tibero",
              'OPTIONS': {
                  'dsn': "tibero",
                  'unicode_results': True,
                  'connection_timeout': 0,
                  'dbshell': "tbsql",
              },
          }
      }
    Using django-pyodbc module
      DATABASES = {  
          'default': {  
              'ENGINE': "django_pyodbc",  
              'HOST': "127.0.0.1,8629",  
              'USER': "tibero",  
              'PASSWORD': "tmax",  
              'NAME': "tibero",  
              'OPTIONS': {  
                  'dsn': "tibero",
                  'host_is_server': True,  
                  'driver': "Tibero",  
                  'dbms_type': 'tibero',  
              },  
          }  
      }  
  • Setup Environment Variables
    . ./setenv.sh
  • Initialise django database
    python3 manage.py migrate
  • After made change to models
    python3 manage.py makemigrations polls  
    python3 manage.py sqlmigrate polls 0001   
  • Create site admin user
    python3 manage.py createsuperuser
  • Start django web service
    python3 manage.py runserver
  • Access web application
    Admin: http://localhost:8000/admin
    Polls: http://localhost:8000/polls

Runing this demo application with docker

  • Using docker-compose Modify database connection informat in docker-compose.yml
    cd docker
    docker-compose build
    docker-compose up
  • Using docker Put database connection information in build arguments
    docker build -t polls --build-arg DB_NAME=tibero --build-arg DB_HOST=localhost --build-arg DB_PORT=8629 .
    docker run --name polls -p 8000:8000 polls

django-polls's People

Contributors

cpyang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.