We worked on django v1.4 support in a new branch: https://github.com/jedie/PyLucid/tree/django1.4 But it's not ready, yet. PyLucid run's well, but we would like to test it more...
Note: This here is a public working draft.
The main goals of this release:
- run with new django v1.4 release
- use django.contrib.staticfiles (see below at 'media -> static files')
- add django-reversion-compare
Compare master...django1.4 diff.
↑ how to test #
Create a test virtual environment with the django1.4 branch, just use the bootstrap file from the branch:
1 2 3 4 5 | # get PyLucid boot script: /home/FooBar$ wget https://raw.github.com/jedie/PyLucid/django1.4/bootstrap/pylucid-boot.py # Create the PyLucid virtual environment: /home/FooBar$ python pylucid-boot.py PyLucid_env |
See also: http://www.pylucid.org/permalink/333/1a1-create-a-pylucid-environment-with-pylucid-boot
Django git repro: The new repro contains v1.5.x and the "1.4.X" branch does only exist in the old repro, see: https://code.djangoproject.com/ticket/18268
To switch to the old repro, do this:
1 2 3 | /home/FooBar/PyLucid_env$ source bin/activate (PyLucid_env)/home/FooBar/PyLucid_env$ pip uninstall django (PyLucid_env)/home/FooBar/PyLucid_env$ pip install -e git+git://github.com/django/django-old.git@1.4.X#egg=django |
install new dependencies:
1 2 | /home/FooBar/PyLucid_env$ source bin/activate (PyLucid_env)/home/FooBar/PyLucid_env$ pip install django_compressor==dev |
These changes are made / steps for update:
Run these south migrations:
1 2 3 4 5 | # schena migrations for django-reversion /var/www/YourSite$ ./manage.py migrate reversion # migrate new STATIC url prefixes in dbtemplates /var/www/YourSite$ ./manage.py migrate pylucid |
see also: https://github.com/etianen/django-reversion/wiki/Schema-migrations
↑ media -> static files #
Now we used the django.contrib.staticfiles.
collect all static files:
1 2 3 4 5 | # delete or rename the old files: /var/www/YourSite$ rn media media_old # To link files add --link to this: /var/www/YourSite$ ./manage.py collectstatic # --link |
Changes related to this:
1 2 3 4 5 | - {{ Django_media_prefix }} + {{ STATIC_URL }}admin/ - {{ PyLucid_media_url }} + {{ STATIC_URL }}PyLucid/ |
Needed changes in your local_settings.py:
1 2 3 4 5 6 7 | - MEDIA_ROOT = "/var/www/YourSite/media/" + STATIC_ROOT = "/var/www/YourSite/static/" - MEDIA_URL = "/media/" + STATIC_URL = "/static/" - ADMIN_MEDIA_PREFIX = "/media/django/" |
↑ use django-compressor #
Add this to your local_settings.py:
1 2 | # Use compress js/css data with django-compressor: COMPRESS_ENABLED = True |
Edit your page templates like this, e.g.:
{% sourcecode ext=".diff" %}
+ {% compress js %}
+ {% endcompress %}
+ {% compress css %}
+ {% endcompress %}
{% endsourcecode %}
Es existiert kein Kommentar für 'blog'
laden...
Kommentar hinterlassen