Questions tagged [django-mysql]

92 questions
0
votes
1 answer

OperationalError: (1101, BLOB, TEXT, GEOMETRY or JSON column field_name cant have a default value)

Work Environment: 1. Django 1.11 2. Python 3.6 3. MySQL Community Server- 5.7.21 I've been using django-jsonfield for my Django models. import jsonfield from django.db import models class MySampleModel(models.Model): name =…
JPG
  • 82,442
  • 19
  • 127
  • 206
0
votes
1 answer

Django Rest Docker with MySQL create a superuser

I have dockerized my existing Django Rest project which uses MySQL database. My dockerfile: FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code COPY . /code/ RUN pip install -r requirements.txt And my docker-compose.yml…
Thinker
  • 5,326
  • 13
  • 61
  • 137
0
votes
2 answers

Django project set up with MySql and virtual environment from start

I am new to django so I need to start with django projects..I need information regarding how to start with django project using MySql database and virtual environment on Linux.
john
  • 36
  • 4
0
votes
1 answer

djagno filter regex not working while python re works

I am trying to do iregex match in django for the regular expression reg_string = (\w|\d|\b|\s)+h(\w|\d|\b|\s)+(\w|\d|\b|\s)+anto(\w|\d|\b|\s)+ self.queryset.filter(name__iregex=r"%s"%(reg_string,)) by using the word "The Canton" for name but its…
Titus Joyson
  • 325
  • 2
  • 4
  • 14
0
votes
1 answer

1146 "app_name.django_site missing"

I am using Django 1.11 for making an app 'cnfs', and I am using MYSQL database with it. I am constantly facing this issue where I am getting an error like this when I type the following code: $python manage.py migrate System check identified some…
0
votes
1 answer

How limit a user to save database in django?

How do i restrict the user to save objects in db class model_name(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True) user = models.ForeignKey(User) foo = models.CharField(max_length=51) i want to…
the_thor
  • 53
  • 1
  • 6
0
votes
1 answer

Joining 2 tables with Count in MySQL and Django

Part 1: MySQL From a MySQL database how can I join the following two counts SELECT COUNT(activity_id) as activities, user_id FROM Activity WHERE activity_completed_time IS NOT NULL AND group = somevalue GROUP BY user_id; SELECT…
Jack Clarke
  • 154
  • 1
  • 10
0
votes
1 answer

Updating Mysql JSON field

I'm using django 1.8.9 and MySQL 5.7.17. I've a following table: +----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra …
aikipooh
  • 137
  • 1
  • 19
0
votes
1 answer

Access Celery's subprocess stdout and stderr in my Django app

I put Celery in my Django app so that the two other python programs can process the input from my Django app via doing subprocess method. My question is how do I access the output from the subprocess? Back then when I made just a python program, I…
sparklights
  • 97
  • 1
  • 1
  • 9
0
votes
0 answers

Django: Fetch a true/false with extra() if a matching record exists in another table

I have a model Registration with a foreign key to model License which has a unique CharField key. For a certain set of Registrations I need to get a boolean if an Activation record exists with that license key. There is however no foreignkey…
djangonaut
  • 7,233
  • 5
  • 37
  • 52
0
votes
1 answer

Include multiple statements in Django's raw queries

Is there any way we can include multiple statements inside on raw queries. My use case would be I need to run SET @@group_concat_max_len=100000; before the select statement. Update For my specific problem, I solved by adding a init_command for the…
Ivor Zhou
  • 1,241
  • 13
  • 22
-1
votes
1 answer

I need a brief explanation into how to connect my Django application to a Google Cloud MySQL database

I'm pretty new to web development and I'm currently deploying my first web application. It's pretty much built with stock Django and a few dependencies. Right now, I have it deployed on Railway.app with a very standard SQLite database. However, I…
-1
votes
1 answer

Connect Django to MySql database on VPS

I am trying to run my Django project on a VPS. My Django project uses MySQL. While running it on my local computer I used the following code to connect MySQL to Django DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME':…
Leman Kirme
  • 530
  • 1
  • 5
  • 19
-1
votes
1 answer

How to import a mysql database made with mysql workbench into django?

I created a database with MYSQL Workbench 8.0 and I want to import it into Django, so that I can display the data on the browser. How can I do that?
Tms91
  • 3,456
  • 6
  • 40
  • 74
-1
votes
1 answer

Facing problem in installing mysqlclient in python

I am a beginner in python. I am doing my college project in django-python. I want to use MySQL (phpMyAdmin). I am facing problem in installing mysqlclient. The error is given below... C:\Program Files (x86)\Microsoft Visual…