Jump to content

Recommended Posts

Posted

I am trying to work with postgress on tommy with django.

 

here is django settings.py

import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = 'secret'

DEBUG = True

ALLOWED_HOSTS = ['*']



INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'wsgi.application'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_plrplus',
        'USER': 'patents_plr',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}


AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


STATIC_URL = '/static/'

Posted

        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_plrplus',
        'USER': 'patents_plr',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '3306',

Postgres uses port 5432, not 3306.

  • 2 weeks later...
Posted

I am still not able to use postgresql with django on tommy.

 

 

Here is what I have tried so far,

 

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_posttest',
        'USER': 'patents_postusr',
        'PASSWORD': 'pass',
        'HOST': '65.19.143.6',
        'PORT': '5432',
    }
}
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_posttest',
        'USER': 'patents_postusr',
        'PASSWORD': 'pass',
        'HOST': '65.19.143.6',
        'PORT': '5433',
    }
}
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'patents_posttest',
        'USER': 'patents_postusr',
        'PASSWORD': 'pass',
        'HOST': 'localhost',
        'PORT': '',
    }
}

None of them works

 

 

Posted

Oh I got it.

It means other than me nobody trying django + postgress on heliohost.

 

Please install psycopg2.

Posted

 

It means other than me nobody trying django + postgress on heliohost.

 

Pretty likely. A lot of our user have "first of their kind" development projects and configurations. We see a lot of interesting configurations and projects here :)

 

That's why we install modules when asked, and why we sometimes have to ask a lot of questions when things don't work. Odds are we've simply never seen it before ourselves.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...