diff --git a/example/anonymizer/base.py b/example/anonymizer/base.py index 967d9cf..57ebc0e 100644 --- a/example/anonymizer/base.py +++ b/example/anonymizer/base.py @@ -1,11 +1,10 @@ from __future__ import absolute_import -import datetime - from django.contrib.admin.models import LogEntry from django.contrib.auth.models import Group, Permission, User from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.models import Session +from django.utils import timezone from dj_anonymizer import fields from dj_anonymizer.register_models import ( @@ -18,9 +17,9 @@ class UserAnonym(AnonymBase): email = fields.string('test_email_{seq}@preply.com', - seq_callback=datetime.datetime.now) + seq_callback=timezone.now) username = fields.string('test_username_{seq}@preply.com', - seq_callback=datetime.datetime.now) + seq_callback=timezone.now) first_name = fields.string('first name {seq}') last_name = fields.string('last name {seq}') password = fields.password('password') diff --git a/example/anonymizer/polls.py b/example/anonymizer/polls.py index 9ccf522..0aa9af4 100644 --- a/example/anonymizer/polls.py +++ b/example/anonymizer/polls.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -import datetime +from django.utils import timezone from dj_anonymizer import fields from dj_anonymizer.register_models import ( @@ -13,7 +13,7 @@ class QuestionAnonym(AnonymBase): question_text = fields.string("John Doe {seq}") - pub_date = fields.function(datetime.datetime.now) + pub_date = fields.function(timezone.now) class Meta: pass diff --git a/example/project/urls.py b/example/project/urls.py index d52422e..5bcbcb8 100644 --- a/example/project/urls.py +++ b/example/project/urls.py @@ -1,7 +1,7 @@ -from django.conf.urls import url from django.contrib import admin +from django.urls import path urlpatterns = [ - url(r'^admin/', admin.site.urls), + path('admin/', admin.site.urls), ]