Django admin - disabled app links - django

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.

Related

Extending the Page Model in django-cms 3.01

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.

django admin django.contrib.staticfiles

I'm following the tutorial contained here:
http://www.djangobook.com/en/2.0/chapter06.html
They say that the admin site should look like this:
http://www.djangobook.com/en/2.0/_images/admin_index.png
When I start the admin site, though, it looks really simplistic, just plain text and links:
Django administration
Welcome, admin. Change password / Log out
Site administration
Auth
Groups Add Change
Users Add Change
Recent Actions
My Actions
None available
I noticed that it looks all nice like the link when I uncomment django.contrib.staticfiles from the INSTALLED_APPS, although that wasn't mentioned in the tutorial...can someone please explain this behavior to me?
Thank you for your help!
The Django Book is a little out of date (although an update is in the works I believe):
This book was originally published by Apress in 2009, and covered Django 1.0. Since then, it’s languished. We’re working on getting the book updated to cover Django 1.4, 1.5, and beyond
Static files are all the CSS/JS & images that your site (and the django admin) uses. They need to be collected and placed somewhere that your server (or development server) can serve them. This is the job of django.contib.staticfiles.
You can read more about this in the 'Managing Static Files' documentation
Websites generally need to serve additional files such as images, JavaScript, or CSS. In Django, we refer to these files as “static files”. Django provides django.contrib.staticfiles to help you manage them.

Django - empty Admin interface

I have just started deploying my first large django project. I have setup the admin but when I login - everything is empty! I haven't seen this before, so I'm at a loss as to where to look for the issue. Below is a screenshot:
Any suggestions?
This is a very wild hunch but try using
admin.autodiscover()
in your url file. For more info refer to the django tutorial.
I do not know, if it is a newbie mistake you make during deployment on production server, but perhaps you could check this:
see the following unicode issue:
https://code.djangoproject.com/wiki/NewbieMistakes#Blankobjectnames

What are some Apps or add ons that get used to customize Django Admin

Im looking for a list or just suggestions on some Django Admin must haves or things that people tend to use.
I'm particularly interested in adding a Wysiwyg or Markdown Editor to the the TextAreas in the Django Admin.
Any suggestions?
There are a number of apps that add wysiwyg editors to Django's admin, such as django-wysiwyg. There are also a couple of articles on this subject in Django's wiki. Some other django apps that are great for admin customization are django-admin-tools and grappelli. Beyond being a general ovehaul of the user interface, grappelli also includes support for the inclusion of a wysiwig editor. And as always, the Django docs are usually a good first stop.
Personanlly, I'm particularly fond of grappelli, it's been used to great effect on a number of Django projects, including mezzanine and a few of my own! Here's a preview of the facelift it gives Django's admin:
Have you take a look at this list ?
I use the django-adimin-tools myself, it lets you create custom menus and custom dashboard as well as custom css. Here is what it looks like pretty much out of the box. Items are draggable. More on that here.
I also used django-admin-bootstrapped which uses twitter bootstrap to make the admin look nicer. more information on it here.
Grapelli is probably the most popular though and I have been using it in my Mezzanine apps but haven't yet tried it in a vanilla Django app as of yet.

Can't get Google map to show up in Flatpage using Django Flatpages

I have a client with a "Directions" page in their website and they wanted to add a Google map to the page, so they went to maps and put in their location and then used the "embed" link to get the html for the iframe. They then opened up the Flatpage for "Directions" page in the admin and went to html mode in TinyMCE and then pasted in the code, but as soon as they save the code is gone and there is no map, just the div tags that surrounded the iframe are left.
I have tried Googling and I have repeated the process myself but no success, does anyone know if you are just not allowed to insert iframe html into the body of a Flatpage in django?
Unless you've added some kind of additional validation/cleaning, flatpages would not remove anything from the content. Have you tried without TinyMCE?
update: The point isn't that you'd leave TinyMCE disabled; the point is to narrow down where the problem is, so you can actually fix it. And I'm almost certain the problem here is TinyMCE, not Django.
I would suspect that tiny-mce is garbling something up. I'd try to disable tinymce and see if you have the same problem. Also, make sure you're using the 'safe' filter on the text in the templates. Otherwise Django will escape all the HTML.