BLOG

A LITTLE STORY ABOUT MY JOURNEY

Screen Shot 2015-09-05 at 17.24.26

Weekend exercise with django-mptt

Welcome to Django Mptt Demo Welcome to Django mptt demo module. This demo explains how to create tree level category and demonstrate mtpp library Repo : https://bitbucket.org/cyberkishor/django-mptt-demo/wiki/Home Django Mtpp demo features Create Tree level category Display tree level category list in admin panel Display category as tree in another db relation like forenkeyTree (example used in […]

Install mod_wsgi Mac

We’re going to use Homebrew to install mod_wsgi. There is some extra step to install it, you can read https://github.com/Homebrew/homebrew-apache to have more information. Then, load new Formulas into brew:

Finally install mod_wsgi

Once mod_wsgi installed, we’ll enable it in Apache: edit /etc/apache2/http.conf and add this line

Test the config and restart […]

Django Custome Validation model FileField

We can validate field with own validation rule like:

inside models.py

  🙂  

Django get current user globally in the project

Sometimes, you will need to get the current authenticated user in models, or other parts of your app. To achieve this, you must create this middleware in your app(middleware.py) and add it to MIDDLEWARE_CLASSES in project settings: ‘myapp.middleware.GlobalUserMiddlware’

Use Example:

Refrence: http://simionbaws.ro/programming/python-programming/django-python-programming/django-get-current-user-globally-in-the-project/

1 2 3