Ask Your Question
1

Installing; "python manage.py syncdb" fails with "unable to open database file"

asked 2017-06-23 15:50:54 -0500

Brian Kendig gravatar image

I'm trying to install Askbot for the first time on a macOS Sierra system. I have Python 2.7.13 installed.

I followed the instructions at http://askbot.org "/doc/initial-configuration.html#compile-time-configuration". Now I'm trying to follow "/doc/initialize-database-tables.html". (Delinkified because my karma is too low to post links.) I run "python manage.py syncdb", and I get a lot of errors. How do I fix this and get Askbot installed?

mydjangosite $ python manage.py syncdb
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

System check identified some issues:

WARNINGS:
django_authopenid.UserPasswordQueue.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
    HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
group_messaging.SenderList.recipient: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
    HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 25, in handle
    call_command("migrate", **options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
    self.build_graph()
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
    self.ensure_schema()
  File "/usr/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
  File "/usr/local/lib/python2.7/site-packages/django/db/backends/base ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-06-23 16:22:01 -0500

Brian Kendig gravatar image

I was able to figure it out. Even though there was no database created yet, I had to come up with the name of a database file (which didn't exist yet). I decided on this, which I put into settings.py:

'NAME': '/Users/celeb_mobile_devbox/mydjangosite/askbot/db.sqlite3',
edit flag offensive delete link more

Comments

I have encountered this problem, how is the solution?

hincent gravatar imagehincent ( 2017-07-09 20:52:41 -0500 )edit

@Brian Kendig -- please click the "accept" (tick) button to mark answer as accepted and question as solved.

slelievre gravatar imageslelievre ( 2018-04-06 14:11:44 -0500 )edit
0

answered 2017-07-11 04:59:32 -0500

It seems that you won't install or create the database for AskBot and add those info in settings.py file after that run the python manage.py syncdb

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-06-23 15:50:54 -0500

Seen: 235 times

Last updated: Jul 11 '17