Posts

Showing posts from January, 2024

CKEDITOR fixed for pythonanywhere.com | collecstatic

   It worked. after, Web tab, static url: /home/username/project/staticfiles/ bash: go to same directory where mange.py file is present python3.10 manage.py collectstatic pip install django-ckeditor  

csrf script

 <script type="text/javascript">         function getToken(name) {           var cookieValue = null;           if (document.cookie && document.cookie !== '') {             var cookies = document.cookie.split(';');             for (var i = 0; i < cookies.length; i++) {               var cookie = cookies[i].trim();               // Does this cookie string begin with the name we want?               if (cookie.substring(0, name.length + 1) === (name + '=')) {                 cookieValue = decodeURIComponent(cookie.substring(name.length + 1));                 break;               }             }           }           return cookieValue;         }         var csrftoken = getToken('csrftoken');            </script>