August 20, 2008

  • Ok setting it up on vista was impossible… ubuntu went very smoothly except the django.conf part

    here’s me conf (anything with double square brackets has been edited… highlighted orange)

    The alias’ were the solution for the 404′s on Django’s admin css and javascript. It just couldn’t figure out the symlinks or something… not sure.

    ServerName computron

    MaxRequestsPerChild 1
    <location “/”>
            SetHandler python-program
            PythonHandler django.core.handlers.modpython
            SetEnv DJANGO_SETTINGS_MODULE [[application_name]].settings
            PythonPath “['/home/[[username]]/django/www/django_projects’] + sys.path”
            PythonDebug On
    </location>

    Alias /media “/var/www/media”
    <location “/media”>
            SetHandler None
    </location>

    Alias /admin_media “/var/www/admin_media”
    <location “/admin_media”>
            SetHandler None
    </location>

    <locationmatch “.(jpg|gif|png)$”>
            SetHandler None
    </locationmatch>

August 7, 2008

  • Getting Django set up to test on a Windows Vista pc.

    Problem
    When running the setup script, you get the error:

    error: package directory 'django' does not exist

    Solution:


    windows install must change setyp.py line 24

    package = dirpath[len_root_dir:].lstrip(‘/’).replace(‘/’, ‘.’)

    to
    package = dirpath[len_root_dir:].lstrip(‘\’).replace(‘\’, ‘.’)
    http://code.djangoproject.com/ticket/3245

    Problem:
    TemplateDoesNotExist at /admin/

    Solution

    <Django sources from subversion or tar
    archive>djangocontribadminmedia to
    C:Python25Libsite-packagesdjangocontribadminmedia
    and
    <Django sources from subversion or tar
    archive>djangocontribadmintemplates to
    C:Python25Libsite-packagesdjangocontribadmintemplates

    Stop and restart your django server:

    Source: http://forums.devshed.com/python-programming-11/django-templatedoesnotexist-at-admin-457043.html

    Problem
    Can’t run python from the cmd window:
    ‘python’ is not recognized as an internal or external command…

    Solution:
    Python was not added to the path.
    Control Panel -> Search for “path” -> Click “Edit the system environment variables” -> Environment Variables button -> Edit the System Variable path -> Add “C:Python25″ to the end (separated by semicolons)

    Problem:
    When following the tutorial you don’t see the Calendar chooser for the datetime column. Investigating with Firebug revealed this error:

    gettext is not defined
    calendar.js()()calendar.js (line 26)
    monthsOfYear: gettext(‘January Febru… October November December’).split(‘ ‘),

    Solution:

    Replace all instances of “gettext” with “” in:
    C:Python25Libsite-packagesdjangocontribadminmediajscalendar.js
    C:Python25Libsite-packagesdjangocontribadminmediajsadminDateTimeShortcuts.js
    Source: http://groups.google.com/group/django-users/browse_thread/thread/f0abe54d2d1e0313

Recent Posts

Recent Comments

Categories