Source

django-minicms /

Filename Size Date modified Message
articles
comments
minicms
rubriques
static
48 B
3.5 KB
250 B
553 B

MiniCMS de test

Just minimal CMS with SQLite

Installation:

Get source
    $ hg clone https://bitbucket.org/magik_cypress/django-minicms
Install requirement
    $ pip install -r requirement.txt --upgrade
Add absolute path for STATICFILES_DIRS on settings.py

Development:

$ virtualenv minicms
$ cd minicms/
$ . bin/activate
$ ./bin/django-admin.py startproject minicms
$ cd minicms
$ python manage.py startapp rubriques
$ python manage.py startapp articles
$ python manage.py startapp comments
$ python manage.py syncdb
$ python manage.py runserver

UnitTest

# dump data
$ python manage.py dumpdata --natural > fixtures/initial_data.json
# load fixtures
$ python manage.py loaddata fixtures/initial_data.json
# Test with coverage
$ coverage report -m
$ coverage html -d coverage_html
# https://github.com/jbalogh/django-nose/issues/2
$ python manage.py test --with-coverage --cover-package=rubriques.models --verbosity 2

Production: (pythonanywhere.com)

$ export WORKON_HOME=~/minicms
$ mkdir -p $WORKON_HOME
$ source virtualenvwrapper.sh
$ mkvirtualenv django
$ hg clone https://bitbucket.org/magik_cypress/django-minicms
$ pip install -r django-minicms/requirement.txt --upgrade

$ wsgi.py (edit on pythonanywhere dashboard > web)
import os
import sys

# This activates the virtualenv for this script
activate_this = '/home/cyp/minicms/django/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

import os
import sys

if '/home/cyp/minicmss' not in sys.path:
    sys.path.insert(0, '/home/cyp/minicmss')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Requirements:

pep8
    https://github.com/jcrocholl/pep8/
coverage
    http://pypi.python.org/pypi/coverage/3.5.2
django-nose
    https://github.com/jbalogh/django-nose

ChangeLog:

  • fix article and comment after expire
  • add basic test

--

  • fix display or not rubrique on public page
  • fix display or not article on public page
  • fix author_ip for visitor (gethostname and gethostbyname bug for Django 1.3)
  • fix comment error display
  • add comment markdown rendered
  • add queryset_iterator ex: http://djangosnippets.org/snippets/1949/ (see yield and gc)
  • fix path on settings.py
  • add admin wysiwyg
  • fix django.conf.urls.defaults all urls.py

--

  • delete a fuc!!!! genericView
  • adjust template display
  • fix pep8
  • fix UTF-8
  • add css
  • add comment

--

Bug:

Bug add comment into admin, author_ip is incorrect Not possible to manager required field into admin

Todo:

function _lookup_template can be optimized no ? WTF TZ and the naïve date

What different ? get_list_or_404 or get_objects_or_404 https://docs.djangoproject.com/en/1.4/topics/http/shortcuts/

Documentation:

Penser a l'utilisation de gros volume

Very Large Result Sets in Django using PostgreSQL http://thebuild.com/blog/2010/12/13/very-large-result-sets-in-django-using-postgresql/

Django query set iterator – for really large, querysets http://www.mellowmorning.com/2010/03/03/django-query-set-iterator-for-really-large-querysets/

Code queryset_iterator #USE or NOT USE ??? http://djangosnippets.org/snippets/1949/

yield http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained gc http://www.digi.com/wiki/developer/index.php/Python_Garbage_Collection