Answer the question
In order to leave comments, you need to log in
How to adapt a Django application to Django 1.6?
The question is, I started to study python + django 1.6
. I study using the example of creating a personal portfolio blog.
The question arose about the portfolio component itself, I found it on the net and forked this application to my github _ https://github.com/powellc/django-portfolio
But it was written a very long time ago and of course it throws errors.
I'll start in order, at first I swore at this:
from django.views.generic import date_based, list_detail
from django.views.generic.list import ListView
from tagging.fields import TagField и на import tagging
__init__() takes exactly 1 argument (5 given) вот тут views.py in project_list, line 13
**kwargs
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import Http404
from django.views.generic import date_based, list_detail
from portfolio.models import Project, Medium
def project_list(request, page=0, **kwargs):
return list_detail.object_list(
request,
queryset=Project.objects.public(),
paginate_by=5,
page=page,
**kwargs
)
project_list.__doc__ = list_detail.object_list.__doc__
def medium_list(request, **kwargs):
return list_detail.object_list(
request,
queryset = Medium.objects.all(),
**kwargs
)
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.db.models import permalink
from tagging.fields import TagField
from portfolio.managers import PublicManager
import tagging
class Client(models.Model):
name = models.CharField(max_length=250)
url = models.URLField(blank=True)
class Meta:
db_table = "clients"
ordering = ['name']
def __unicode__(self):
return self.name
class Medium(models.Model):
name = models.CharField(max_length=250)
slug = models.SlugField()
class Meta:
db_table = "media"
verbose_name_plural = "media"
ordering = ['name']
def __unicode__(self):
return self.name
@permalink
def get_absolute_url(self):
return self.slug
class Project(models.Model):
name = models.CharField(max_length=250)
slug = models.SlugField()
project_url = models.URLField('Project URL')
description = models.TextField(blank=True)
client = models.ForeignKey(Client)
media = models.ManyToManyField(Medium)
disciplines = TagField()
completion_date = models.DateField()
in_development = models.BooleanField()
is_public = models.BooleanField(default=True)
overview_image = models.ImageField(upload_to="projects/overview/")
detail_image = models.ImageField(upload_to="projects/detail/")
objects = PublicManager()
class Meta:
db_table = "projects"
ordering = ['-completion_date']
def __unicode__(self):
return self.name
@permalink
def get_absolute_url(self):
return self.slug
Answer the question
In order to leave comments, you need to log in
Hmm, no traceback provided, but maybe you just forgot to install django-tagging which django-portfolio depends on.
In general, why don't you just look in the direction of fresher django batteries?
Here is a seemingly simple thing: https://github.com/dokterbob/django-portfolio
And this one is heavier: https://github.com/stefanfoulis/django-filer
But both seem to be maintained by the authors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question