Skip to content

Instantly share code, notes, and snippets.

View Inayatullahsh's full-sized avatar

InayatUllah Shinwari Inayatullahsh

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3 ways to center a div</title>
<style>
body {
font-family: sans-serif;
@Inayatullahsh
Inayatullahsh / force_default_language_middleware.py
Created May 24, 2022 22:11 — forked from vstoykov/force_default_language_middleware.py
Force Django to use settings.LANGUAGE_CODE for default language instead of request.META['HTTP_ACCEPT_LANGUAGE']
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class ForceDefaultLanguageMiddleware(MiddlewareMixin):
"""
Ignore Accept-Language HTTP headers