Suppose if you want to get some data from Django server. You will usually get the data in the template via a View method. Hitting the URL will also cause the page to refresh. What if you simply wanted some…
Category: django
Shell Script to Run Django Development Server Automatically
We all know how boring it can be to start the django development server each time. entering the same commands over and over. The good news is that you can write a simple shell script to do so. and after…
Minify JavaScript / CSS with Django Compressor
Django Compressor minifies JavaScript and CSS files. It can combine several inline or linked files into cacheable static files. it also supports uglify wih yuglify compressor Install Django Compressor pip install django_compressor In your settings.py INSTALLED_APPS = ( # Add…
Automatically create OneToOneField in Django
The Django-annoying package contains various useful functions and AutoOneToOneField is one of them. Using AutoOneToOneField a related object is automatically created when the parent object is created. In this example, whenever a new user account is created, a corresponding Profile…
How to Fix – Operational Error: cannot open database in Django Sqlite3
This may be a permission problem. the database file must be writable to the user you need to grant permission to db.sqlite3 here, myproject is the folder which contains db.sqlite3 file chmod 664 /path/to/myproject/db.sqlite3sudo chown :www-data /path/to/myproject/db.sqlite3 sudo chown :www-data…
How to style Django Forms with Bootstrap
Though we can use third-party packages like Django-Crispy forms to style forms in django with ease but still it’s sometimes required to style django generated forms all by yourself, here we will see how to do that. the form will…
How to Install and use Django Crispy Forms
Crispy forms is a third party django app that makes styling forms really simple. It makes your forms look beautiful with almost no effort from your side. It supports different template packs like uni-form, foundation, bootstrap and bootstrap3 , that’s what we…
Simple Hello World page with django 1.9 in Ubuntu / Linux Mint [Beginners] [Part – 2]
In the First part of this tutorial we created an app named helloworld and added it to the setting.py file. Now let’s continue further towads our journey to make a ‘Hello World’ page with django. Urls Let’s define our url…
Simple Hello World page with django 1.9 in Ubuntu / Linux Mint [Beginners] [Part – 1]
Django is a web framework written in python. It is good for fast web application development. In this tutorial we will learn how to make a simple web page showing “Hello World” using django templates. we will also be applying…
How to Install wysiwyg editor in your django project
with django-wysiwyg, you get different rich html text editors, making it easier to write article posts.It supports TinyMCE, CKEditor, Redactor, Froala, yui and more Follow the below steps to setup django-wysiwyg in your django project. 1. Install django-wysiwyg pip install…