Discussion:
Deploy django project using gunicorn
Yohandy Chiaawanda
2018-11-12 14:19:34 UTC
Permalink
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 django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
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.
For more options, visit https://groups.google.com/d/optout.
amit pant
2018-11-12 15:27:32 UTC
Permalink
check your models, might be there is some spelling error.
if you share your models.py file then we could do more help.
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
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 django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
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/CAF2Ah_F%2BGR9F7WQVKtvEV7-R_v49HwAVOaeAkRggDjn-buRjzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Yohandy Chiaawanda
2018-11-12 18:51:33 UTC
Permalink
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__'
Post by amit pant
check your models, might be there is some spelling error.
if you share your models.py file then we could do more help.
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
<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 django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
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.
Loading...