How to live preview markdown files in PyCharm

This a simple tutorial but took me a while to figure out owing to the unavailability of proper documentation. So, I thought of documenting it here with the hope that it will save you some pain. Note this tutorial was tested on MacOS High Sierra with a PyCharm Community Edition 2017.1.3

Step 1: Install Markdown Support for PyCharm

Go to Preferences -> Plugins -> Browse Plugins

and search for “markdown” and install the Markdown Support plugin (refer to figure below)

After installation, PyCharm will restart to register the installation.

Step 2: Make sure *.md file pattern is registered to markdown files

Go to Preferences -> Editor -> File Types

and add *.md file pattern for markdown files (refer to figure below).

Reopen your markdown file or restart PyCharm to see the change. You should see something like the following when it is working correctly:

Using memcached for Django Cache Framework

The fastest, most efficient type of cache supported natively by Django, Memcached is an entirely memory-based cache server, used to reduce database access or store pre-computed stuff that will be used in the near future. It is used by sites such as Facebook and Wikipedia and have dramatically improved their site performance.

The first step to this process is setting memcached server. Here is how you can set up memcached server in RedHat Linux:

  1. Install memcached
  2. sudo yum install memcached
  3. Start the service
  4. sudo service memcached start
  5. Configuration of memcached
  6. memcached -h lists all the commands that are available from the bash. The default configuration for the memcached server is saved in a file at /etc/init.d/memcached. In most cases, you may have to modify the file to your needs – for example you may have to change the server host, port number, cache size etc. Feel free make the change and restart the server sudo service memcached restart. At the beginning of the config file, you will see the following code:

     if [ -f /etc/sysconfig/memcached ];then
       . /etc/sysconfig/memcached

    meaning it reads the variables listed in the file /etc/sysconfig/memcached if it exists. In the function named “start”, you will see the following line:

      daemon --pidfile ${pidfile} memcached -d -l $HOST 
                                               -p $PORT 
                                               -u $USER  
                                               -m $CACHESIZE 
                                               -c $MAXCONN 
                                               -P ${pidfile} 

    These are the variables it is looking for when the server is started. You can either provide the variables from the file /etc/sysconfig/memcached as the following:


    or provide the values editing the config file directly. Just note that it will first look for values in the /etc/sysconfig/memcached file.

Once you are done setting up memcached, you can check its status by:
sudo service memcached status

Now, it is time to hook up memcached server with Django. First off, you need to have have a Python binding that will talk to the server. Two bindings are available – python-memcached and pylibmc. I used python-memcached as it was a little more straight-forward to install than that of pylibmc. For python-memcached, I downloaded the tar file from here, extracted the file and ran “python install” from the extracted folder. It was as simple as that.

To set up your django project to use memcached as the cache backend, following need to be added to the file:

CACHES = {'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',