From b98fd07a35351688c8a7a3952e2551d34be9fe24 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 8 Nov 2012 16:19:46 +0530 Subject: [PATCH] add README --- README | 19 +++++++++++++++++++ ifa/films/imports.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..460638d --- /dev/null +++ b/README @@ -0,0 +1,19 @@ +Setup: + +$ virtualenv --system-site-packages . +$ . bin/activate +$ pip install -r requirements.txt +$ mysql -u root +mysql> create database ifa; +mysql> quit; +$ python manage.py syncdb + +Import data: + +$ python manage.py shell +>>> from ifa.films import imports +>>> imports.do(path="/path/to/FILMS.txt") + +Run dev server: + +$ python manage.py runserver diff --git a/ifa/films/imports.py b/ifa/films/imports.py index c2e50a9..c8acad4 100644 --- a/ifa/films/imports.py +++ b/ifa/films/imports.py @@ -1,7 +1,7 @@ path = "/home/sanj/c/ifa/tmp/FILMS.txt" from models import * -def do(): +def do(path=path): errors = open("errors.txt", "w") for line in open(path): txt = line.strip()