import random

from django.core.management.base import BaseCommand, CommandError
from django.contrib.gis.geos import Point
from django.conf import settings

from world.models import Item


class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        default_lat = settings.DEFAULT_LOCATION['lat']
        default_lng = settings.DEFAULT_LOCATION['lng']

        for item_name in ('Bakery', 'Butcher\'s', 'Chemist\'s'):
            difference = random.choice((0.02, 0.05, 0.008, 0.006, 0.1, 0.06))

            item_lat = default_lat - difference
            item_lng = default_lng + difference
            point = Point(item_lat, item_lng)

            Item.objects.create(name=item_name, location=point)
        self.stdout.write(self.style.SUCCESS('Successefuly created 3 items'))

5c6caea6df77d36ea0890b1480f9f2566bf4f0af
<mask token>

<mask token>


class Command(BaseCommand):
    <mask token>

<mask token>


class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        default_lat = settings.DEFAULT_LOCATION['lat']
        default_lng = settings.DEFAULT_LOCATION['lng']
        for item_name in ('Bakery', "Butcher's", "Chemist's"):
            difference = random.choice((0.02, 0.05, 0.008, 0.006, 0.1, 0.06))
            item_lat = default_lat - difference
            item_lng = default_lng + difference
            point = Point(item_lat, item_lng)
            Item.objects.create(name=item_name, location=point)
        self.stdout.write(self.style.SUCCESS('Successefuly created 3 items'))

import random
from django.core.management.base import BaseCommand, CommandError
from django.contrib.gis.geos import Point
from django.conf import settings
from world.models import Item


class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        default_lat = settings.DEFAULT_LOCATION['lat']
        default_lng = settings.DEFAULT_LOCATION['lng']
        for item_name in ('Bakery', "Butcher's", "Chemist's"):
            difference = random.choice((0.02, 0.05, 0.008, 0.006, 0.1, 0.06))
            item_lat = default_lat - difference
            item_lng = default_lng + difference
            point = Point(item_lat, item_lng)
            Item.objects.create(name=item_name, location=point)
        self.stdout.write(self.style.SUCCESS('Successefuly created 3 items'))

import random

from django.core.management.base import BaseCommand, CommandError
from django.contrib.gis.geos import Point
from django.conf import settings

from world.models import Item


class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        default_lat = settings.DEFAULT_LOCATION['lat']
        default_lng = settings.DEFAULT_LOCATION['lng']

        for item_name in ('Bakery', 'Butcher\'s', 'Chemist\'s'):
            difference = random.choice((0.02, 0.05, 0.008, 0.006, 0.1, 0.06))

            item_lat = default_lat - difference
            item_lng = default_lng + difference
            point = Point(item_lat, item_lng)

            Item.objects.create(name=item_name, location=point)
        self.stdout.write(self.style.SUCCESS('Successefuly created 3 items'))
