Skip to content

Category: Github

Git pull request Account donaldtest fork the repos from spawnmarvel: git clone cd foldergit checkout -b new_branch git remote add upstream Now you can…

pywinservice, running a simple Python script as a windows service

pywinservice, running a simple Python script as a windows service
Make a virtualenv, store your code there.
Make a file, in that file you can start / call a database, a webcrawler, http, mail or whatever code you want to execute.
When you are done with coding your scripts, test this:
Make a bat file, that will be started when the service starts (i.e 3 party libraries will start)
  • Activate the env: ~\pywinservice\Scripts\activate.bat


  • Call the Python script file, ie python app\ runserver

Make some log statments also, always good.

If the test is success:

Download NSSM – the Non-Sucking Service Manager.

  • nssm install, navigate to your bat file, give the service a name

Start the service with the name you made

Django database API foreign key 102


Our models have now changed and a new model has been added to e-lo.

In RawText, we store the input, in BlobText we store the functions from TextBlob lib. If we remove the instance from the first table, we also need to remove it from the second. Ref on_delete = models.CASCADE

Lets add two instances and view them, then delete them.


Django database API migrations and models 101

Django API

Once you’ve created your data models, Django automatically gives you a database-abstraction API that lets you create, retrieve, update and delete objects. This document explains how to use this API. Refer to the data model reference for full details of all the various model lookup options.

So our testmodel is a simple Note where we store text from the user. This is our base for e-lo on web.

We feed e-lo some text and select a of several NLP functions that will be implemented later (Some of them are implemented, but must interfaced with Django, now they are interfaced with class cmd.Cmd([completekey[, stdin[, stdout]]]).