python - Django ImportError no module named -
I have been googling this whole day and have not come across a solution, hope you can help: / p>
Using Django 1.6, I have created an app called "Builds" as part of a project called "Computer Builder".
The site works fine when testing, though I created a file with some items in the database, and when I got the this file my file fillDB.py: This is my models.py file "created" app that I created: My directory looks like this: Because I'm not using an external file which is part of Django, I think that's the reason to recognize it because if it helps, then the postgres Also use You must add init to py in the Dev folder because it is a Python package Is considered as the form. After this, you have to add your own demo project path to fillDB.py like this, Follow the above folder structure, and you must set the Django environment variable in this file. fillDB.py Hope this Your help python fillDB.py :
< Returns the error in running code> traceback (the most recent call final): file "fillDB.py", line 1,
django db import model # make your model here. Category builds (models.Model): id = models.AutoField (primary_key = true) moboListing = Model .CharField (max_length = 200) price = models.IntegerField ()
one ???? ???? ???? ???? ???? ???? ???? ???? ???? ?????? Admin.py a single ???? a ???? __init__.py a ??? ?? ???? ???? ???? ???? a ???? models.py a single ???? ???? ???? ?????.py.txt.py a single ???? Views.py.py a Line Line Computer manufacturer a ???? One ???? One ???? God au ???? One ???? One ???? One ???? Db.txt one ???? a???? One ???? One ???? One ???? FillDB.py one a ???? One ???? One ???? __init__.py one ???? One ???? One ???? One ???? Settings.py one single One ???? One ???? Urls.py one ???? One ???? One ???? One ???? Views.py a single ???? One ???? One ???? Wsgi.py one ???? Line Manage.py ?????? Line Necessities.txt
root "one" ??? Line Line Line ??a???? Produces ??? One ???? One ???? One ???? Admin.py a single ???? One ???? One ???? __init__.py one ???? One ???? One ???? One ???? Models.py one single ???? One ???? One ???? Test.py one a ???? One ???? One ???? Views.py one ???? Line Line Computer manufacturer a ???? One ???? One ???? God god One ???? One ???? One ???? Db.txt A A One ???? One ???? One ???? FillDB.py one a ???? One ???? One ???? __init__.py one ???? One ???? One ???? One ???? Settings.py one single One ???? One ???? Urls.py one ???? One ???? One ???? One ???? Views.py one a ???? One ???? One ???? Wsgi.py one ???? One ???? Manage.py ?????? Line Requirements.txt
Import import system os if __name__ == "__main__": sys.path.append ('/ path / Root ') os.environ.setdefault ("DJANGO_SETTINGS_MODULE", "computerbuilder.settings") BuildsTable mobo = BuildsTable.objects.all () from Builds.models print mobo
Comments
Post a Comment