are you sure your url is in admin/visit?

path('today/', PaymentTodayArchiveView, name="today"),

404 says you have a url routing issue, not a view issue.

On Wednesday, August 8, 2018 at 8:42:06 AM UTC-4, Gerald Brown wrote:
>
>
>
> On Wednesday, August 8, 2018 at 8:15:21 PM UTC+8, Jason wrote:
>>
>> what have you tried so far?  What issues are you having with the 
>> documentation examples?
>>
>> "can't get them to work" is really uninformative,  RIGHT.
>>
>
> What I tried was the TodayArchiveView by following the docs. When I enter 
> http://127.0.0.1:8000/admin/visit/today/ in my browser I get a 404 error
>
> The code in my views.py file is:
> class PaymentTodayArchiveView(TodayArchiveView):
>     vi = Visit.objects.all()
>     date_field = "visit_date"
>
> The code in my URLS.py file is:
> path('today/', PaymentTodayArchiveView, name="today"),
>
> In the docs is says ".as_view()" should be added to 
> PaymentTodayArchiveView. When I add that I get "AttributeError: 'function' 
> object has no attribute 'as_view'" error.
>
> Guess I will have to dig more into the docs as I just discovered this 
> tonight and "MAYBE" I didn't read all of the  docs thoroughly enough.
>
> Thanks for your reply.  I have discovered that by discussing my problem I 
> am then able to come up with a solution.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c0ee6e7-5463-45e6-bbf8-7c49ace576cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to