Posts

Showing posts from August, 2016

Code Syntax Highlighting in django with Pygments

Image
Syntax Highlighting is a very much useful if you put code on your website. This can be easily achived with django-pygments . over 300 languages are supported. List of supported Languages:   http://pygments.org/languages/ django-pygments is the implementation of the pygments syntax highlighter for django. usage is quite simple. after setting up everything, you need to put necessary template tags and then place your code in pre tags with a lang attribute specifying the language of the source code in your template. example: <pre lang="python">YOUR CODE</pre> 1. First, Install the following packages. pip install pygments pip install django-pygments Read more »

How to Change your django Project name

Image
It's possible to rename a project in django. you just have to replace your existing project name in the following places with the new one. Your django project structure ProjectName/          manage.py           ProjectName/                   __init__.py                   settings.py                   urls.py                   wsgi.py Rename your project directory  (ProjectName) and the following inside your project directory. settings.py ROOT_URLCONF = 'NewProjectName.urls' WSGI_APPLICATION = 'NewProjectName.wsgi.application' wsgi.py os.environ.setdefault("DJANGO_SETTINGS_MODULE", "NewProjectName.settings") manage.py os.environ.setdefault("DJANGO_SETTINGS_MODULE", "NewProjectName.settings") There is no need to make any changes to any of your apps.