Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view 20. return view_func(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view 91. response = view_func(request, *args, **kwargs) File "/home/user/dev/xyz/coupon/views.py" in enter_game 69. Coupon(coupon=coupon, player=player, credicts=credicts).save() File "/home/user/dev/xyz/coupon/models.py" in save 253. self.coupon.close_coupon() File "/home/user/dev/xyz/coupon/models.py" in close_coupon 78. current_date = datetime.datetime.now()
Exception Type: AttributeError at /wejdz-do-gry/49/ Exception Value: 'NoneType' object has no attribute 'datetime' Request information: GET: No GET data
> Traceback:
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
> in get_response
> 111. response = callback(request, *callback_args, **callback_kwargs)
> File
> "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py"
> in _wrapped_view
> 20. return view_func(request, *args, **kwargs)
> File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py"
> in _wrapped_view
> 91. response = view_func(request, *args, **kwargs)
> File "/home/user/dev/xyz/coupon/views.py" in enter_game
> 69. Coupon(coupon=coupon, player=player, credicts=credicts).save()
> File "/home/user/dev/xyz/coupon/models.py" in save
> 253. self.coupon.close_coupon()
> File "/home/user/dev/xyz/coupon/models.py" in close_coupon
> 78. current_date = datetime.datetime.now()
> Exception Type: AttributeError at /wejdz-do-gry/49/
> Exception Value: 'NoneType' object has no attribute 'datetime'
> Request information:
> GET: No GET data
> Don't know if that's a bug. Does anyone know how to deal with this issue?
> Cheers!
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iH-0-noK-zkJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>> Traceback:
>> File >> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in >> get_response
>> 111. response = callback(request, *callback_args, **callback_kwargs)
>> File >> "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" >> in _wrapped_view
>> 20. return view_func(request, *args, **kwargs)
>> File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" >> in _wrapped_view
>> 91. response = view_func(request, *args, **kwargs)
>> File "/home/user/dev/xyz/coupon/views.py" in enter_game
>> 69. Coupon(coupon=coupon, player=player, credicts=credicts).save()
>> File "/home/user/dev/xyz/coupon/models.py" in save
>> 253. self.coupon.close_coupon()
>> File "/home/user/dev/xyz/coupon/models.py" in close_coupon
>> 78. current_date = datetime.datetime.now()
>> Exception Type: AttributeError at /wejdz-do-gry/49/
>> Exception Value: 'NoneType' object has no attribute 'datetime'
>> Request information:
>> GET: No GET data
>> Don't know if that's a bug. Does anyone know how to deal with this issue? >> Cheers!
>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group.
>> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/iH-0-noK-zkJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to >> django-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en.
This function is stripped down I suppose, because it does nothing useful:
- it changes a few local variables (not values of the model)
- today is unused
- end_date is set to current_date which seems odd.
My guess is that you want the end_date set to half past seven of the
current_date:
I had a similar problem in one of my views. It looked like:
from X import y
def my_func():
foo = y.baz()
...
y = foo + bar;
Since I was assigning to y later in the function, “y” represented a local variable throughout the function. Somewhere you have “datetime =”, but it might be later in the method.
> Traceback:
> File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
> 111. response = callback(request, *callback_args, **callback_kwargs)
> File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
> 20. return view_func(request, *args, **kwargs)
> File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py" in _wrapped_view
> 91. response = view_func(request, *args, **kwargs)
> File "/home/user/dev/xyz/coupon/views.py" in enter_game
> 69. Coupon(coupon=coupon, player=player, credicts=credicts).save()
> File "/home/user/dev/xyz/coupon/models.py" in save
> 253. self.coupon.close_coupon()
> File "/home/user/dev/xyz/coupon/models.py" in close_coupon
> 78. current_date = datetime.datetime.now()
> Exception Type: AttributeError at /wejdz-do-gry/49/
> Exception Value: 'NoneType' object has no attribute 'datetime'
> Request information:
> GET: No GET data