Rabu, 15 April 2015

BPython: Shell command made easy

Sometimes I have to open django shell to testing method or anything and if I change the code then I have to restart my shell again.

I didn't like it because I have to write some import I just wrote in last shell.

Thank to bpython to make my life easier, because bpython can save your shell code history and show snippets to help you write code in shell.

To install bpython, simply run:
pip install bpython
Thanks

Selasa, 14 April 2015

Django test error: ImproperlyConfigured: The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.

One day ago, I wanted to test my app using django test module

then I got an error says:
ImproperlyConfigured: The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.

Since I'm using mac, the error is finally fixed after I added:
SPATIALITE_LIBRARY_PATH = '/usr/local/lib/mod_spatialite.dylib'
in my test_settings.py

Thanks

Create a new fresh django project

Hello readers,

to create a new django project is easy

first you have to install django. I used pip to install django

type: pip install django

and django will install to your machine (currently I have django version 1.7), by the way you have to install pip before

then create new django project

just type: django-admin startproject <project_name>

project_name = name of your own project

example: django-admin startproject mynewblog

it will create your new django project named mynewblog

Thanks