About 6,370,000 results
Open links in new tab
  1. Django Migration is not applying the migration changes

    Django has a setting DATABASE_ROUTERS which will be used to determine which database to use when performing a database query. From the docs: if you want to implement more …

  2. Creating a JSON response using Django and Python

    592 I'm trying to convert a server side Ajax response script into a Django HttpResponse, but apparently it's not working. This is the server-side script:

  3. Django: OperationalError No Such Table - Stack Overflow

    I'm building a fairly simple application, research, in my Django project that uses Django-CMS. (It's my first ground-up attempt at a project/application.) Its main purpose is to store various

  4. Django - Static file not found - Stack Overflow

    Django will use the first static file it finds whose name matches, and if you had a static file with the same name in a different application, Django would be unable to distinguish between them. …

  5. How to change the Django default runserver port? - Stack Overflow

    70 As of Django 1.9, the simplest solution I have found (based on Quentin Stafford-Fraser's solution) is to add a few lines to manage.py which dynamically modify the default port number …

  6. How to properly use the "choices" field option in Django

    You should seriously consider namespacing variables you use for choices in Django model fields; it should be apparent that the variable is related to a specific field in order to avoid confusing …

  7. python - ImproperlyConfigured: You must either define the …

    Django looks for an environment variable called DJANGO_SETTINGS_MODULE, which should be set to the import path of your settings.py. For example, DJANGO_SETTINGS_MODULE …

  8. How can I correctly set DJANGO_SETTINGS_MODULE for my …

    51 I am having some trouble setting the DJANGO_SETTINGS_MODULE for my Django project. I have a directory at ~/dev/django-project. In this directory I have a virtual environment which I …

  9. How to 'bulk update' with Django? - Stack Overflow

    0 In Django 4.1 QuerySet.bulk_create () to update fields can be used. The update is executed when a row insertion fails uniqueness constraints. QuerySet.bulk_create () now supports …

  10. python - What is related_name used for? - Stack Overflow

    What is the related_name argument useful for on ManyToManyField and ForeignKey fields? For example, given the following code, what is the effect of related_name='maps'? class …