$>python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
Traceback (most recent call last):
Ā File "manage.py", line 22, in <module>
Ā Ā execute_from_command_line(sys.argv)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
Ā Ā utility.execute()
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute
Ā Ā self.fetch_command(subcommand).run_from_argv(self.argv)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/base.py", line 328, in run_from_argv
Ā Ā self.execute(*args, **cmd_options)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 60, in execute
Ā Ā super().execute(*args, **options)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/base.py", line 369, in execute
Ā Ā output = self.handle(*args, **options)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 95, in handle
Ā Ā self.run(**options)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 102, in run
Ā Ā autoreload.run_with_reloader(self.inner_run, **options)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 599, in run_with_reloader
Ā Ā start_django(reloader, main_func, *args, **kwargs)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 584, in start_django
Ā Ā reloader.run(django_main_thread)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 299, in run
Ā Ā self.run_loop()
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 305, in run_loop
Ā Ā next(ticker)
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 345, in tick
Ā Ā for filepath, mtime in self.snapshot_files():
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 361, in snapshot_files
Ā Ā for file in self.watched_files():
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 260, in watched_files
Ā Ā yield from iter_all_python_module_files()
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 105, in iter_all_python_module_files
Ā Ā return iter_modules_and_files(modules, frozenset(_error_files))
Ā File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py", line 141, in iter_modules_and_files
Ā Ā resolved_path = path.resolve(strict=True).absolute()
TypeError: resolve() got an unexpected keyword argument 'strict'
udaysingh@udays-MacBook-Pro:~/Django/dreamProj>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAANDXNtvg9sP5OqLktcECco1MhpV0%3DcMgYCKvAF0TLXAH9bpog%40mail.gmail.com.
--
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG0UDYY2Gdg_bDwsED5iK9cmrtw8%2Bpi%2BDa3h_O2DwOm9%3DfEj5A%40mail.gmail.com.
140 Ā Ā Ā Ā try:
141 Ā Ā Ā Ā Ā Ā #resolved_path = path.resolve(strict=True).absolute()
142 Ā Ā Ā Ā Ā Ā resolved_path = path.resolve().absolute()
143 Ā Ā Ā Ā except FileNotFoundError:
144 Ā Ā Ā Ā Ā Ā # The module could have been removed, don't fail loudly if this
145 Ā Ā Ā Ā Ā Ā # is the case.
146 Ā Ā Ā Ā Ā Ā continue
147 Ā Ā Ā Ā except ValueError as e:
148 Ā Ā Ā Ā Ā Ā # Network filesystems may return null bytes in file paths.
149 Ā Ā Ā Ā Ā Ā logger.debug('"%s" raised when resolving path: "%s"' % (str(e), path))
150 Ā Ā Ā Ā Ā Ā continue
151 Ā Ā Ā Ā results.add(resolved_path)
152 Ā Ā return frozenset(results)
153Ā
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/utils/autoreload.py" line 142 of 605 --23%-- col 13
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1904970444.6768150.1596106045425%40mail.yahoo.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO9_9ZYc52ZYZQfQn_dg%3DtmHKra%3D16KcdGXrLTM3%3DX5Bg9N%2BrQ%40mail.gmail.com.
from django.db import models
from django.contrib.auth.models import User
class Customer(models.Model):
user=models.OneToOneField(User,null=True,on_delete= models.CASCADE)
name=models.CharField(max_length=200,null=True)
phone=models.CharField(max_length=200,null=True)
email=models.CharField(max_length=200,null=True)
profile_pic = models.ImageField(default="radha3.png", null=True, blank=True)
date_created=models.DateTimeField(auto_now_add=True,null=True)
def __str__(self):
return self.name
class Tag(models.Model):
name=models.CharField(max_length=200,null=True)
def __str__(self):
return self.name
class Product(models.Model):
CATEGORY=(
('In door','In door'),
('Out door','Out door'),
)
name=models.CharField(max_length=100,null=True)
price=models.FloatField(null=True)
category = models.CharField(max_length=200, null=True,choices=CATEGORY)
description = models.CharField(max_length=200,null=True,blank=True)
date_created = models.DateTimeField(auto_now_add=True, null=True)
tags=models.ManyToManyField(Tag)
def __str__(self):
return self.name
class Order(models.Model):
STATUS = (
('Pending', 'Pending'),
('Out for delivery', 'Out for delivery'),
('Delivered', 'Delivered'),
)
customer = models.ForeignKey(Customer, null=True, on_delete=models.SET_NULL)
product = models.ForeignKey(Product, null=True, on_delete=models.SET_NULL)
date_created = models.DateTimeField(auto_now_add=True, null=True)
status = models.CharField(max_length=200, null=True, choices=STATUS)
note = models.CharField(max_length=1000, null=True)
def __str__(self):
return self.product.name
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m314E5Z99zx5wZkNKcKnZrvqSQk9tMLmk7TwxrU89-bnwaw%40mail.gmail.com.
from django.db import models
from django.contrib.auth.models import User
class Customer(models.Model):
user=models.OneToOneField(User,null=True,on_delete= models.CASCADE)
name=models.CharField(max_length=200,null=True)
phone=models.CharField(max_length=200,null=True)
email=models.CharField(max_length=200,null=True)
profile_pic = models.ImageField(default="radha3.png", null=True, blank=True)
date_created=models.DateTimeField(auto_now_add=True,null=True)
def __str__(self):
return str(self.name)
class Tag(models.Model):
name=models.CharField(max_length=200,null=True)
def __str__(self):
return str(self.name)
class Product(models.Model):
CATEGORY=(
('In door','In door'),
('Out door','Out door'),
)
name=models.CharField(max_length=100,null=True)
price=models.FloatField(null=True)
category = models.CharField(max_length=200, null=True,choices=CATEGORY)
description = models.CharField(max_length=200,null=True,blank=True)
date_created = models.DateTimeField(auto_now_add=True, null=True)
tags=models.ManyToManyField(Tag)
def __str__(self):
return str(self.name)
class Order(models.Model):
STATUS = (
('Pending', 'Pending'),
('Out for delivery', 'Out for delivery'),
('Delivered', 'Delivered'),
)
customer = models.ForeignKey(Customer, null=True, on_delete=models.SET_NULL)
product = models.ForeignKey(Product, null=True, on_delete=models.SET_NULL)
date_created = models.DateTimeField(auto_now_add=True, null=True)
status = models.CharField(max_length=200, null=True, choices=STATUS)
note = models.CharField(max_length=1000, null=True)
def __str__(self):
return str(self.product.name)
Try this and let me know whether it is working or not. I added str() to the __str__. All the best
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO9_9ZYTQLQTnJrXPxvcELyzTkeTnucNp1PMSszTvb81%3DMCFjw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAANDXNtvg9sP5OqLktcECco1MhpV0%3DcMgYCKvAF0TLXAH9bpog%40mail.gmail.com.