Questions tagged [django]

Django is an open-source server-side web application framework written in Python. It is designed to reduce the effort required to create complex data-driven websites and web applications, with a special focus on less code, no-redundancy and being more explicit than implicit.

Filter by
Sorted by
Tagged with
1199votes
29answers
202kviews

Does Django scale? [closed]

I'm building a web application with Django. The reasons I chose Django were: I wanted to work with free/open-source tools. I like Python and feel it's a long-term language, whereas regarding Ruby I ...
user avatar
  • 32.3k
1184votes
24answers
388kviews

What is the difference between null=True and blank=True in Django?

When we add a database field in django we generally write: models.CharField(max_length=100, null=True, blank=True) The same is done with ForeignKey, DecimalField etc. What is the basic difference in ...
user avatar
  • 16.7k
884votes
10answers
530kviews

Is there a list of Pytz Timezones?

I would like to know what are all the possible values for the timezone argument in the Python library pytz. How to do it?
user avatar
  • 13.7k
843votes
17answers
536kviews

How do I do a not equal in Django queryset filtering?

In Django model QuerySets, I see that there is a __gt and __lt for comparative values, but is there a __ne or != (not equals)? I want to filter out using a not equals. For example, for Model: bool ...
user avatar
  • 42.1k
765votes
14answers
375kviews

How can I combine two or more querysets in a Django view?

I am trying to build the search for a Django site I am building, and in that search, I am searching in three different models. And to get pagination on the search result list, I would like to use a ...
user avatar
  • 10.8k
750votes
10answers
756kviews

How can I temporarily disable a foreign key constraint in MySQL?

Is it possible to temporarily disable constraints in MySQL? I have two Django models, each with a foreign key to the other one. Deleting instances of a model returns an error because of the foreign ...
user avatar
  • 34.8k
728votes
10answers
389kviews

How to upload a file in Django? [closed]

As a newbie to Django, I am having difficulty making an upload app in Django 1.3. I could not find any up-to-date example/snippets. May someone post a minimal but complete (Model, View, Template) ...
user avatar
  • 11.3k
712votes
13answers
227kviews

What is a "slug" in Django?

When I read Django code I often see in models what is called a "slug". I am not quite sure what this is, but I do know it has something to do with URLs. How and when is this slug-thing supposed to be ...
user avatar
  • 18.7k
660votes
31answers
756kviews

How to check Django version

I have to use Python and Django for our application. So I have two versions of Python, 2.6 and 2.7. Now I have installed Django. I could run the sample application for testing Django succesfuly. But ...
user avatar
637votes
13answers
329kviews

How to revert the last migration?

I've made a migration that added a new table and want to revert it and delete the migration, without creating a new migration. How do I do it? Is there a command to revert last migration and then I ...
user avatar
  • 8,671
625votes
27answers
282kviews

How to debug in Django, the good way? [closed]

So, I started learning to code in Python and later Django. The first times it was hard looking at tracebacks and actually figure out what I did wrong and where the syntax error was. Some time has ...
user avatar
  • 32.7k
611votes
11answers
372kviews

What does on_delete do on Django models?

I'm quite familiar with Django, but I recently noticed there exists an on_delete=models.CASCADE option with the models. I have searched for the documentation for the same, but I couldn't find anything ...
user avatar
577votes
10answers
134kviews

Separation of business logic and data access in django

I am writing a project in Django and I see that 80% of the code is in the file models.py. This code is confusing and, after a certain time, I cease to understand what is really happening. Here is what ...
user avatar
  • 25.4k
572votes
10answers
970kviews

How can I upgrade specific packages using pip and a requirements file?

I'm using pip with a requirements file, in a virtualenv, for my Django projects. I'm trying to upgrade some packages, notably Django itself, and I'm getting an error about source code conflicts: ...
user avatar
  • 5,777
568votes
24answers
426kviews

How to reset Django admin password?

I am using Django (version 1.3) and have forgotten both admin username and password. How to reset both? And is it possible to make a normal user into admin, and then remove admin status?
user avatar
  • 5,952

15 30 50 per page
1
2 3 4 5
19153