Skip to content

Instantly share code, notes, and snippets.

View aishwarydhare's full-sized avatar

Aishwary Dhare aishwarydhare

  • MishiPay Ltd
  • Bangalore, India
View GitHub Profile
@aishwarydhare
aishwarydhare / django_nav_menu_maker.py
Last active March 4, 2019 10:50
Creating a MenuList : Django Admin App
from collections import OrderedDict
from django.urls import resolve
from django.urls import reverse
def get_menu(context):
# [ 'display name', 'level 1 parent (optional)', 'django url', 'css icon', 'level 2 parent (optional)']
menus = [
['solo', '', 'solo_url', 'fa fa-desktop'],
['test', '', '', 'fa fa-desktop'],
from http.server import BaseHTTPRequestHandler, HTTPServer
class SampleHTTPServerHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
print(self.headers)