title: How to deploy django app on hosting service
body: <p>I'm new to web development. I bought the web hosting start-up package from Siteground to host my graphic design portfolio website. It's a simple Django app that is a one-page portfolio with a contact form using Django's sendEmail through gmail service.</p>
  
  <p>I've never deployed a Django app, let alone my own website. I've only made and deployed a Wordpress website which is pretty self-explanatory.</p>
  
  <p>I understand how to upload my website to the server through FTP, but I have no idea how to configure the Django app for deployment (aside the brief explanation in their docs) or how to connect the app to my server to run on the domain.</p>
  
  <p>I think I'm supposed to configure something in wsgi, but I don't really understand how that works and I can't find support anywhere on deploying a Django app on Siteground (or something like it) even though they have python support.</p>
  
  <p>I connected to Sitegrounds' SSH to follow some tutorials on Django deployment, but even though it's Linux I can't use (or don't understand how to) sudo apt-get to follow the tutorials.</p>
  
  <p>Here is my settings.py:</p>
  
  <pre><code>import os
  
  with open('cfsite/key.txt') as f:
      SECRET_KEY = f.read().strip()
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  # Debug Settings
  DEBUG = True
  
  ALLOWED_HOSTS = ['']
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'crispy_forms',
      'cfapp',
  ]
  
  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 = 'cfsite.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 = 'cfsite.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
  
  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',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/2.2/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.2/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = '/home/iamcrys8/public_html/static'
  
  # Crispy Forms settings
  
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  
  # Email Backend settings
  
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_USE_SSL = True
  EMAIL_PORT = 465
  EMAIL_HOST_USER = '(email go here)'
  EMAIL_HOST_PASSWORD = '(email pass go here)'
  </code></pre>
  
  <p>I know I have to change 'Debug=True' to 'Debug=False' and insert my domains' IP in the 'Allowed_Hosts' as well as pointing my directories to the servers' directory (public_html), but that's all I know.</p>
  
  <p>Can anyone please point me in the right direction to understanding how to deploy python apps on Siteground? Or at least point me to a resource that explains the deployment of python apps on server hosting services?</p>
  
  <p>Is it possible to keep sqlite or do I have to learn mysql (which Siteground has support for)?</p>
  
  <p>Edit: Here is Sitegrounds' deployment information regarding non-Wordpress or Joomla websites (which they have barely any information on).</p>
  
  <blockquote>
    <ol>
    <li>Move your files: First, you will need to move your website files from your previous host to SiteGround by using FTP (File Transfer
    Protocol).</li>
    <li>Move your database: Then, you will have to move your database. Start with exporting the database from your previous hosting account.
    If you’re not sure how to do this, contact the support of your
    previous host to get more info. When you get your data exported,
    create a new database on your new SiteGround hosting account and
    import your content into it.</li>
    <li>Reconfigure your application: The last step of transferring your site is to reconfigure your application to work from the new place. In
    WordPress, that's the wp-config.php file, while in Joomla it is
    configuration.php. Replace the values with your actual database,
    database username and password for it. Save this file and your site
    should be up and running from your new SiteGround hosting account. The
    configuration steps for every application are different.</li>
    </ol>
  </blockquote>
  
  <p>The only other info regarding deployment is specific to Wordpress or other PHP frameworks.</p>