Categorized: Django

Installing Django Basic Blog

Somewhere inside a folder that’s on your PYTHONPATH:

svn checkout http://django-basic-apps.googlecode.com/svn/trunk/ basic

Under INSTALLED_APPS in settings.py.:

'tagging',
'basic.blog',
'basic.inlines',
'django.contrib.comments',
'django.contrib.markup',

Be sure you have django-tagging installed.

In your main urls.py:

(r'^blog/', include('basic.blog.urls')),
(r'^comments/', include('django.contrib.comments.urls')), 

Now if you want, you can override the app’s own templates by copying them into your own templates/blog folder.

Comments

jason → January 9th, 2009 at 4:00 am

Works great! thanks..

Evgeniy → October 22nd, 2009 at 12:05 am

You re forgot to mension that project moved to github Although, found the idea of relationships app very useful for me.

Laszlo → January 13th, 2010 at 7:08 am

Hi,

I did the following:

  • “django-admin.py startproject blog”

  • Then did exactly step by step what you told (also installed django-tagging).

  • After this I wanted to do a syncdb, I got this error, could you help me out?

Regards, Laszlo

Traceback (most recent call last): File “manage.py”, line 11, in execute_manager(settings) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\__init__.py”, line 362, in execute_manager utility.execute() File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\__init__.py”, line 303, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\base.py”, line 195, in run_from_argv self.execute(args, *options.__dict__) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\base.py”, line 221, in execute self.validate() File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\base.py”, line 249, in validate num_errors = get_validation_errors(s, app) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\c ore\management\validation.py”, line 28, in get_validation_errors for (app_name, error) in get_app_errors().items(): File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\d b\models\loading.py”, line 131, in get_app_errors self._populate() File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\d b\models\loading.py”, line 58, in populate self.load_app(app_name, True) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\d b\models\loading.py”, line 74, in load_app models = import_module(‘.models’, app_name) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\u tils\importlib.py”, line 35, in import_module __import__(name) File “E:\django\repo\blog\basic\blog\models.py”, line 11, in class Category(models.Model): File “E:\django\repo\blog\basic\blog\models.py”, line 14, in Category slug = models.SlugField(_(‘slug’), prepopulate_from=(‘title’,), uniqu e=True) File “E:\Kft\django\Python26\Lib\site-packages\django-1.1.1-py2.6.egg\django\d b\models\fields\__init__.py”, line 795, in __init_ super(SlugField, self).__init__(args, *kwargs) TypeError: __init__() got an unexpected keyword argument ‘prepopulate_from’

Trey → January 13th, 2010 at 8:50 am

@Laszlo What version of Django are you using?

Laszlo → January 13th, 2010 at 5:09 pm

Python26, is it possible that something is missing from my installation?

Trey → January 13th, 2010 at 5:16 pm

That’s Python, what version of Django?

juanefren → March 27th, 2010 at 2:24 pm

I’m having the same error, I am using django 1.2 alpha, are these apps only for < 1.0 ? I am just looking for sample apps.

mauro de giorgi → April 30th, 2010 at 5:37 am

I got this error when I tried to install the blog application:

TemplateSyntaxError at /admin/blog/post/add/ ‘inlines’ is not a valid tag library: Could not load template library from django.templatetags.inlines, No module named inlines.parser

both basic.blog and basic.inlines are in INSTALLED_APPS and basic is in the pythonpath.

Any ideas?

Rul → May 19th, 2010 at 11:59 am

Hi. I’m also a django newbie, but here is how I solved this problem in the models.py file: Change lines

class Category(models.Model):
    ...
    slug        = models.SlugField(_('slug'), prepopulate_from=('title',), unique=True)
    ...
    class Admin:
        pass

for

class Category(models.Model):
    ...
    slug        = models.SlugField(_('slug'), unique=True)
    ...
    class Admin:
        prepopulate_from = {'slug': ('title')}

This one

class Post(models.Model):
    ...
    slug            = models.SlugField(_('slug'), prepopulate_from=('title',))
    ...
    status          = models.IntegerField(_('status'), choices=STATUS_CHOICES, radio_admin=True, default=2)
    ...
    class Admin:
        ...

for this one

class Post(models.Model):
        ...
        slug            = models.SlugField(_('slug'))
        ...
        status          = models.IntegerField(_('status'), choices=STATUS_CHOICES, radio_admin=True, default=2)
        ...
        class Admin:
            ...
            prepopulate_from = {'slug': ('title')}

Follow this link for more information.

What do you think about that?

Elsewhere in the empire: Home, Blog, APOD