Hi Issuer, Plz check docs again for resolve your matter. Try either set csrf token cookies or use ensure_csrf_cookie() https://docs.djangoproject.com/en/3.0/ref/csrf/#django.views.decorators.csrf.ensure_csrf_cookie
On Fri, Dec 13, 2019, 05:10 হজমুলা খান <[email protected]> wrote: > thanx for your advice and i removed {% csrf_token %} and still same. > problem is not solved. add post form is not showing. > > > > On Thursday, December 12, 2019 at 3:24:48 PM UTC, Integr@te System wrote: >> >> Hi, >> >> Django view dont render csrf tag within template form, you should check >> doc in warning part >> https://docs.djangoproject.com/en/3.0/ref/csrf/ >> >> And look at the additional way to resolve your problem. >> >> On Thu, Dec 12, 2019, 16:45 হজমুলা খান <[email protected]> wrote: >> >>> i am integrating some apps to make a bigger project but the problem is >>> when i try insert ckeditor in html login page it is not showing. for this >>> reason i tried to make separate app is to see whats going on here. i am >>> showing you the code in detail. >>> editing/settings.py: >>> >>> >>> .......... >>> INSTALLED_APPS = [ >>> 'django.contrib.admin', >>> 'django.contrib.auth', >>> 'django.contrib.contenttypes', >>> 'django.contrib.sessions', >>> 'django.contrib.messages', >>> 'django.contrib.staticfiles', >>> 'editor', >>> 'ckeditor_uploader', >>> 'ckeditor', >>> ] >>> TEMPLATES = [ >>> { >>> >>> 'DIRS': [os.path.join(BASE_DIR,'templates')],........ >>> ..................... >>> STATIC_URL = 'editor/static/' >>> STATIC_ROOT='editor/static/' >>> CKEDITOR_UPLOAD_PATH='editor/static/media/' >>> >>> editing/urls.py: >>> >>> from django.contrib import admin >>> from django.urls import path, include >>> from django.conf import settings >>> from django.conf.urls.static import static >>> >>> urlpatterns = [ >>> path('admin/', admin.site.urls), >>> path('',include('editor.urls')), >>> path('ckeditor/',include('ckeditor_uploader.urls')), >>> ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) >>> >>> in this case, my static folder is in editor/static when i execute python >>> manage.py collectstatic and ckeditor folder is in editor/static directory >>> also. >>> >>> editor/models.py: >>> >>> from django.db import models >>> from ckeditor_uploader.fields import RichTextUploadingField >>> >>> # Create your models here. >>> >>> class Post(models.Model): >>> title=models.CharField(max_length=255) >>> body=models.CharField(max_length=2000) >>> description=RichTextUploadingField() >>> >>> def __str__(self): >>> return self.title >>> >>> editor/admin.py: >>> >>> from django.contrib import admin >>> from .models import Post >>> >>> admin.site.register(Post) >>> >>> when i execute python manage.py makemigrations and python manage.py >>> migrate, ckeditor can be seen in locahost:8000/admin's new post section >>> perfectly. then i tried to make templates. >>> >>> base.html: >>> {% load static %} >>> <html> >>> <head> >>> <title>Django blog</title> >>> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400" >>> rel="stylesheet"> >>> <link href="{% static 'admin/css/base.css' %}" rel="stylesheet"> >>> </head> >>> <body> >>> <div> >>> <header> >>> <div class="nav-left"> >>> <h1><a>Django blog</a></h1> >>> </div> >>> </header> >>> {% block content %} >>> {% endblock content %} >>> </div> >>> </body> >>> </html> >>> >>> home.html: >>> {% extends 'base.html' %} >>> {% block content %} >>> <h1>New post</h1> >>> <form action="" method="post"enctype="multipart/form-data"> >>> >>> {% csrf_token %} >>> {{ form.media|safe }} >>> {{ form.as_p }} >>> <input type="submit" value="Save" /> >>> </form> >>> {% endblock content %} >>> >>> and then i have created a html file editor/urls.py: >>> from django.urls import path >>> >>> from .views import HomePageView >>> >>> urlpatterns=[ >>> path('',HomePageView.as_view(), name='home'), >>> ] >>> >>> and here is the editor/views.py also: >>> from django.views.generic import TemplateView >>> from .models import Post >>> >>> >>> class HomePageView(TemplateView): >>> model=Post >>> template_name='home.html' >>> fields=['title','body'] >>> >>> i just want to see a simple page of showing new html post editor with >>> ckeditor toolbar in it. it's just for seeing what's wrong and why my >>> ckeditor toolbar is not showing in my html file. when i run python >>> manage.py runserver there is no error showing and the html page is showing >>> django post and new post and only the save button. it can't render the form >>> of the django's new post. css style is rendered because the django post and >>> new post has the desired color and font. but why it is not rendering the >>> new post form with ckeditor toolbar? >>> >>> i am still learning and this problem is eating me up. thanx in advance >>> >>> >>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/b8c48a91-b67c-4da0-8ce3-b301798a3851%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/b8c48a91-b67c-4da0-8ce3-b301798a3851%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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/6001f99c-e97c-495a-910c-cb436734a610%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/6001f99c-e97c-495a-910c-cb436734a610%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP5HUWo-KEwwcP2zDDHHaOBm-q_5coTO6n67RYu04bF%2B9mWTfw%40mail.gmail.com.

