I have a wagtail project being developed, essentially a blog with a forum. I chose django-machina as the forum I want to use because of how modular it is and how well it integrates into existing projects.
I followed the instructions in the documentation without issue, and the install was a success. I can access the app by going to /forum on my project.
However, the next step in the documentation refers to using the forum admin panel. My wagtail admin menu does not have a section for forum and I can't access the django admin panel as it is a wagtail project.
Where exactly can I access the django-machina forum admin panel in a wagtail project? Or would I have to recreate it somehow?
Jake, it's not so difficult. Let your project be named 'my_project'. So than we should go to my_project/my_project/urls.py. There we see something like this:
url(r'^django-admin/', admin.site.urls),
And what this string say to us? It show how to get the vanilla django-admin! Ok, now just go to your.site/django-admin and run your forum! ;)
Unless the documentation specifically mentions Wagtail, it's more likely that the admin panel shows up in the Django admin backend rather than the Wagtail one. On a standard Wagtail project this is found at the URL /django-admin/, but it depends on what you have specified in your project's urls.py file.
Related
I'm new to Django and I'm trying to learn it from Django for Professionals by William Vincent. After installing django-allauth and following the steps in the book, I managed to get the logging in and out the sign up functionality to work. However, when I go to 127.0.0.1:8000/admin, I don't see a Sites section. This section is later used in the book to change the site being referred to (example.com) in the registration confirmation email.
I've searched for django-allauth Site admin in here and in the docs but I couldn't find anything about making the Sites section show.
I suggest using the official docs
It should look probably something like -
admin.py
from django-allauth.models import Site
from django.contrib import admin
class DjangoAllAuthSiteAdmin(admin.ModelAdmin):
pass
admin.site.register(Site, DjangoAllAuthSiteAdmin)
I was able to solve this problem by adding 'django.contrib.sites' to the INSALLED_APPS list within settings.py.
I have built a Django application with a custom interface. It hasn't been changed in a couple of years.
These (previous) servers are running Django 3.0.8.
Recently I set up a new server, and the Django Admin interface now shows the model list in a scrolling iframe, and long tables on the right side are also scrolled independently of the page.
This server is running Django 3.2.3.
I don't like the new interface, but it more importantly it will require an extensive rewrite of our custom admin css.
Can anyone point me to information about the change, or tell me if there is a setting to disable it?
I found the answer in this Stack Overflow answer. I will leave this question up because the other answer doesn't mention iframes.
Django 3.1 added the new scrolling sidebar in an iframe.
To disable it add the following to the root urls.py file:
from django.contrib import admin
admin.autodiscover()
admin.site.enable_nav_sidebar = False
The 3.1 Release Notes say:
The admin now has a sidebar on larger screens for easier navigation. It is enabled by default but can be disabled by using a custom AdminSite and setting AdminSite.enable_nav_sidebar to False.
Reference links from the original answer:
Django 3.1 release notes
The Django admin site
I have a django admin where the name for the login was changed and after logging in the page is cut off. I went in to modify the page but it appears there is no admin/index under templates. I have looked throughout the project and can not find it anywhere. Is there an easy way to locate the files needed to proceed with the project?
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.
I want to create my own admin panel and every users will can have their own blogs. I'm using a blog app called 'Zinnia', I liked it. Zinnia have some visual editors (WYMEditor, Tinymce) also have a tag system, etc. that I want to have in my admin panel.
I was wondering if should I create my own admin panel or blog app and integrate the visual editor programatically. What would be better?
Thanks for answers.
EDIT: My real question is: What's better?
create my admin and my blog app
create my admin integrating Zinnia or another blog app
use the django admin panel (but i want to customize the fully admin panel, so I guess that is not a good option)
Remembering, the users (not only admins) can post to their blogs. (this is the reason that I don't want to use the Django admin)
EDIT 2:
Exactly what I want: I want to use all the features (such as tagging, WYMEditor [I know i can implement this programmaticaly], etc.) of Zinnia (or another blog app) with my custom admin panel, with my buttons, my layout, my css, my everything!
Thanks for all answers, it's important for me.
Here is a simple tutorial for creating a django blog app:
http://lightbird.net/dbe/blog.html
If you are still learning django, I recommend it to create your own blog!!!
Creating a good Django blog application is straightforward, but tedious work, that can quite easily get unwieldy if you start implementing additional features such as multiple language support, linkback handling, search, sitemap generation, etc.
I definitely wouldn't suggest that you start from scratch. If your not completely satisfied by the full extent of possibilities or the initial feature set of Zinnia, you can check out all the Django blog applications on Django Packages.