forked from beba/foerderbarometer
				
			changed production settings to mysql/mariadb database
This commit is contained in:
		
							parent
							
								
									0fa460e1b2
								
							
						
					
					
						commit
						c06ab48bde
					
				| 
						 | 
				
			
			@ -24,6 +24,8 @@ edit /secrets.json to contain something similar to
 | 
			
		|||
  "DATABASE_PASSWORD": "THIS IS TOP SECRET!"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    python manage.py makemigrations
 | 
			
		||||
    python manage.py migrate
 | 
			
		||||
    python manage.py collectstatic
 | 
			
		||||
 | 
			
		||||
add to cron one time a day:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -103,16 +103,31 @@ WSGI_APPLICATION = 'foerderbarometer.wsgi.application'
 | 
			
		|||
 | 
			
		||||
# Database
 | 
			
		||||
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
 | 
			
		||||
 | 
			
		||||
       
 | 
			
		||||
DATABASES = {
 | 
			
		||||
    'default': {
 | 
			
		||||
        'ENGINE': 'django.db.backends.sqlite3',
 | 
			
		||||
        'NAME': BASE_DIR / 'db.sqlite3',
 | 
			
		||||
        'PASSWORD': get_secret('DATABASE_PASSWORD')
 | 
			
		||||
        'ENGINE': 'django.db.backends.mysql',
 | 
			
		||||
        'NAME': 'fdb',
 | 
			
		||||
        'USER': 'fdb',
 | 
			
		||||
        'PASSWORD': get_secret(DATABASE_PASSWORD),
 | 
			
		||||
        'HOST': '10.0.6.7',   # Or an IP Address that your database is hosted on
 | 
			
		||||
        # 'PORT': '3306',
 | 
			
		||||
        #optional:
 | 
			
		||||
        'OPTIONS': {
 | 
			
		||||
            'charset' : 'utf8',
 | 
			
		||||
            'use_unicode' : True,
 | 
			
		||||
             'init_command': 'SET '
 | 
			
		||||
                'storage_engine=INNODB,'
 | 
			
		||||
                'character_set_connection=utf8,'
 | 
			
		||||
                'collation_connection=utf8_bin'
 | 
			
		||||
                #'sql_mode=STRICT_TRANS_TABLES,'    # see note below
 | 
			
		||||
                #'SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
 | 
			
		||||
        },
 | 
			
		||||
        'TEST_CHARSET': 'utf8',
 | 
			
		||||
        'TEST_COLLATION': 'utf8_general_ci',
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Password validation
 | 
			
		||||
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue