All Posts Create a Post  
1
votes
367
views
How to create Django Language Middleware
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

This example below to setup default language code as id (Indonesian). Your file middleware.py # -*- coding: utf-8 -*- from django.conf import settings from django.utils import translation from django.utils.deprecation import …

146 7 7 0
1
votes
592
views
Django Standard API Response Middleware for DRF
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

As you can see, if you using django-rest-framework, you will found many different response format. This middleware to solve all of these problems with implement the Standard API Response. All …

146 7 7 0
1
votes
428
views
How to custom select language icon in django administration
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

1. Add the base_site file inside templates/admin/base_site.html. {% extends "admin/base.html" %} {% load static i18n %} {% block title %}{{ title }} | {{ site_title|default:_('Situs django admin') }}{% endblock %} …

146 7 7 0
1
votes
453
views
How to make a notification when terminal process is complete
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need …

146 7 7 0
1
votes
419
views
Pylint-django raising error about Django not being configured when that's not the case (VSCode)
Posted at 8 months, 2 weeks ago / May 2, 2021, noon

Pylint-django worked just fine up to version 2.3.x but since 2.4.0 it reports an error on every python-django file: Django was not configured. For more information runpylint–load-plugins=pylint_django –help-msg=django-not-configuredpylint(django-not-configured) This happens …

146 7 7 0
1
votes
555
views
Auto-create primary key used when not defining a primary key type warning in Django
Posted at 8 months, 2 weeks ago / May 2, 2021, 11:26 a.m.

I just updated my python from 3.9.1 to 3.9.4. When I tried to run the server. The console gave me a warning for this: WARNINGS: learning_logs.Entry: (models.W042) Auto-created primary key …

146 7 7 0
1
votes
350
views
How to remove user from telegram channel using python
Posted at 8 months ago / May 20, 2021, midnight

I am using telethon for adding users in the telegram channel but how to remove or delete users from Particular telegram channels? There is one function to restrict user so …

146 7 7 0
0
votes
757
views
Step by step how to use multiple databases with database routers in Django
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

1. Please create a new superuser for the second/default/current database. Because you will getting this issue that i already asked before: https://gitter.im/django/django?at=5810b0b5806316005dc11f46 i use multiple site, multiple env, multiple project, …

146 7 7 0
0
votes
317
views
Django Contact Form Widget
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

Django contact widget is once of plugin i already released. This is simple contact widget plugin for Django. inspired from https://github.com/ubernostrum/django-contact-form, but made more simple and easy to use. Demo …

146 7 7 0
0
votes
662
views
Understanding @user_passes_test Django
Posted at 1 year, 3 months ago / Oct. 11, 2020, 8:04 a.m.

Django decorator has a function to manage the user, once of it is user_passes_test. But, in my implementation i found this problem: ERR_TOO_MANY_REDIRECTS, or ‘AnonymousUser’ object is not iterable. I …

146 7 7 0
  Page 1 of 11