M
M
mr_drinkens892015-04-15 15:02:58
Django
mr_drinkens89, 2015-04-15 15:02:58

How do you organize SEO in django?

Hello.
Interested in such a question, who organizes SEO in projects?
I used to use the django-seo battery before, but lately I don't quite like it anymore.
Are there any ideas?
Or is it just to set 3 fields in each model?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2015-04-15
@sim3x

Make your own base mixin model and inherit from it
Optimization depends more on the layout of the template than on three fields, given that no one is looking at them anymore

Y
yanusrnd, 2015-05-12
@yanusrnd

A seo-scientist is taken, he writes a technical task for finalizing the site. It is very different in different situations.
Without a specific site, this is a "spherical horse..." question.

Z
zelsky, 2015-05-13
@zelsky

Here is a SEO optimized model for a photo gallery.

from django.db import models
from django_attach.models import Attachment
from django.contrib.contenttypes.generic import GenericRelation
from django import forms
from django.core.urlresolvers import reverse
# Create your models here.
 
class Categories(models.Model):
    id_cat = models.AutoField(primary_key=True)
    Name_cat = models.CharField(max_length=20)
    Text_f_cat = models.CharField(max_length=160,default='Description')
    key_words = models.CharField(max_length=160,default='Key words')
     
    def __unicode__(self):
        return self.Name_cat
 
 
class Album(models.Model):
    cat = models.ForeignKey(Categories)
    id_alb = models.AutoField(primary_key=True)
 
    full_album = models.CharField(max_length=1500,default='Full text 500-1000 smv')
    Text_f_album = models.CharField(max_length=300,default='For the preview')
    Title_page = models.CharField(max_length=70)
    Title_photo = models.CharField(max_length=60)
    Alt_photo = models.CharField(max_length=80)
    id_photo_for_thumb = models.IntegerField(default=1)
    key_words = models.CharField(max_length=160,default='Key words')
    desctiption = models.CharField(max_length=160)
 
    def get_random_photo(self):
        try:    
            return self.photo_set.order_by('?')[0]
        except IndexError:
            return None
    def __unicode__(self):
        return '%s %s' % (self.Title_page, self.cat)
 
class Photo(models.Model):
    alb = models.ForeignKey(Album)
    Title_f_photo = models.CharField(max_length=80)
    Alt_f_photo = models.CharField(max_length=80)
    image = models.ImageField(upload_to='media',default='_5q16cjpxm.jpg')
    def __unicode__(self):
        return self.Title_f_photo

R
rmfalx, 2017-07-13
@rmfalx

Tell me how you set up django-seo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question