These are chat archives for django/django

Jul 2015
Jul 23 2015 08:52
Does someone know how to connect Google Map API v3 to Django database !?
Mir Nazim
Jul 23 2015 09:08
@iMilad provide some details please?
Jul 23 2015 09:14
@mnazim in Html file I created a map with drawing tools to make it possible users draw polygone and now I want to save ite into the Django database, I use backend.postgis (postgres db)
Mir Nazim
Jul 23 2015 09:15
POSTing polygon data with ajax should work fine.
Jul 23 2015 09:18
could you show me some hint ?
Mir Nazim
Jul 23 2015 09:27
  1. collect polygon data with JS.
  2. use jQuery to post this data to a django view
  3. write a django view that will save this data to db.
    (I don’t know a lot about google maps api itself.)
Jul 23 2015 09:32
@mnazim thank you for your help
Alexey Kalinin
Jul 23 2015 11:11

Hello. I have a problem with test running. I'm trying to go from django 1.5 to django 1.8. After some dancing with migrations I got the runserver command working. But when I try to run tests it throws the exception

(nov_15)alkalit@alkalit-dev:~/.virtualenvs/nov_15/$ ./ test novostroek_app
Creating test database for alias 'default'...
Got an error creating the test database: database "test_novostroygid" already exists

Type 'yes' if you would like to try deleting the test database 'test_novostroygid', or 'no' to cancel: yes
Destroying old test database 'default'...
Traceback (most recent call last):
  File "./", line 10, in <module>
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 338, in execute_from_command_line
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 330, in execute
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/commands/", line 30, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/commands/", line 74, in execute
    super(Command, self).execute(*args, **options)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 444, in execute
    output = self.handle(*args, **options)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/commands/", line 90, in handle
    failures = test_runner.run_tests(test_labels)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/test/", line 210, in run_tests
    old_config = self.setup_databases()
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/test/", line 166, in setup_databases
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/test/", line 370, in setup_databases
    serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/db/backends/base/", line 368, in create_test_db
    test_flush=not keepdb,
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/", line 444, in execute
    output = self.handle(*args, **options)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/commands/", line 179, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/core/management/commands/", line 317, in sync_apps
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/db/backends/", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/db/", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/alkalit/.virtualenvs/nov_15/local/lib/python2.7/site-packages/django/db/backends/", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "django_content_type" does not exist

I suspect that this is due to the order of application migrations, as with the same error I've encountered when applied migrations to the main database. Then I decided to order the application migrations. Any ideas?

Oleg Serbokryl
Jul 23 2015 11:38
@Alkalit Fantomas42/django-blog-zinnia#408
Portia Burton
Jul 23 2015 15:24
Hello, I'm iterating over images and urls which can be found in my model. What would be the best way for me to put a tag <span>Read Me</span> below each image. Should I include the span tag in the iteration over images and urls, or should the span tag have its own 'for loop'?
Jul 23 2015 15:43
it's own for loop?
Portia Burton
Jul 23 2015 15:47