Skip to content

Commit

Permalink
chore: migrate to django 3.0.2, Close #15
Browse files Browse the repository at this point in the history
  • Loading branch information
michigg committed Jan 9, 2020
1 parent 3f05ef1 commit c8a29d4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 22 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM alpine:3.6
ADD ["fachschaftszitat/requirements.txt", "/requirements.txt"]
FROM alpine:3.11
ADD ["src/requirements.txt", "/requirements.txt"]
RUN apk upgrade --update && \
apk add --update python3 build-base openldap-dev python3-dev py3-psycopg2 && \
pip3 install -r /requirements.txt && rm /requirements.txt
WORKDIR /fs_zitat
WORKDIR /quotes
EXPOSE 80
VOLUME ["/fs_zitat/data"]
COPY "src" "/quotes"
VOLUME ["/quotes/data"]
ENTRYPOINT ["python3", "manage.py"]
ADD ["fachschaftszitat", "/fs_zitat"]
CMD ["runserver", "0.0.0.0:80"]
11 changes: 11 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:3.11
ADD ["src/requirements.txt", "/requirements.txt"]
RUN apk upgrade --update && \
apk add --update python3 build-base openldap-dev python3-dev py3-psycopg2 && \
pip3 install -r /requirements.txt && rm /requirements.txt
WORKDIR /quotes
EXPOSE 80
COPY "src" "/quotes"
VOLUME ["/quotes/data"]
ENTRYPOINT ["python3", "manage.py"]
CMD ["runserver", "0.0.0.0:80"]
29 changes: 29 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "2"

networks:
pg_db:
internal: true

services:
quotesapp:
image: zitate:0.1
build:
context: .
dockerfile: Dockerfile
networks:
- default
- pg_db
env_file:
- docker.env
ports:
- 8888:80

dbzitate:
image: postgres:10-alpine
networks:
- pg_db
volumes:
- ./data/pgdata/:/var/lib/postgresql/data/
env_file:
- docker.env

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2"
version: "3"

networks:
pg_db:
Expand All @@ -14,7 +14,7 @@ services:
- default
- pg_db
volumes:
- ./src:/fs_zitat
- ./src:/quotes
env_file:
- docker.env
ports:
Expand Down
15 changes: 7 additions & 8 deletions src/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.urls import path, include
from django.contrib import admin
from fachschaftszitat import views
from django.contrib.auth import views as auth_views

urlpatterns = [
url(r'^login/$', auth_views.login, name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
url(r'^admin/', admin.site.urls),
url(r'^$', views.home, name="home"),
url(r'^quote-registration/$', views.registration_quote, name="register_quote"),
url(r'^author-registration/$', views.registration_author, name="register_author"),
path('login/', auth_views.LoginView.as_view(), name='login'),
path('logout/', auth_views.LogoutView.as_view(), {'next_page': '/'}, name='logout'),
path('admin/', admin.site.urls),
path('', views.home, name="home"),
path('quote-registration/', views.registration_quote, name="register_quote"),
path('author-registration/', views.registration_author, name="register_author"),
path('api/', include('fachschaftszitat.api.urls')),
path('^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
10 changes: 4 additions & 6 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Django==2.0.1
Django==3.0.2
django-jinja==2.4.1
Jinja2==2.10
MarkupSafe==1.0
pytz==2017.3
djangorestframework==3.9.0
django-auth-ldap==1.7.0
Jinja2==2.10.3
djangorestframework==3.11.0
django-auth-ldap==2.1.0
5 changes: 4 additions & 1 deletion src/templates/base.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
{% block content %}{% endblock %}
</div>

<footer class="bg-dark text-white py-1 text-center">© Copyright 2019, Michael Götz (<a href="#">Impressum</a>)</footer>
<footer class="bg-dark text-white py-1 text-center">© Copyright 2020, Michael Götz
(<a href="#">Impressum</a>,
<a href="#">Datenschutz</a>)
</footer>

<script src="{{ static('js/form.js') }}"></script>
</body>
Expand Down

0 comments on commit c8a29d4

Please sign in to comment.