On Sun, May 15, 2011 at 6:07 PM, David Biglin <[email protected]> wrote:

> Hi,
> I have been playing with Python for the past year now and enjoying it.
> I am trying Django to make a web site for a friend. I am Following the
> Django Tutorial on there web site to get the basic concepts here;
> http://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> During the set up i am using SQLite3 which comes with python, how ever
> when i try and create the DB tables i get the following errors
>
> Command to create DBTables :
>
>    python manage.py syncdb
>
>
>
> The Traceback :
>
>    Traceback (most recent call last):
>      File "manage.py", line 11, in <module>
>        execute_manager(settings)
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> __init__.py", line 438, in execute_manager
>        utility.execute()
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> __init__.py", line 379, in execute
>        self.fetch_command(subcommand).run_from_argv(self.argv)
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 191, in run_from_argv
>        self.execute(*args, **options.__dict__)
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 220, in execute
>        output = self.handle(*args, **options)
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 351, in handle
>        return self.handle_noargs(**options)
>      File "/usr/lib/pymodules/python2.7/django/core/management/
> commands/syncdb.py", line 56, in handle_noargs
>        cursor = connection.cursor()
>      File "/usr/lib/pymodules/python2.7/django/db/backends/
> __init__.py", line 75, in cursor
>        cursor = self._cursor()
>      File "/usr/lib/pymodules/python2.7/django/db/backends/sqlite3/
> base.py", line 174, in _cursor
>        self.connection = Database.connect(**kwargs)
>    sqlite3.OperationalError: unable to open database file
>
>
>
>
> Any help would be amazing also any other tutorials anyone could
> recommend for starting python web development would be much
> appreciated!
> Thanks again
>
>
Someone already mentioned that your problem might be related to
file/directory permissions. I spent a lot of time to figure that out in my
case.

Depending on your deployment method you might need to adjust your user/group
settings.
If you're using mod_wsgi with Apache http server set user and/or group
parameter in WSGIDaemonProcess directive in your apache config file to the
same user and group as your Djnago project files. In practice I create
separate system user accounts for my django projects, than create apache
virtual hosts and I also use python virtual environment. I can than easily
and quickly deploy everything and file permissions are fine.

Of course you can always play with chmod/chown to allow web server to access
your SQLite database.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to