I am using django tinymce for a text field in django form. It is not admin based.
For inserting images, I tried django-tinymce-filebrowser. It is giving me following error in firefox error console in tiny_mce.js file:
TypeError: p is undefined
Also the browse button displays link to following javascript function:
openBrowser('srcbrowser','src','image','theme_advanced_image_image_browser_callback')
I am not getting from where it is coming.
My settings.py looks like this:
TINYMCE_DEFAULT_CONFIG = {
...
'file_browser_callback': 'mce_filebrowser'
}
I tried searching for django-tinymce-filebrowser examples but nothing much is available. Most of the documentation is for django filebrowser which work in admin only.
Does anyone has clue how to configure this filebrowser?
Related
I created a site in Django that I deployed on heroku. I am trying to display this site in an iframe contained in an html file on my hard drive. So I used Django-csp. I added the following line in my settings.py file:
CSP_FRAME_SRC = ["localhost"]
However when I load my html page, the iframe does not contain content and I get the error: gkwhelps.herokuapp.com refused connection. To solve the problem, I modified my settings.py file as follows:
CSP_FRAME_SRC = ["*"]
but I still get the same error. Being a beginner in Django-CSP, I don't really know how to get out of this situation. Thank you !
I am learning Django from https://www.youtube.com/watch?v=nAn1KpPlN2w&index=5&list=PL6gx4Cwl9DGBlmzzFcLgDhKTTfNLfX1IK
I have did exactly the same things mentioned in it.But still these errors are coming at the end when I restart my server to see changes in music and admin page. These errors are:
Here is an image of the command line with the errors show.
from django.import views
This is an invalid syntax and is not a correct way to import in Python.
Instead, according to the tutorial, you should be importing views from your django app:
from . import views
I just started using django-cms 3.01 and django 1.6.4/python 2.7.6. My last experience with django was 1.4 and I've never used django-cms before now.
I am trying to follow the instructions in the official documentation on Extending the Page & Title Models, but I am experiencing an issue.
The custom field I need to add is very similar to the example, so I simply used their code exactly. Rand a syncdb, started the server and everything was going well. The field shows in the admin just fine. There is an entry in the admin menu for "Icon Extensions." I click add, and I get to the form to upload the file. I go to upload the file, and I receive the following error:
DoesNotExist at /admin/the_site_name/iconextension/add/
IconExtension has no extended_object.
...
Exception Type: DoesNotExist
Exception Value: IconExtension has no extended_object.
Exception Location: /Users/me/Sites/the_site_name/env/lib/python2.7/site-packages/django/db/models/fields/related.py in __get__, line 326
Most likely I'm just missing something simple, but I can't figure it out. Should I have a foreignkey linking it directly to the page? I thought it was handled automatically, but obviously I'm not completely getting it jsut yet.
Any help is appreciated.
You must edit extensions in the frontend editing toolbar. Add a button to toolbar as described in the section "Adding a Toolbar Menu Item for your Page extension" in the documentation you linked above.
As you can see from the screenshot below, 'Invite' app link is disabled. Actually this is just a text. If I open the model directly - /admin/invite/invite/ - I get 404 page.
What is the reason for that? That looks really strange, never seen that before.
Django 1.5.1
Worth mentioning - we don't use any special HTML admin templates.
It turned out it was because we've extended urls in admin.py file. That was the reason.
I'm playing with django-planet with Django 1.6, and after some (minor) adaptions. I uploaded some feeds (and I can see them in Django-admin) and mounted them in url.py like this:
url(r'^feeds/', include('planet.urls'))
but when I navigate to feeds/ or any other url specified in django-planet urls.py :
some examples:
url(r'^blogs/$', "blogs_list", name="planet_blog_list"),
url(r'^feeds/$', "feeds_list", name="planet_feed_list"),
I get a blank and empty page. not an error page. but a blank page. when I look at the request I see the django server returning a 200 status. where are django-planet default pages? When I look at django-planet code the views seem to exists..and else I would get an error page
urls.py doesn't look broken to me, since when I navigate to non existent urls in feeds/ or otherwise I do get the expected error page.
I have 2 suspicions:
django-planet not finding the templates. when I look at the lib structure it seems that views.py is naming views that sit in planet subfolder, but actually planet subfolder is under templates folder.
some missing django-planet and undocumented config in my settings.py
how can I solve this?
What am I missing? I'll be glad for help with this
I even downgraded to Django 1.5 but it didn't solve the problem