If you will only test PyLucid 0.9 on your local machine, you should follow this instructions:

clone source and create virtual environment

To clone all related projects, use the PyLucid virtual environment boot script:

1
2
~$ wget https://raw.github.com/jedie/PyLucid/master/bootstrap/pylucid-boot.py
~$ python pylucid-boot.py PyLucid_env

Important: You can't move a created virtual environment into a other directory, after creating them! This is a limitation of virtualenv, see also: http://pypi.python.org/pypi/virtualenv#making-environments-relocatable

Eclipse / Aptana Studio

First add the python interpreter from virtual environment here:

  1. Window / Preferences / PyDev / Interpreter - Python / New... / Browse...
  2. Select PyLucid_env/bin/python

Then import all projects under /PyLucid_env/src/:

  1. File / Import... / Other / Existing Folder As New Project
  2. Select folder in PyLucid_env/src

Share all Projects respectively connect them with git:

  1. right click in Pydev Package Explorer on the project root entry
  2. Team / Share Project...
  3. select git
  4. select repository location and click on Finish

Use python interpreter from virtual environment in all projects:

  1. Project / Properties / PyDev - Interpreter/Grammar
  2. select the Interpreter from virtual environment (configurated above)

create local settings

You should not edit the default settings.py.
Create a local_settings.py here:

  • PyLucid_env/src/pylucid/pylucid_project/local_settings.py

In this file you can change every default settings.

At least you must insert this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
DEBUG = True
SQL_DEBUG = False
TEMPLATE_DEBUG = False

from pylucid_project.apps.pylucid import app_settings as PYLUCID
PYLUCID.I18N_DEBUG = False

# Serve static files for the development server?
# Using this method is inefficient and insecure.
# Do not use this in a production setting. Use this only for development.
SERVE_STATIC_FILES = True

# Database connection info.
# see: http://docs.djangoproject.com/en/dev/ref/settings/#setting-DATABASES
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test.db3'
    }
}

Info: To display the changed settings, use:

1
~/PyLucid_env$ ./manage.sh diffsettings

create manage.sh

For easy call django management commands do this:

1
2
3
~$ cd PyLucid_env
~/PyLucid_env$ ln src/pylucid/scripts/manage.sh .
~/PyLucid_env$ chmod +x manage.sh

You can check if management works with:

1
~/PyLucid_env$ ./manage.sh --version

(You should get the django version number at the output end)

prepage database

Note: you must create a new database by your self. Django can only create tables.

go into the test environment:

1
~$ cd PyLucid_env/

create new tables:

1
~/PyLucid_env$ ./manage.sh syncdb

Django ask you to create a first superuser. You should do this. Otherwise "loaddata" would be failed.
You can create a superuser manually with: ./manage.sh createsuperuser

insert the initial data:

1
~/PyLucid_env$ ./manage.sh loaddata pylucid.json

start test server

Django has a own http server. This is usefull for developers. But it sould not be used for productive environments!

run test server:

1
~/PyLucid_env$ ./manage.sh runserver

Now you should be able to request the initial page with: http://127.0.0.1:8000/

finishing

  • request: http://127.0.0.1:8000/admin/ and login into the "Django admin site"
  • adjust the site data:
    • edit the model sites
    • change the domain name
  • finishing the installation:
    • From the menu click on: "PyLucid admin menu" / "PyLucid" / "install PyLucid"
    • setup the plugins with: "PyLucid admin menu" / "PyLucid" / "install Plugins"
  • Basic system setup check:
    • run from the menu: "PyLucid admin menu" / "system" / "base check"
    • Check the outout and correct the errors.

run all unittests

You can easy run all unittest with:

1
~/PyLucid_env$ ./manage.sh test

Tests are not up to date. So, many tests failed.