Skip to content
Andrew Charles edited this page Mar 31, 2016 · 7 revisions

Welcome to the Antyc Website wiki!

Technologies Used [environment]:

  • Azure [test/prod]
  • Ubuntu 14.04 [test/prod]
  • Git apt-get install git
  • Python 3.4 apt-get install python3
  • // Removed, Python 3.4+ has pip // Pip apt-get install python3-pip
  • Django 1.8 pip3 install django==1.8.11
  • django-pipeline pip3 install django-pipeline==1.6.7
  • psycopg2 pip3 install psycopg2 [test/prod]
  • Bootstrap 3 (in repo)
  • SQLite (comes with django) [devl]
  • PostgreSQL apt-get install postgresql; passwd postgres [test/prod]
  • Apache 2.4 apt-get install apache2 [test/prod]
    • Edit apache2.conf, add the following lines:
    • # stop warning on apache2 restart
      ServerName localhost
  • Mod_WSGI 3.4 apt-get install apache2-mpm-worker; apt-get install apache2-threaded-dev; apt-get install libapache2-mod-wsgi-py3 [test/prod]
  • fail2ban apt-get install fail2ban [test/prod]

Devl deployment:

  • Create directory for project mkdir AntycWebsiteDevl
  • cd AntycWebsiteDevl
  • Create environment file touch <environment>
  • git clone https://github.com/AntycSolutions/AntycWebsite
  • cd AntycWebsite
  • Update <environment>_settings.py from file
  • python3 manage.py makemigrations; python3 manage.py migrate; python3 manage.py createsuperuser
  • ./run.sh

Test deployment:

  • Create PostgreSQL database
    • Login with user postgres, run postgresql psql
    • Create perfectarchorthotics database CREATE DATABASE <database>;
    • Create django user CREATE USER <djangouser> WITH PASSWORD '<password>';
    • Grant privileges to django user GRANT ALL PRIVILEGES ON database <database> TO <djangouser>;
  • Create directory for websites mkdir public_html
  • cd public_html
  • Create directory for project mkdir <url>
  • cd <url>
  • Create environment file touch <environment>
  • git clone https://github.com/AntycSolutions/AntycWebsite
  • cd AntycWebsite
  • Update <environment>_settings.py from file
  • python3 manage.py makemigrations; python3 manage.py migrate; python3 manage.py createsuperuser
  • // Enable user uploads via apache user chown -R www-data media/
  • // Enable user uploads via apache user chgrp -R www-data media/
  • python3 manage.py collectstatic
  • Create apache2/sites-available/<url>.conf See wiki page for content
  • a2ensite <url>
  • service apache2 restart

Prod deployment:

  • Create PostgreSQL database
    • Login with user postgres, run postgresql psql
    • Create perfectarchorthotics database CREATE DATABASE <database>;
    • Create django user CREATE USER <djangouser> WITH PASSWORD '<password>';
    • Grant privileges to django user GRANT ALL PRIVILEGES ON database <database> TO <djangouser>;
  • Create directory for websites mkdir public_html
  • cd public_html
  • Create directory for project mkdir <url>
  • cd <url>
  • Create environment file touch <environment>
  • git clone https://github.com/AntycSolutions/AntycWebsite
  • cd AntycWebsite
  • Update <environment>_settings.py from file
  • python3 manage.py makemigrations; python3 manage.py migrate; python3 manage.py createsuperuser
  • // Enable user uploads via apache user chown -R www-data media/
  • // Enable user uploads via apache user chgrp -R www-data media/
  • python3 manage.py collectstatic
  • Add SSL files
  • Create apache2/sites-available/<url>.conf See wiki page for content
  • a2enmod ssl
  • a2enmod headers
  • a2enmod rewrite
  • a2ensite <url>
  • service apache2 restart

PostgreSQL:

  • create database <database>;
  • create user <djangouser> with password '<password>';
  • grant all privileges on database <database> to <djangouser>;
  • psql -U <djangouser> -d <database> -h localhost -W;
  • drop database <database>;

Clone this wiki locally