Tuesday, November 1, 2011

Re: Django app, part 1, error with the database

Hi,
Thanks for your messages. The problem was indeed some missing commas
after 'ENGINE': ' ' and 'NAME': ' '
Best
-Nicolas-

On Nov 1, 6:32 pm, Sandro Dutra <hexo...@gmail.com> wrote:
>  'NAME': 'C:/Users/songbird/Desktop/bdd/' # Or path to database file
> if using sqlite3.
>
> You're using a SQLite database, so you've to provide the full path to
> SQLite database file, for example:  'NAME':
> 'C:/Users/songbird/Desktop/bdd/mydb.db3' instead only the path to
> directory.
>
> 2011/11/1 Nikolas Stevenson-Molnar <nik.mol...@consbio.org>:
>
>
>
>
>
>
>
> > Hi Nicolas,
>
> > It looks like you have a syntax error in your settings file. It's
> > possible you left of a comma after one of your dictionary values, or
> > didn't close a brace. I can't tell for sure without more context: could
> > you please provide the complete "DATABASES" section of your settings file?
>
> > On 11/1/2011 9:46 AM, Nicolas wrote:
> >> Dear all,
> >> I'm completly new to the world of django and python.
> >> I'm trying to go through the tuto "Writing your first Django app, part
> >> 1" and of course I have an error.
> >> This error happens in the step "database setup". I edited the settings
> >> file, wrote 'django.db.backends.sqlite3' for engine and a path to a db
> >> file (as it's said in the tuto that "If the file doesn't exist, it
> >> will automatically be created when you synchronize the database for
> >> the first time" I just set a path to an empty folder).
> >> And then, I run manage.py syncdb and I get this :
>
> >> C:\Python27\Lib\site-packages\django\bin\mysite>manage.py syncdb
> >> Traceback (most recent call last):
> >>   File "C:\Python27\Lib\site-packages\django\bin\mysite\manage.py",
> >> line 9, in <
> >> module>
> >>     execute_from_command_line(sys.argv)
> >>   File "C:\Python27\lib\site-packages\django\core\management
> >> \__init__.py", line
> >> 422, in execute_from_command_line
> >>     utility.execute()
> >>   File "C:\Python27\lib\site-packages\django\core\management
> >> \__init__.py", line
> >> 361, in execute
> >>     self.fetch_command(subcommand).run_from_argv(self.argv)
> >>   File "C:\Python27\lib\site-packages\django\core\management
> >> \__init__.py", line
> >> 234, in fetch_command
> >>     app_name = get_commands()[subcommand]
> >>   File "C:\Python27\lib\site-packages\django\core\management
> >> \__init__.py", line
> >> 102, in get_commands
> >>     apps = settings.INSTALLED_APPS
> >>   File "C:\Python27\lib\site-packages\django\utils\functional.py",
> >> line 185, in
> >> inner
> >>     self._setup()
> >>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line
> >> 42, in _set
> >> up
> >>     self._wrapped = Settings(settings_module)
> >>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line
> >> 90, in __in
> >> it__
> >>     mod = importlib.import_module(self.SETTINGS_MODULE)
> >>   File "C:\Python27\lib\site-packages\django\utils\importlib.py", line
> >> 35, in im
> >> port_module
> >>     __import__(name)
> >>   File "C:\Python27\Lib\site-packages\django\bin\mysite\mysite
> >> \settings.py", lin
> >> e 15
> >>     'NAME': 'C:/Users/songbird/Desktop/bdd/' # Or path to database
> >> file if using sqlite3.
> >>           ^
> >> SyntaxError: invalid syntax
>
> >> I'm on windows 7.
> >> So, my question is simple: what am I doing wrong?
> >> Thanks a lot in advance.
> >> Best
> >> -Nicolas-
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

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

No comments:

Post a Comment