python - Try to install mongodb with dijango? -
i trying configure mongodb database django. tried lot of tutorials still, not able configure.
i followed following tutorials commands.
http://2buntu.com/articles/1451/installing-django-and-mongodb-in-your-virtualenv/
http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html
http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
i added following code setting.py
class.
databases = { 'default': { 'engine' : 'django_mongodb_engine', 'name' : 'product' }
i tried different version too, still not run command.
python manage.py runserver
i got following error.
$ python manage.py runserver traceback (most recent call last): file "manage.py", line 8, in <module> django.core.management import execute_from_command_line importerror: no module named django.core.management
this current installed project packages.
$ pip list django-mongodb-engine (0.6.0) djangotoolbox (1.8.0) pip (7.1.2) pymongo (3.0.3) setuptools (18.2) wheel (0.24.0)
expecting expert this. did not find latest article this.
i want project using dijango-1.8
, python 3.x
, using mongodb
. code on linux-ubuntu(14.04)
machine, system has both python 2x,3x version.
=========================after install dijango 1.8===================
$ python manage.py runserver /home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/djangotoolbox/db/utils.py:1: removedindjango19warning: django.db.backends.util module has been renamed. use django.db.backends.utils instead. django.db.backends.util import format_number /home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/djangotoolbox/db/utils.py:1: removedindjango19warning: django.db.backends.util module has been renamed. use django.db.backends.utils instead. django.db.backends.util import format_number performing system checks... system check identified no issues (0 silenced). unhandled exception in thread started <function wrapper @ 0x7fcf8b16ce60> traceback (most recent call last): file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 223, in wrapper fn(*args, **kwargs) file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run self.check_migrations() file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 164, in check_migrations executor = migrationexecutor(connections[default_db_alias]) file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__ self.loader = migrationloader(self.connection) file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__ self.build_graph() file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 180, in build_graph self.applied_migrations = recorder.applied_migrations() file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations self.ensure_schema() file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema self.connection.schema_editor() editor: file "/home/umayanga/desktop/mongoproject/myproject/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 502, in schema_editor 'the schemaeditorclass attribute of database wrapper still none') notimplementederror: schemaeditorclass attribute of database wrapper still none
now pip list.
django (1.8) django-mongodb-engine (0.6.0) djangotoolbox (1.8.0) pip (7.1.2) pymongo (3.0.3) setuptools (18.2) wheel (0.24.0)
after , big effort,i can configure dijago.when install warning aper. think ,sometime installing order may incorrect. post , because may others , if wrong ,i want expert advice.
installing packages.
(myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/test2$ pip list django (1.6.11) django-dbindexer (1.6.1) django-mongodb-engine (0.6.0) djangotoolbox (1.8.0) pip (7.1.2) pymongo (3.0.3) setuptools (18.2) wheel (0.24.0)
ubuntu terminal code
umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ ls -l total 0 umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install virtualenv requirement satisfied (use --upgrade upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages cleaning up... umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ virtualenv myprojec new python executable in myprojec/bin/python installing setuptools, pip, wheel...done. umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ source myprojec/bin/activate (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install https://github.com/django-nonrel/django/tarball/nonrel-1.6 collecting https://github.com/django-nonrel/django/tarball/nonrel-1.6 /home/umayanga/desktop/mongoproject/myprojec/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning /home/umayanga/desktop/mongoproject/myprojec/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning downloading https://github.com/django-nonrel/django/tarball/nonrel-1.6 | 6.7mb 1.9mb/s building wheels collected packages: django running setup.py bdist_wheel django stored in directory: /home/umayanga/.cache/pip/wheels/89/cd/89/64475e53eef52b22b711705322a36352f2f979fdcef0e39e8a built django installing collected packages: django installed django-1.6.11 (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ ls -l total 4 drwxrwxr-x 6 umayanga umayanga 4096 oct 10 15:26 myprojec (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ cd myprojec/ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ ls -l total 20 drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:26 bin drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:25 include drwxrwxr-x 3 umayanga umayanga 4096 oct 10 15:25 lib drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:25 local -rw-rw-r-- 1 umayanga umayanga 60 oct 10 15:26 pip-selfcheck.json (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ cd .. (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install pymongo collecting pymongo /home/umayanga/desktop/mongoproject/myprojec/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning installing collected packages: pymongo installed pymongo-3.0.3 (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ sudo pip install git+https://github.com/django-nonrel/djangotoolbox downloading/unpacking git+https://github.com/django-nonrel/djangotoolbox cloning https://github.com/django-nonrel/djangotoolbox /tmp/pip-lloitv-build running setup.py (path:/tmp/pip-lloitv-build/setup.py) egg_info package git+https://github.com/django-nonrel/djangotoolbox requirement satisfied (use --upgrade upgrade): djangotoolbox==1.8.0 git+https://github.com/django-nonrel/djangotoolbox in /usr/local/lib/python2.7/dist-packages cleaning up... (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install django-dbindexer collecting django-dbindexer /home/umayanga/desktop/mongoproject/myprojec/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. insecureplatformwarning downloading django-dbindexer-1.6.1.tar.gz building wheels collected packages: django-dbindexer running setup.py bdist_wheel django-dbindexer stored in directory: /home/umayanga/.cache/pip/wheels/09/2f/ea/01d26e4ffc98cd2ed54b92f31a82aecccb8e7b5c9e3b28a8ca built django-dbindexer installing collected packages: django-dbindexer installed django-dbindexer-1.6.1 (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install git+https://github.com/django-nonrel/djangotoolbox collecting git+https://github.com/django-nonrel/djangotoolbox cloning https://github.com/django-nonrel/djangotoolbox /tmp/pip-2auztq-build installing collected packages: djangotoolbox running setup.py install djangotoolbox installed djangotoolbox-1.8.0 (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ pip install git+https://github.com/django-nonrel/mongodb-engine collecting git+https://github.com/django-nonrel/mongodb-engine cloning https://github.com/django-nonrel/mongodb-engine /tmp/pip-63fwrm-build requirement satisfied (use --upgrade upgrade): pymongo>=2.8 in ./myprojec/lib/python2.7/site-packages (from django-mongodb-engine==0.6.0) requirement satisfied (use --upgrade upgrade): djangotoolbox>=1.6.0 in ./myprojec/lib/python2.7/site-packages (from django-mongodb-engine==0.6.0) installing collected packages: django-mongodb-engine running setup.py install django-mongodb-engine installed django-mongodb-engine-0.6.0 (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject$ cd myprojec (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ django-admin.py startproject myproject (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ ls -l total 24 drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:26 bin drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:25 include drwxrwxr-x 3 umayanga umayanga 4096 oct 10 15:25 lib drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:25 local drwxrwxr-x 3 umayanga umayanga 4096 oct 10 15:36 myproject -rw-rw-r-- 1 umayanga umayanga 60 oct 10 15:26 pip-selfcheck.json (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec$ cd myproject/ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec/myproject$ (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec/myproject$ ls -l total 8 -rwxrwxr-x 1 umayanga umayanga 252 oct 10 15:36 manage.py drwxrwxr-x 2 umayanga umayanga 4096 oct 10 15:36 myproject (myprojec)umayanga@umayanga-hp-630-notebook-pc:~/desktop/mongoproject/myprojec/myproject$ python manage.py runserver validating models... 0 errors found october 10, 2015 - 10:06:57 django version 1.6.11, using settings 'myproject.settings' starting development server @ http://127.0.0.1:8000/ quit server control-c. [10/oct/2015 10:07:03] "get / http/1.1" 200 1757 [10/oct/2015 10:08:42] "get / http/1.1" 200 1757 [10/oct/2015 10:08:48] "get /admin http/1.1" 301 0 [10/oct/2015 10:08:48] "get /admin/ http/1.1" 200 1865
Comments
Post a Comment