I delete the models.py file since I am splitting all the models into
separated files based on their name and import them in the __init__.py as
the 2nd image i post before..
Should I keep the models.py file ? If yes, where should I keep them ? And
what the content it should be ?
Below I attach one of the model that I made
from django.db import models
from rest_framework import serializers
from Retailapp.models.MasterManagement.MasterItem_models import MasterItem
from Retailapp.models.MasterManagement.MasterUOM_models import MasterUOM
class ItemUnitConvercy(models.Model):
unit_convercy_id = models.BigAutoField(primary_key=True)
qty_convercy = models.CharField(max_length=50, blank=True)
master_item_id = models.ForeignKey(MasterItem, on_delete=models.CASCADE)
uom_id = models.OneToOneField(MasterUOM, on_delete=models.CASCADE)
class Meta:
db_table = 'ItemUnitConvercy'
app_label = 'Retailapp'
class ItemUnitConvercySerializer(serializers.ModelSerializer):
class Meta:
model = ItemUnitConvercy
fields = '__all__'
On Monday, November 12, 2018 at 10:28:17 PM UTC+7, amit pant wrote:
>
> check your models, might be there is some spelling error.
> if you share your models.py file then we could do more help.
>
> On Mon, Nov 12, 2018 at 8:28 PM Yohandy Chiaawanda <[email protected]
> <javascript:>> wrote:
>
>> Hello
>>
>> I am currently following this guide
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>>
>> to set up django into digitalocean, and I kinda stuck at one point when I
>> want to use gunicorn
>> Whenever i type 'gunicorn --bind 0.0.0.0:8003 myproject.wsgi' ,there's
>> always an ImportError showing up
>> Here's the screenshot showing the error
>> [image: error01.PNG]
>> And here's the file __init__.py looks like
>> [image: error02.PNG]
>>
>> Any suggestion and help is really appreciated
>>
>>
>>
>> --
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a8e3098f-465e-4986-aca3-f4f196645423%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/django-users/a8e3098f-465e-4986-aca3-f4f196645423%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/c374b800-2f70-4618-9909-9ed1052ee604%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.