diff --git a/.gitignore b/.gitignore index d9a0721..47c224d 100644 --- a/.gitignore +++ b/.gitignore @@ -267,3 +267,4 @@ fabric.properties # End of https://www.gitignore.io/api/pycharm /django/.idea/workspace.xml /docs/main.listing +/django/didgeridoo/currencies/migrations/*.py diff --git a/Vagrantfile b/Vagrantfile index cea707a..1c9461d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -30,7 +30,8 @@ Vagrant.configure("2") do |config| #zu installierende Pakete apt-get install -y apache2 python3-django mariadb-server avahi-daemon \ libnss-mdns libapache2-mod-wsgi-py3 python3-mysqldb python3-pip - pip3 install django-extensions Pillow pyaml + pip3 install django-extensions Pillow pyaml django-bootstrap3 + #Copy the apache configuration for django to the correct place cp /vagrant/apache/000-default.conf /etc/apache2/sites-available/ @@ -42,6 +43,10 @@ Vagrant.configure("2") do |config| systemctl restart apache2.service /vagrant/ansible/roles/web_AI-5/tasks/setup_script.sh + + #insert the currency update cronjob + echo "wget -O /dev/null http://localhost:8080" > /etc/cron.hourly/currency_update + chmod +x /etc/cron.hourly/currency_update SHELL end diff --git a/ansible/roles/web_AI-5/tasks/main.yml b/ansible/roles/web_AI-5/tasks/main.yml index 025855b..5daf02b 100644 --- a/ansible/roles/web_AI-5/tasks/main.yml +++ b/ansible/roles/web_AI-5/tasks/main.yml @@ -29,6 +29,7 @@ - django-extensions - Pillow - pyaml + - django-bootstrap3 executable: pip3 - name: Run the setup script to add some final touches diff --git a/django/didgeridoo/currencies/migrations/0001_initial.py b/django/didgeridoo/currencies/migrations/0001_initial.py deleted file mode 100644 index ee9f2f4..0000000 --- a/django/didgeridoo/currencies/migrations/0001_initial.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.7 on 2018-01-09 18:21 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='ExchangeRate', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('exchange_rate_to_chf', models.DecimalField(decimal_places=5, max_digits=12)), - ], - ), - migrations.CreateModel( - name='ExchangeRate_date', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField(unique_for_date=True, verbose_name='%Y-%m-%d')), - ], - ), - migrations.CreateModel( - name='ExchangeRate_name', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=200, unique=True)), - ], - ), - migrations.AddField( - model_name='exchangerate', - name='date', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='currencies.ExchangeRate_date'), - ), - migrations.AddField( - model_name='exchangerate', - name='name', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='currencies.ExchangeRate_name'), - ), - ] diff --git a/django/didgeridoo/didgeridoo/settings.py b/django/didgeridoo/didgeridoo/settings.py index 71b26b2..3e84361 100644 --- a/django/didgeridoo/didgeridoo/settings.py +++ b/django/didgeridoo/didgeridoo/settings.py @@ -35,7 +35,6 @@ ALLOWED_HOSTS = [ # Application definition INSTALLED_APPS = [ - 'currencies', 'webshop.apps.WebshopConfig', 'django_extensions', 'django.contrib.admin', @@ -44,6 +43,8 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'currencies', + 'bootstrap3', ] MIDDLEWARE = [ diff --git a/django/didgeridoo/static/webshop/css/base.css b/django/didgeridoo/static/webshop/css/base.css new file mode 100755 index 0000000..6e68a39 --- /dev/null +++ b/django/didgeridoo/static/webshop/css/base.css @@ -0,0 +1,6 @@ + +.sidebar-nav { + margin-top: 30px; + padding: 10; + list-style: none; +} diff --git a/django/didgeridoo/webshop/templates/webshop/base.html b/django/didgeridoo/webshop/templates/webshop/base.html index cf6c6e2..bb41953 100644 --- a/django/didgeridoo/webshop/templates/webshop/base.html +++ b/django/didgeridoo/webshop/templates/webshop/base.html @@ -1,23 +1,93 @@ -
- - - -No categories are available.
+ {% endif %} + {% endblock %} +