Skip to content

Commit 0eb7d8a

Browse files
authored
Merge pull request #9 from ahmedaljazzar/jazzar/upgrade
Upgrade Django with some modifications
2 parents e0239a6 + 3cee64e commit 0eb7d8a

File tree

6 files changed

+32
-26
lines changed

6 files changed

+32
-26
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/django-mako
5+
docker:
6+
- image: circleci/python:3.6.7
7+
steps:
8+
- checkout
9+
- run: sudo chown -R circleci:circleci /usr/local/bin
10+
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
11+
- run:
12+
command: |
13+
pip install -r requirements.txt
14+
- run:
15+
command: |
16+
python manage.py test
17+
- store_test_results:
18+
path: test-results
19+
- store_artifacts:
20+
path: test-results
21+
destination: tr1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ in my blog post named [Integrating third-party templates' libraries with Django]
8282
8383
## License
8484
The MIT License (MIT)
85-
Copyright (c) 2018 Ahmed Jazzar <me@ahmedjazzar.com>
85+
Copyright (c) 2017-2019 Ahmed Jazzar <me@ahmedjazzar.com>

config/urls.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
"""django-mako URL Configuration
2-
3-
The `urlpatterns` list routes URLs to views. For more information please see:
4-
https://docs.djangoproject.com/en/1.11/topics/http/urls/
5-
Examples:
6-
Function views
7-
1. Add an import: from my_app import views
8-
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9-
Class-based views
10-
1. Add an import: from other_app.views import Home
11-
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12-
Including another URLconf
13-
1. Import the include() function: from django.conf.urls import url, include
14-
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15-
"""
16-
from django.conf.urls import url
1+
from django.urls import re_path
172

183
from niceapp import views
194

205
urlpatterns = [
21-
url(r'^(?P<engine>django|mako)?$', views.function_based_view),
22-
url(r'^class/(?P<engine>django|mako)?$',
23-
views.ClassBasedView.as_view(),
24-
name='CBV'),
6+
re_path(r'^(?P<engine>django|mako)?$', views.function_based_view),
7+
re_path(r'^class/(?P<engine>django|mako)?$',
8+
views.ClassBasedView.as_view(),
9+
name='CBV'),
2510
]

niceapp/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.shortcuts import render_to_response
1+
from django.shortcuts import render_to_response, render
22
from django.views.generic import TemplateView
33

44

@@ -19,9 +19,10 @@ def function_based_view(request, engine):
1919
else:
2020
template_name = 'django.html'
2121

22-
return render_to_response(
22+
return render(
2323
template_name=template_name,
2424
context=context,
25+
request=request,
2526
using=engine,
2627
)
2728

@@ -38,7 +39,6 @@ def get_template_names(self):
3839
def get_context_data(self, **kwargs):
3940
context = super(ClassBasedView, self).get_context_data(**kwargs)
4041
engine = kwargs['engine']
41-
print context
4242
context.update({
4343
'items': [
4444
'Wow',

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django==1.11.3
1+
django==2.1.4
22
Mako==1.0.7

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name='djangomako',
6-
version='1.1.1',
6+
version='1.2.0',
77
packages=['djangomako'],
88
install_requires=['Mako==1.0.7'],
99
classifiers=[

0 commit comments

Comments
 (0)