import uuid
from django.db import models
from django.db.models import Sum
from django.conf import settings
from django_countries.fields import CountryField
from product.models import Product, ProductImage
from profiles.models import UserProfile
class Order(models.Model):
""" create order model"""
order_number = models.CharField(max_length=32,
null=False, editable=False)
user_profile = models.ForeignKey(UserProfile, on_delete=models.SET_NULL,
null=True, blank=True,
related_name="orders")
product_images = models.ManyToManyField(ProductImage,`your text` through='OrderLineItem')
full_name = models.CharField(max_length=40, null=False, blank=False)
email = models.EmailField(max_length=50, null=False, blank=False)
contact_number = models.CharField(max_length=11, null=False, blank=False)
street_address = models.CharField(max_length=60, null=False, blank=False)
postal_code = models.CharField(max_length`your text`=10, null=True, blank=False)
country = models.CountryField(blank_label='Country *', null=False, blank=False)
I have installed django countries, freeze requirements.txt and getting import error as below:
ModuleNotFoundError: No module named 'django_countries '
tried installing all packages and folow django documentation
it's very simple just install it using below command
that's it