|
From: Gregory H. <g.j...@ho...> - 2013-03-18 13:10:55
|
Windows 7Jython 2.5.4rc1Django 1.4Django_Jython 1.3.0jyjdbc 0.0.3 Hello, I am trying to follow the tutorial as available at 'https://docs.djangoproject.com/en/1.4/intro/tutorial01/'. I can succesfully create a project and start up the development server without a database specified. However, I cannot get sqlite3 accepted as the database engine. When I edit the settings.py file to indicate sqlite3 and then run the command: 'jython manage.py syncdb' I always get a long error message that terminates with: 'Error loading SQLite3 JDBC driver: No module named sqlite' I have read that Jython is incompatible with sqlite3. I have also read that zxJDBC and jyjdbc can be installed and configured to get things working, but I have no idea how. Simply installing the Django_Jython and jyjdbc packages under jython\lib\site-packages hasn't got me any further. What database should I use for this tutorial and how should I set it up? I am a total Newbie so I would really welcome any and all advice. Many thanks in advance |
|
From: Josh J. <jun...@gm...> - 2013-03-18 17:46:33
|
Hi Gregory,
Thanks for working with Django-Jython. Sorry that you are having issues
getting started with sqlite. While sqlite is not fully supported using
Django-Jython (the backend has not been maintained), you can still try to
use it, although some features may not work as expected. I think that you
need to modify the settings.py file for your example project to make use of
the Django-Jython sqlite backend. Please ensure that you are using
something similar to the following for your database configuration within
settings.py:
DATABASES = {
'default': {
'ENGINE': 'doj.backends.zxjdbc.sqlite3', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'dbname', # Or path to database
file if using sqlite3.
'USER': 'dbuser', # Not used with sqlite3.
'PASSWORD': 'dbpassword', # Not used with
sqlite3.
'HOST': 'dbhost', # Set to empty string
for localhost. Not used with sqlite3.
'PORT': 'dbport', # Set to empty string
for default. Not used with sqlite3.
}
If sqlite does not work, then I would recommend trying one of the other
databases that is supported (postgresql, oracle, sqlserver).
Thanks
Josh Juneau
jun...@gm...
http://jj-blogger.blogspot.com
https://www.apress.com/index.php/author/author/view/id/1866
On Mon, Mar 18, 2013 at 7:58 AM, Gregory Hickling <
g.j...@ho...> wrote:
> Windows 7
> Jython 2.5.4rc1
> Django 1.4
> Django_Jython 1.3.0
> jyjdbc 0.0.3
>
> Hello,
>
> I am trying to follow the tutorial as available at '
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/'.
>
> I can succesfully create a project and start up the development server
> without a database specified. However, I cannot get sqlite3 accepted as the
> database engine. When I edit the settings.py file to indicate sqlite3 and
> then run the command:
>
> 'jython manage.py syncdb'
>
> I always get a long error message that terminates with:
>
> 'Error loading SQLite3 JDBC driver: No module named sqlite'
>
> I have read that Jython is incompatible with sqlite3. I have also read
> that zxJDBC and jyjdbc can be installed and configured to get things
> working, but I have no idea how. Simply installing the Django_Jython and
> jyjdbc packages under jython\lib\site-packages hasn't got me any further.
>
> What database should I use for this tutorial and how should I set it up?
>
> I am a total Newbie so I would really welcome any and all advice.
>
> Many thanks in advance
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Jython-users mailing list
> Jyt...@li...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
|
|
From: Chris C. <Chr...@ac...> - 2013-03-18 18:40:18
|
Hi Gregory, Apologies for the potentially dumb question, but I don't want to skip over the obvious. Which sqlite JDBC driver are you using? CPython includes sqlite3 with the distribution, Jython does not. To use sqlite3 you have to provide the driver yourself. As you probably saw on http://code.google.com/p/jyjdbc/ sqlite can be used (and there is a commented out connection string for it in the example) but you need to have sqlite in the classpath. Check out the comments in my unittest for sqlite and jyjdbc http://code.google.com/p/jyjdbc/source/browse/test_jyjdbcsqlite_dbapi20.py I would recommend the Xerial one. Chris Chris On Mon, 18 Mar 2013 12:46:26 -0500, Josh Juneau <jun...@gm...> wrote: > Hi Gregory, > > Thanks for working with Django-Jython. Sorry that you are having > issues getting started with sqlite. While sqlite is not fully > supported using Django-Jython (the backend has not been maintained), > you can still try to use it, although some features may not work as > expected. I think that you need to modify the settings.py file for > your example project to make use of the Django-Jython sqlite backend. > Please ensure that you are using something similar to the following > for your database configuration within settings.py: > > DATABASES = { > 'default': { > 'ENGINE': 'doj.backends.zxjdbc.sqlite3', # Add > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. > 'NAME': 'dbname', # Or path to > database file if using sqlite3. > 'USER': 'dbuser', # Not used with > sqlite3. > 'PASSWORD': 'dbpassword', # Not used with > sqlite3. > 'HOST': 'dbhost', # Set to empty > string for localhost. Not used with sqlite3. > 'PORT': 'dbport', # Set to empty > string for default. Not used with sqlite3. > } > > If sqlite does not work, then I would recommend trying one of the > other databases that is supported (postgresql, oracle, sqlserver). > > Thanks > > > Josh Juneau > jun...@gm... <mailto:jun...@gm...> > http://jj-blogger.blogspot.com > https://www.apress.com/index.php/author/author/view/id/1866 > > > > On Mon, Mar 18, 2013 at 7:58 AM, Gregory Hickling > <g.j...@ho... <mailto:g.j...@ho...>> wrote: > > Windows 7 > Jython 2.5.4rc1 > Django 1.4 > Django_Jython 1.3.0 > jyjdbc 0.0.3 > > Hello, > > I am trying to follow the tutorial as available at > 'https://docs.djangoproject.com/en/1.4/intro/tutorial01/'. > > I can succesfully create a project and start up the development > server without a database specified. However, I cannot get sqlite3 > accepted as the database engine. When I edit the settings.py file > to indicate sqlite3 and then run the command: > > 'jython manage.py syncdb' > > I always get a long error message that terminates with: > > 'Error loading SQLite3 JDBC driver: No module named sqlite' > > I have read that Jython is incompatible with sqlite3. I have also > read that zxJDBC and jyjdbc can be installed and configured to get > things working, but I have no idea how. Simply installing the > Django_Jython and jyjdbc packages under jython\lib\site-packages > hasn't got me any further. > > What database should I use for this tutorial and how should I set > it up? > > I am a total Newbie so I would really welcome any and all advice. > > Many thanks in advance > |