Questions tagged [django-database]

django-database refers to database backends that Django supports out of the box

refers to database backends that Django supports out of the box.

This tutorial help you to make application using mongodb database. enter link description here

664 questions
0
votes
0 answers

Django Transaction Management with DEBUG = True

Transactions are working correctly in production environment (django 1.9 + Ubuntu + PosgreSQL) but they have no effect in development environment with DEBUG = True. E.g. with transaction.atomic() do_stuff() raise Exception() Changes made to…
user1387219
  • 465
  • 4
  • 18
0
votes
0 answers

How to use celery with multiple databases?

I am moving my django project from single database to using 2 different mysql databases(master-slave configuration), where all my reads go to the slave, and writes go to the master. I have following configurations in my settings.py DATABASES =…
Tushar
  • 1,117
  • 1
  • 10
  • 25
0
votes
1 answer

Create models from json feed in Django

I am making a django app to browse available products at different markets. I am getting data for my models from a JSON url feed, I am not sure on the best approach to turn this data into models as the feed for a single market can contain upwards of…
ms18
  • 335
  • 1
  • 3
  • 11
0
votes
1 answer

How can I upload files into django database

I want to upload files to the database that Django use, I know that I can do it through forms, but I want to read the files in my files system get the path of the docx or pdf and uploaded it into the database, how can I do that Here is the code…
AshMGM
  • 53
  • 8
0
votes
0 answers

Django admin queryset limited to 100 items

Here's the situation: I have a model called Profile. There are currently more than 200 Profile items in my DB. I have another model called Item. These two models have a one-to-one relationship. In the Profile list page I can see all Profile items I…
0
votes
1 answer

Filtered annotations without removing results

Consider a model and a query using annotations, for example the following example from the Django…
nip3o
  • 3,346
  • 4
  • 24
  • 29
0
votes
2 answers

django redirect after delete

After deleting an object from my DB I want to redirect to a certain view. here is my view where the deletion happens: def client_delete(request): if request.method == 'GET': return _not_exist_page(request) else: client =…
dor272
  • 550
  • 1
  • 6
  • 26
0
votes
1 answer

Import / migrate old (Django 0.97) model data into Django 1.8 or higher

What would be the best approach to migrating or importing data from a very old Django app (0.97) to a relatively "modern" Django release (1.8)? The application (if you can call it that) is little more than a series of models and some simple views.…
DrFyzziks
  • 61
  • 3
0
votes
1 answer

django pick from multiple databases for testing

I have multiple databases defined. This is for test profile, and I want to be able to specify which database to be picked for testing. eg: "python manage.py test -db=mysql" DATABASES = { 'default': { 'ENGINE':…
user3661888
  • 860
  • 1
  • 7
  • 9
0
votes
0 answers

Casting result from Database Function not working

I'm using the following to get the ISO Week Date: class DateWeek(Func): """ Return the ISO8601 Week Number """ def as_mysql(self, compiler, connection): self.function = 'WEEK' self.output_field = IntegerField() self.template =…
user31415629
  • 925
  • 6
  • 25
0
votes
1 answer

Django Integrity Error Not null

i am learning django and trying to practice by making my own website that will quiz me with questions that i submit in to it. I get this error and i dont know why. IntegrityError at /questions/new/ NOT NULL constraint failed:…
Cflux
  • 1,423
  • 3
  • 19
  • 39
0
votes
1 answer

Error on inspectdb model creation django

I am using django with mssql. I already have a existing database and want to create django model for the tables in that database. I followed this django book instruction for inspectdb. http://django-book.readthedocs.io/en/latest/chapter18.html When…
user5586747
0
votes
1 answer

Django South - db.alter function removing null=true blank=true fails with mysql

Having trouble with the db.alter command when changing a date field from null=True and blank=True to required by removing these two values. When the below line is commented out, the migration runs without a problem. …
Michael Merchant
  • 1,509
  • 2
  • 17
  • 28
0
votes
0 answers

How to perform float to datetime conversion in the Django queryset

I have been searching a lot, and it's strange to me that nobody here had a similar problem. Well, in general, I need to query "available" tests which could be submitted. Let me explain this in details: I have my model (and not a permission to change…
adkl
  • 634
  • 7
  • 17
0
votes
1 answer

Deployment of Django in local network while continuing development

The question is in the title. I need to deploy a Django application in a local network (i still don't know how to do but i suppose it's quite easy) but i still need to develop it. My question is how to do to allow users to use the application while…