django-tellme rendering problem in django admin - python

I installed this app but when I run it, I get a error in django admin, it does not rendering HTMl text as it should have done, I'm not familiar with how to make these customizations, I have also posted a issue, if it help in understanding my problem, I hope I get a solution for this.
Thanks

I check and asked this question to few more peoples and check the repo carefully and I got the solution that if I use
from django.utils.safestring import mark_safe
when returning elements then it will render html in admin too
you can see it here

Related

Is there any other way to implement RichTextField in a django blog

I'm working on my blog web using django. In my models.py I implemented RichtextField instead of the normal CharField or Textfield or others. I already imported it like this from ckeditor.fields import RichTextField after installing 'ckeditor' in 'INSTALLED_APPS in my projects settings.py.
Everything is working just Fine!
But there is problem!
The problem i'm facing is, I don't get to see the result of whatever I type in in my Django admin site using the RichTextField except plain text and some HTML tags in my localhost page.
What I mean is:
Supposing in my text-typing, I have something like this 'This is a bright new day...', and I want to bold 'bright' like this- 'bright'. I get to see it working perfectly in my django admin site. But when I refresh to my localhost page to where the text-typing is displayed, I get to see some weird HTML tag like this <b 'bright' /b> instead of 'bright'. And it did the same thing when I used summernotes.
So, please I will like to know why it's going that direction instead of the direction I want.
Secondly, the possibly solution to help me make move in the direction I want.
This same problem cut across to when I want implement codes, italics, headers, etc. in my whatever text I wish to change to those form.

Heroku Django Admin returns 'FileNotFoundError at /admin/projects/project/add/'?

I am trying to setup a Django admin page to be able to update my project portfolio directly. Everything works fine until I click on the 'add project' button. Then I'm hit with an error:
I do not understand what it is looking for. Any insight would be helpful as I've tried searching google/stack and haven't found a similar issue with a solution. If you need more information, let me know and I'll update my question.
I think the problem is in the file path on your django models. try changing the
models.FilePathField(path='#fullpathtoyourphotosdirectory')

django-tinymce to work on all textareas in django admin

I have been trying to get tiny mce to work for my django admin site on all textareas without having to add each field's widget. I have a lot of forms and would like this to work as "automagically" as possible.
I have installed tiny mce using the "pip install django-tinymce" method.
I have followed the following article and even though it does not throw any errors in firebug or developer mode I cannot see what I am doing wrong.
https://blog.bixly.com/django-tinymce-in-djangos-admin-app
I have followed this to a the letter with no luck at all. Any thoughts or suggestions to get this working on all textareas would be greatly appreciated.
Thanks,
jAC
I was able to get this to work by using admin.py's ModelAdmin classes.
For example:
#admin.register(HomePageSlider)
class HomePageSliderAdmin(admin.ModelAdmin):
class Media:
js = ( '/static/assets/js/tiny_mce/tiny_mce.js' , '/static/assets/js/tiny_mce/textareas.js' )
The first part is for the tinymce location and the second is loading the configuration that i threw in a textareas.js file.

How to use the Django-Scheduler package?

I am looking to use the Django-Scheduler package in my Django project but am finding it difficult to understand how to actually implement the calendar so that it can be seen on the actual website. My website is meant to be a timetable scheduling system where users can login and use and edit there own timetable/calendar. I have already implemented the login and registrastion using django registration redux. I have also already installed django-scheduler using pip and have edited my projects settings like so:
INSTALLED_APPS += ('schedule',)
add to
TEMPLATE_CONTEXT_PROCESSORS += (
"django.core.context_processors.request",
)
This is explained on the github page for django-scheduler. I have read through the documentation but am still not sure as to how to have a usable calendar on the page the user is sent to after logging in.
Could someone please explain to me as to how I can achieve this. What do I put in my projects url.py file for django-scheduler like eg the url for django-calendarium,
url(r'^calendar/', include('calendarium.urls')),
Do I have to create new templates etc.
Hope somebody can help ! Thanks
this will serve you
url(r'^calendar/', include('schedule.urls')),
if you still to know more about the url, views, models and config of schedule check https://github.com/llazzaro/django-scheduler/tree/develop/schedule and https://github.com/llazzaro/django-scheduler/tree/develop/schedule/urls.py for

How do you add a new entry into the django admin index?

I'm working on a Django project, and I've created some custom admin views using the get_urls override method described in the documentation. It works perfectly. There is just one problem. There is no way to get to this custom admin view unless you already know the URL.
There are some ways I already know of to add a link to this view somewhere in the admin, but none of them are satisfactory. I want a link to the custom view to appear in the model listings right with all the model admins. I just don't want it to have +add or +change links next to it because it isn't a model.
I could just override the admin_site or the template, but this is no good. It puts the customization on the project level instead of the app level. It also will only put the link on the /admin/ page and not the /admin/myapp/ page.
I could also just easily add the link in a different location by overriding the app_index.html template, but that is not exactly a convenient or intuitive place to look for it.
Another solution I came up with is to create a blank model and register a blank admin for it. Then steal the url patterns for that model so clicking on its entry goes to my custom view instead of to a blank add/change view. That works, but it's an incredibly ugly hack.
Here is a picture of what I'm trying to achieve.
I still think the correct way of doing this is overwriting some parts of django admin templates. There is no easy way of adding these links.
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template
I also found this article http://coffeeonthekeyboard.com/o-hai-django-adminplus-568/ which also suggests that django-adminplus is a good tool for doing this. Personally I prefer to keep clear of any extra dependancies and would still use templates - but thats up to you.
Have you tried this app: https://github.com/jsocol/django-adminplus? Even if it does not work for the exact purpose you are trying to achieve, at least it can give you some enlightement by checking out the code
You need to override the template admin/index.html. Thenput a new pair of tags after the {% endfor %} on line 40.
You might also be able to solve it using jQuery.

Categories