Hi there. I have yet to add a login/register page since I am only trying to 
access the admin page which is a part of the Django project setup. So in 
effect, there are no HTML pages setup and I cant access the Django admin 
page layout as this is an integral part of Django!!! This is the problem!! 

I'm not sure if anyone else who sets up a  Django project would need to 
create any HTML pages before they create a superuser login enabling them to 
access their admin section.

I cant resolve this issue!!

Cheers

J

On Monday, March 13, 2023 at 2:08:06 PM UTC Andrew Romany wrote:

> It's very simple you should add it in the login/register html page but 
> inside the <form method='post'> tag after &  to be specific after this 
> above line.
>
> On Mon, 13 Mar 2023, 11:15 a.m. James Hunt, <newbyp...@gmail.com> wrote:
>
>> I have yet to create a HTML page so I'm not sure that the inclusion of {% 
>> csrf_token %} is required. I mean it's just the admin page I am trying to 
>> access which is provided by Django and not a page created by me!!!
>>
>> I am very surprised there is no fix for this issue!!! I might need to 
>> abandon Django and move a different framework given that this issue is at 
>> the start of a project!!!
>>
>> Cheers
>>
>> Jay
>>
>> On Monday, March 13, 2023 at 3:06:42 AM UTC Mir Junaid wrote:
>>
>>> try including this line in your index.html or main HTML page 
>>> {% csrf_token %}
>>> if it still doesn't work do include it in every html page
>>>
>>> On Sat, 11 Mar 2023 at 23:33, James Hunt <newbyp...@gmail.com> wrote:
>>>
>>>> Hi there. I am fairly new to Django but have had previous success with 
>>>> creating an app and being able to access the Admin page.
>>>> Recently, if I attempt to access the admin page of a new Django app it 
>>>> throws the CSRF error upon trying to log in!!!
>>>>
>>>> I have attempted several ways to bypass this error including adding 
>>>> allowed hosts but I cant seem to get past this issue.
>>>>
>>>> Can someone please provide me with the definitive way of stopping CSRF 
>>>> error when simply trying to access the admin part of Django? I mean there 
>>>> are no post functions that really apply to this feature so I cant 
>>>> understand the CSRF token.
>>>>
>>>> I cant get past this issue which means I can never access the admin 
>>>> page!!
>>>>
>>>> Please help.
>>>>
>>>> Regards
>>>>
>>>> James
>>>>
>>>> -- 
>>>>
>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/6f8d686c-3075-4aff-8227-c2f86e35555cn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/6f8d686c-3075-4aff-8227-c2f86e35555cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/447340ca-8977-4f28-9b1f-e2358c205914n%40googlegroups.com.

Reply via email to