diff --git a/app/conf/uwsgi_zuykov.conf.template b/app/conf/uwsgi_zuykov.conf.template index e7a9bb9..54d1752 100644 --- a/app/conf/uwsgi_zuykov.conf.template +++ b/app/conf/uwsgi_zuykov.conf.template @@ -3,12 +3,12 @@ uid=%(SERVER_USERNAME)s gid=%(SERVER_USERNAME)s chdir = /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s -module = app.wsgi_zuykov +module = app.wsgi home = /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/env -eval = import newrelic.agent, wsgi_zuykov; application = newrelic.agent.wsgi_application()(wsgi_zuykov.application) +eval = import newrelic.agent, wsgi; application = newrelic.agent.wsgi_application()(wsgi.application) master = true processes = 4 -socket = /home/%(EC2_SERVER_USERNAME)s/%(PROJECT_NAME)s/app/wsgi_zuykov.sock +socket = /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/wsgi.sock chmod-socket = 666 vacuum = true diff --git a/app/deploy/hosts.py b/app/deploy/hosts.py index cf3bbf7..fec0139 100644 --- a/app/deploy/hosts.py +++ b/app/deploy/hosts.py @@ -4,12 +4,10 @@ # Deploy from deployer.host import SSHHost -from zsite import settings - class WebHost(SSHHost): slug = 'web' - address = 'dev.zuykov.com' + address = '151.248.125.130' username = 'web' password = '9oijffDf2vi@D!' diff --git a/app/deploy/tasks.py b/app/deploy/tasks.py index d3d1ef1..5283a25 100644 --- a/app/deploy/tasks.py +++ b/app/deploy/tasks.py @@ -40,19 +40,35 @@ common_configure = [ # List of APT packages to install {"action": "apt", - "params": ["libpq-dev", "git", - "python-setuptools", "python-dev", "build-essential", "python-pip", "redis-server", - "libmysqlclient-dev", "subversion"], + "params": ["git", + "python-setuptools", "python-dev", "build-essential", "python-pip", "libmysqlclient-dev", + "mysql-server", "mysql-client"], "message":"Installing apt-get packages" }, + # {"action": "sudo", "params": "mysql_secure_installation", + # "message": "MYSQL Configuration" }, + + # {"action": "sudo", "params": "service mysqld start", + # "message": "MYSQL Starting" }, + + # {"action": "sudo", "params": "chkconfig mysqld on", + # "message": "MYSQL Configuration auto start" }, + + {"action": "run", "params": "mysqladmin -u %(MYSQL_USER)s -h localhost password '%(MYSQL_PASSWORD)s'", + "message": "MYSQL Create user" }, + + # {"action": "run", "params": "mysqladmin -u %(MYSQL_USER)s --password='%(MYSQL_PASSWORD)s' -h localhost '%(MYSQL_PASSWORD)s'", + # "message": "MYSQL Configuration" }, host + # List of pypi packages to install {"action": "pip", "params": ["virtualenv"], "message":"Installing virtualenv"}, #project directory + {"action": "run", "params": "mkdir -p ~/.ssh", "message": "Create ssh folder" }, {"action": "run", "params": "mkdir -p %(PROJECT_DIR)s", "message": "Create project folder" }, {"action": "run", "params": "mkdir -p %(LOGS_DIR)s", "message": "Create logs folder" }, - {"action": "sudo", "params": "chown -R %(SERVER_USERNAME)s: %(PROJECT_DIR)s"}, + {"action": "run", "params": "chown -R %(SERVER_USERNAME)s: %(PROJECT_DIR)s"}, # git setup {"action": "run", "params": "git config --global user.name '%(GIT_USERNAME)s'", @@ -78,7 +94,7 @@ common_configure = [ {"action": "run", "params": "virtualenv %(ENV_DIR)s", "message": "Configuring virtualenv" }, - {"action": "sudo", "params": "chown -R %(SERVER_USERNAME)s: %(ENV_DIR)s"}, + {"action": "run", "params": "chown -R %(SERVER_USERNAME)s: %(ENV_DIR)s"}, # {"action": "run", "params": # "echo 'expo WORKON_HOME=%(PRO_DIR)s' >> /home/%(SERVER_USERNAME)s/.profile"}, {"action": "run", "params": @@ -94,20 +110,16 @@ web_configure = [ {"action": "apt", "params": ["nginx", "uwsgi", "uwsgi-plugin-python", "nodejs", "npm"], "message":"Installing nginx, uwsgi, nodejs packages"}, - {"action": "sudo", "params": "npm install -g bower karma grunt grunt-cli"}, - # Костыль с нодой - {"action": "run", "params": "ln -s /usr/bin/nodejs %(ENV_DIR)s/bin/node"}, - {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/transcribe.ninja && npm install"}, - {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/stenograph.us && npm install"}, + {"action": "sudo", "params": "npm install -g bower"}, + # # Костыль с нодой + # {"action": "run", "params": "ln -s /usr/bin/nodejs %(ENV_DIR)s/bin/node"}, + # {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/transcribe.ninja && npm install"}, + # {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/stenograph.us && npm install"}, {"action": "sudo", "params": "rm -rf /etc/nginx/sites-enabled/default"}, - {"action": "sudo", "params": "rm -rf /etc/supervisor/conf.d/default"}, + # {"action": "sudo", "params": "rm -rf /etc/supervisor/conf.d/default"}, {"action": "sudo", "params": "rm -rf /etc/uwsgi/apps-enabled/default.ini"}, ] -npm_install = [ - {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/transcribe.ninja && npm install"}, - {"action": "sudo", "params": "cd %(PROJECT_DIR)s/frontend/stenograph.us && npm install"}, -] # nginx reload_nginx = [ @@ -124,16 +136,13 @@ create_nginx_links = [ create_uwsgi_links = [ {"action": "sudo", "params": - "ln -s /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_stenograph_us.conf /etc/uwsgi/apps-enabled/%(PROJECT_NAME)s_stenograph_us.ini"}, - {"action": "sudo", "params": - "ln -s /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_transcribe_ninja.conf /etc/uwsgi/apps-enabled/%(PROJECT_NAME)s_transcribe_ninja.ini"}, + "ln -s /home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_zuykov.conf /etc/uwsgi/apps-enabled/%(PROJECT_NAME)s_zuykov.ini"}, ] reload_uwsgi = [ - {"action": "put_template", "params": {"template": "%(BASE_DIR)s/app/conf/uwsgi_stenograph_us.conf.template", - "destination": "/home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_stenograph_us.conf"}}, - {"action": "put_template", "params": {"template": "%(BASE_DIR)s/app/conf/uwsgi_transcribe_ninja.conf.template", - "destination": "/home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_transcribe_ninja.conf"}}, + {"action": "put_template", "params": {"template": "%(BASE_DIR)s/app/conf/uwsgi_zuykov.conf.template", + "destination": "/home/%(SERVER_USERNAME)s/%(PROJECT_NAME)s/app/conf/uwsgi_zuykov.conf"}}, + {"action": "sudo", "params": "service uwsgi restart", "message": "Restarting uwsgi"}, ] diff --git a/app/deploy/zuykov.py b/app/deploy/zuykov.py index c0c2fc5..53878cb 100644 --- a/app/deploy/zuykov.py +++ b/app/deploy/zuykov.py @@ -44,9 +44,10 @@ class ZuykovWebSystem(Node): class Application(DjangoDeployment): def configure_base(self): self._configure_instance(tasks.common_configure) + self._configure_instance(tasks.web_configure) - def hello(self): - self.hosts.run('echo hello world') + def restart(self): + self._configure_instance(tasks.create_uwsgi_links + tasks.reload_nginx + tasks.reload_uwsgi) def update(self): self.checkout() diff --git a/app/settings.py b/app/settings.py index afc5b77..2541bf2 100644 --- a/app/settings.py +++ b/app/settings.py @@ -52,9 +52,9 @@ GIT_KEY_NAME = 'github_rsa' -ROOT_URLCONF = 'zsite.urls' +ROOT_URLCONF = 'app.urls' -WSGI_APPLICATION = 'zsite.wsgi.application' +WSGI_APPLICATION = 'app.wsgi.application' # Database @@ -298,6 +298,9 @@ DATABASES = { {'ENGINE': 'django.db.backends.mysql', 'NAME': u'zuykov', 'HOST': u'localhost', 'USER': u'root', 'PASSWORD': '', 'PORT': ''} } +MYSQL_USER = DATABASES['default']['USER'] +MYSQL_PASSWORD = DATABASES['default']['PASSWORD'] + MIGRATION_MODULES = { 'djangocms_column': 'djangocms_column.migrations_django', 'djangocms_flash': 'djangocms_flash.migrations_django', diff --git a/requirements.txt b/requirements.txt index abd5f2d..e2f057a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,4 +21,13 @@ django-pipeline django_debug_toolbar djangocms-forms django-multipleformwizard +newrelic +django-reversion +cmsplugin-filer +django-taggit +django-taggit-autosuggests +django-meta +django-meta-mixin +django-admin-enhancer +aldryn-apphooks-config #export C_INCLUDE_PATH=/usr/local/Cellar/libxml2/2.9.2/include/libxml2:$C_INCLUDE_PATH \ No newline at end of file diff --git a/zsite/static/imgs/bill.png b/zsite/static/imgs/bill.png new file mode 100644 index 0000000..4163a08 Binary files /dev/null and b/zsite/static/imgs/bill.png differ diff --git a/zsite/static/less/main.less b/zsite/static/less/main.less index bf93cb6..7723005 100644 --- a/zsite/static/less/main.less +++ b/zsite/static/less/main.less @@ -20,6 +20,10 @@ @import 'consultation.less'; +@import 'theory.less'; + +@import 'service.less'; + @import url(http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic|Roboto+Slab:700,400&subset=cyrillic-ext,latin); diff --git a/zsite/static/less/service.less b/zsite/static/less/service.less new file mode 100644 index 0000000..4a8765b --- /dev/null +++ b/zsite/static/less/service.less @@ -0,0 +1,14 @@ +.service-timeline { + h4 { + margin: 0 + } + + p { + opacity: .8; + } + + .arrow { + font-size: 33px; + vertical-align: text-bottom; + } +} \ No newline at end of file diff --git a/zsite/static/less/theory.less b/zsite/static/less/theory.less new file mode 100644 index 0000000..2e064ce --- /dev/null +++ b/zsite/static/less/theory.less @@ -0,0 +1,18 @@ +.theory { + background: #FFF0D8; + + padding: 5px 18px; + + h5 { + padding-left: 22px; + font-weight: 700; + } + + ul { + font-size: 12px; + + li { + margin-bottom: 5px; + } + } +} \ No newline at end of file diff --git a/zsite/templates/base.html b/zsite/templates/base.html index c8af3ea..b84e504 100644 --- a/zsite/templates/base.html +++ b/zsite/templates/base.html @@ -38,6 +38,8 @@ {% show_menu 0 1 100 100 "menu_header.html" %} + +
{% block content %}{% endblock content %} diff --git a/zsite/templates/form_template/contacts.html b/zsite/templates/form_template/contacts.html new file mode 100644 index 0000000..e47ff14 --- /dev/null +++ b/zsite/templates/form_template/contacts.html @@ -0,0 +1,60 @@ +{% load cms_tags djangocms_forms_tags i18n sekizai_tags staticfiles %} +