access denied for user debian-sys-maint

That’s because Debian has a MySQL account debian-sys-maint used for switching on/off and checking status. The password for that user should be the same as stored in /etc/mysql/debian.cnf. The file looks like this: # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = <password> socket = /var/run/mysqld/mysqld.sock … Read more

Django Admin – Specific user (admin) content

First, the cautionary warning: The Django admin design philosophy is that any user with access to the admin (is_staff==True) is a trusted user, e.g. an employee, hence the “staff” designation to even gain access to the admin. While you can customize the admin to restrict areas, allowing anyone not within your organization access to your … Read more

Django how to pass custom variables to context to use in custom admin template?

class MyModelAdmin(admin.ModelAdmin): … def changelist_view(self, request, extra_context=None): extra_context = extra_context or {} extra_context[‘some_var’] = ‘This is what I want to show’ return super(MyModelAdmin, self).changelist_view(request, extra_context=extra_context) See: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.changelist_view

How to add readonly inline on django admin

After a while of trying to find the name I figured out thanks to this answer, so I checked the names at self.opts.local_fields and found the name of the middle table and added it to readonly_fields, setting can_delete to False. class SummaryInline(admin.TabularInline): model = ParserError.summaries.through readonly_fields = (‘myclasssummary’,) can_delete = False pretty simple but took … Read more

Unable log in to the django admin page with a valid username and password

Steps to debug: Make sure that your Database is synced Double check that you have a django_session table Try to authenticate Do you see a record being created in the django_session table? IF NOT remove non-standard settings AUTHENTICATION_BACKENDS = (‘django.contrib.auth.backends.ModelBackend’,) SESSION_EXPIRE_AT_BROWSER_CLOSE = True SESSION_SAVE_EVERY_REQUEST = True SESSION_COOKIE_AGE = 86400 # sec SESSION_COOKIE_DOMAIN = None SESSION_COOKIE_NAME … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)