Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to use manage.py syncdb outside of Django project, such as in Tornado?
    text
    copied!<p>I was looking through <a href="http://lincolnloop.com/blog/2009/sep/15/using-django-inside-tornado-web-server/" rel="nofollow">http://lincolnloop.com/blog/2009/sep/15/using-django-inside-tornado-web-server/</a> and I thought it was interesting and useful to use parts of Django if we need it in Tornado.</p> <p>Based on the setup in <a href="http://lincolnloop.com/blog/2009/sep/15/using-django-inside-tornado-web-server/" rel="nofollow">http://lincolnloop.com/blog/2009/sep/15/using-django-inside-tornado-web-server/</a> how can we use <code>manage.py syncdb</code> ?</p> <p>Here's what i have tried so far: I've tried shifting manage.py to the same folder as the tornado project, and ran <code>manage.py syncdb</code> but it returns saying that settings.py is not found.</p> <p>than i tried to move setting.py to the same folder and ran manage.py again. It tells me that no fixtures found. This time round, I have no idea how to configure settings.py since this is not a Django project.</p> <p>Any advice or thoughts?</p> <p>=================updates======================</p> <p>Hi all, continuing from the above an using advice provided by Agos, i've tried running python manage.py syncdb --settings=dj_tornado and it returns </p> <pre><code>`"Error: Can't find the file 'settings.py'` in the directory containing 'manage.py'`. It appears you've customized things. You'll have to run django-admin.py, passing it your settings module. (If the file settings.py does indeed exist, it's causing an ImportError somehow.)" </code></pre> <p>So what i did is to run <code>django-admin.py syncdb --settings=dj_tornado</code> and it returns <code>"django.core.exceptions.ImproperlyConfigured: You haven't set the database ENGINE setting yet."</code> </p> <p>But the weird thing is that the database engine has been set. How would I go about fixing this? i'm using django 1.2.3 and Tornado 0.2 by the way.</p> <p>=================updates again======================</p> <p>Hi all, i've applied the advice provided by Agos, with a settings.py file in teh same folder as manage.py, and ran the command <code>django-admin.py syncdb --settings=dj_tornado</code>. I still received the error: </p> <pre><code>django.core.exceptions.ImproperlyConfigured: You haven't set the database ENGINE setting yet. </code></pre> <p>But i have already configured the database based engine as follows: in dj_tornado.py:</p> <pre><code>from django.conf import settings settings.configure( DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'dev.db', } } ) </code></pre> <p>I'm kind of at my wits end. How do i use syncdb outside of Django project?</p> <p>Best.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload