My django project can't runserver on my own pc -


hi , taking time see question.

i newbie on python.

i'm want start site on pc. when use "django-admin.py" make project,all things good. when use "python manage.py runserver",it notices me that:

importerror: not import settings 'test.settings' (is on sys.path?): no module named settings 

i check code, things right. manage.py writes:

#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("django_settings_module", "mysite.settings") django.core.management import execute_from_command_line execute_from_command_line(sys.argv) 

my folder this:

hua@sun-rev-1-0:~/hua/mydjango/mysite$ ls manage.py  mysite 

and project right;

hua@sun-rev-1-0:~/hua/mydjango/mysite$ tree mysite/ mysite/ ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py 

now use python see os.path:

hua@sun-rev-1-0:~/hua/mydjango/mysite$ python python 2.7.3 (default, sep 26 2012, 21:53:58)  [gcc 4.7.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import sys >>> print sys.path ['', '/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg', '/usr/local/lib/python2.7/dist-packages', '/usr/bin/python2.7', '/home/hua/hua/mydjango/mysite/~share', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg-info', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/pil', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] 

i can't find wrong.

there's /home/hua/hua/mydjango/mysite/~share in sys.path - you're still missing /home/hua/hua/mydjango/

add , should work.

you move project /usr/local/lib/python2.7/dist-packages , run there.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -