Re: Please help me while i am connecting mysql database to django lroject iam getting following error

2020-03-22 Thread Motaz Hejaze
There is a leading space in ' localhost'.. Remove it On Sun, 22 Mar 2020, 6:59 pm fahad rasool, wrote: > Please help me while i am connecting mysql database to django lroject iam > getting following error > > -- > You received this message because you are subscribed to th

Re: Inability to Connect django with MySQL database

2020-03-20 Thread Luis Zárate
vie., 20 mar. 2020 a las 14:55, Victor () escribió: > What's the database variable in your settings.py file > > On Friday, March 20, 2020 at 2:54:05 PM UTC+1, Ifeanyi Chielo wrote: >> >> Hello, >> I am new to Python django, I have been making efforts to connect a dja

Re: Inability to Connect django with MySQL database

2020-03-20 Thread Victor
What's the database variable in your settings.py file On Friday, March 20, 2020 at 2:54:05 PM UTC+1, Ifeanyi Chielo wrote: > > Hello, > I am new to Python django, I have been making efforts to connect a django > application to mysql without success. Bellow is the information that

Inability to Connect django with MySQL database

2020-03-20 Thread Ifeanyi Chielo
Hello, I am new to Python django, I have been making efforts to connect a django application to mysql without success. Bellow is the information that I got PS C:\Users\IFEANYI CHIELO\divine> python manage.py migrate Traceback (most recent call last): File "C:\Users\IFEANYI

Connection pooling to MariaDB SQL database

2020-03-02 Thread Simen Russnes
Good morning list What are the best strategies for implementing connection pooling for connections to a MariaDB SQL database? Are there built in capabilities in Django at the moment, or do I have to install something like https://pypi.org/project/django-db-connection-pool/ ? Simen -- You

Re: Database connection not pointing to the correct database backend

2020-03-01 Thread maninder singh Kumar
onnecting to > a mysql database. (I've also tried sql-server database and had the same > issue) > > It took me awhile the first time I did this but I was able to get it to > work using > 'ENGINE': 'mysql.connector.django', > > > This time around I'm doing the same thing

Re: Database connection not pointing to the correct database backend

2020-02-29 Thread Agumba .
tual environment and > reinstalling all the packages again. > it worked for me then, I have now access to mysql database .. > afterthat you have python 2.xx version pip install > otherwise python3.xx version pip3 install > > On Sun, Mar 1, 2020 at 1:51 AM Cam wrote: > >>

Re: Database connection not pointing to the correct database backend

2020-02-29 Thread karthik s
Hi cam, well I solved same problem by removing virtual environment and reinstalling all the packages again. it worked for me then, I have now access to mysql database .. afterthat you have python 2.xx version pip install otherwise python3.xx version pip3 install On Sun, Mar 1, 2020 at 1:51 AM

Database connection not pointing to the correct database backend

2020-02-29 Thread Cam
I'm running Ubuntu and I'm trying to create a small web-app connecting to a mysql database. (I've also tried sql-server database and had the same issue) It took me awhile the first time I did this but I was able to get it to work using 'ENGINE': 'mysql.connector.django', This time around I'm

New to Django need help with m2m database with intermediate table.

2020-02-24 Thread Silas Nicholls
Hello, Sorry for my amateur question. I've been stuck on this issue for a while and I can't work out if there is way I can use my current models to work in this way. Here is a link to my issue:

I am not able to render my file fields in the Database so not able to upload image

2020-02-20 Thread mick
forms.py class FormStep8(forms.Form): portraitphoto=forms.ImageField(label='Portrait photos of yourself') high_resolution=forms.ImageField(label='3 High Resolution pictures') company_logo=forms.ImageField(label='Company Logo') product_images=forms.ImageField(label='Product

Re: Re: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread DHRUVA
: Re: I am filling up the form but my filled out items are > not rendering into database and also the session is not working > > > > The template file > > > > > > <*form **method**="post" **novalidate*> > > No action attribute defined here. Where

RE: Re: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread dhruvashah1221999
 Yaa did that still facing issue From: onlinejudge95Sent: Thursday, February 20, 2020 12:32 AMTo: django-users@googlegroups.comSubject: Re: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working The template file  <form method=&q

Re: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread onlinejudge95
% endblock %} > > > > > > *From: *Farai M > *Sent: *Wednesday, February 19, 2020 11:19 PM > *To: *django-users@googlegroups.com > *Subject: *Re: I am filling up the form but my filled out items are not > rendering into database and also the session is not working > > > > Th

RE: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread dhruvashah1221999
vebutton>  form>{% endblock %}  From: Farai MSent: Wednesday, February 19, 2020 11:19 PMTo: django-users@googlegroups.comSubject: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working The session must be activated in t

RE: Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread dhruvashah1221999
= 'mysite.wsgi.application'# Database# https://docs.djangoproject.com/en/2.1/ref/settings/#databasesDATABASES = {    'default': {    'ENGINE': 'django.db.backends.sqlite3',    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),    }}# Password validation# https://docs.djangoproject.com/en/2.1/ref/settings/#auth

Re: I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread Farai M
The session must be activated in the settings file check that it should work smoothly. On the insert can u share the template file mostly .It is to do with post requests not reaching back end. You can try to print the post request before your save to model to see if all inputs are coming

I am filling up the form but my filled out items are not rendering into database and also the session is not working

2020-02-19 Thread mick
views.py from django.views.generic import FormView, TemplateView from django.shortcuts import render,redirect from .models import modelstep1,modelstep2,modelstep3,modelstep4,modelstep5,modelstep6,modelstep7,modelstep8,modelstep9,modelstep10 from .forms import

Saving np.nan to sqlite database Django 2.1 in unit test fails

2020-02-13 Thread BK
I upgraded to django 2.1 and some of my unit tests (which use a sqlite database) are failing with the following: File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/db/models/query.py", line 268, in __iter__ 2113self._fetch_all() 2114 File &qu

Re: Django server is slow after moving database to remote VM

2020-02-11 Thread Michael Thomas
1500kbps is horrendously slow too, really.. If you're seeing a significant difference between small transfers vs large, you might be stumbling into an incorrect MTU size for the network. This has popped up a little more often in recent years with the rise of vxlans over public connections.

Re: Django server is slow after moving database to remote VM

2020-02-11 Thread Simen Russnes
quests to the server as the round trip of opening and closing a connection now is obviously going to be slower, but I've noticed that even when doing things like accessing a standard ViewSet, serializing a Model the database can be very slow. One thing in particular that got me worried is that when moni

Re: Django server is slow after moving database to remote VM

2020-02-10 Thread Jody Fitzpatrick
tried to limit the number of explicit requests to the server as the > round trip of opening and closing a connection now is obviously going to > be slower, but I've noticed that even when doing things like accessing a > standard ViewSet, serializing a Model the database can be very slow. O

Django server is slow after moving database to remote VM

2020-02-10 Thread Simen Russnes
going to be slower, but I've noticed that even when doing things like accessing a standard ViewSet, serializing a Model the database can be very slow. One thing in particular that got me worried is that when monitoring the network traffic, I can see simultaneous upload and download speeds, when I would

Re: Problem in fetching the name from database

2020-02-06 Thread Miguel Braga
can you give some more context? how are you fetching the data? On Sun, 12 Jan 2020 at 13:09, Aadarsh Bajpai wrote: > Hello , >I am facing problem in fetching the name from database such > that whenever i try to fetch the column from the database it comes in the > f

Re: How to render data from populated database (no user input) to html

2020-01-28 Thread maninder singh Kumar
e: > On Monday, January 20, 2020 at 11:59:01 AM UTC+5:30, nmax...@gmail.com > wrote: >> >> I would like to render data from a populated database into a HTML >> (homepage_view). I am not sure if I create a GET method from the >> database (and if so how) or use (fix) t

Re: How to render data from populated database (no user input) to html

2020-01-28 Thread Suraj
On Monday, January 20, 2020 at 11:59:01 AM UTC+5:30, nmax...@gmail.com wrote: > > I would like to render data from a populated database into a HTML > (homepage_view). I am not sure if I create a GET method from the > database (and if so how) or use (fix) the code

Re: How to render data from populated database (no user input) to html

2020-01-19 Thread maninder singh Kumar
On Mon, Jan 20, 2020 at 12:00 PM nmaxbe...@gmail.com wrote: > I would like to render data from a populated database into a HTML > (homepage_view). I am not sure if I create a GET method from the > database (and if so how) or use (fix) the code listed below. > > The ultimate outco

How to render data from populated database (no user input) to html

2020-01-19 Thread nmaxbe...@gmail.com
I would like to render data from a populated database into a HTML (homepage_view). I am not sure if I create a GET method from the database (and if so how) or use (fix) the code listed below. The ultimate outcome is to have a table with three columns (models.py) with six rows. Note

Problem in fetching the name from database

2020-01-12 Thread Aadarsh Bajpai
Hello , I am facing problem in fetching the name from database such that whenever i try to fetch the column from the database it comes in the form of tuple as output(Ex. ( 'Aadarsh','Bajpai',) it is also shown in the screenshot . Since this looks worst

django forms exclude values from choicefield that are already into database

2020-01-05 Thread Muhammad Mahir
I want to exclude those options from the ChoiceField in the forms that has been already selected and are into the database. Below is the Code. models.py ``` SEMESTER_CHOICES = ( ("1", "1"), ("2", "2"), ("3", "3"),

Re: Using Unaccent in Model database function

2020-01-05 Thread Alex Scott
I was able to figure this out using... from django.contrib.postgres.lookups import Unaccent queryset.annotate(search_index=StrIndex(Unaccent(Lower('name')), Value(q))) Might be nice to add to the documentation here: https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/lookups/#unaccent

Using Unaccent in Model database function

2020-01-05 Thread Alex Scott
Hi all, I just started using the Unaccent extension for Postgres and implementing queryset filters with it like: q = 'hello' queryset.filter(name__unaccent__istartswith=q) I'm now trying to annotate the queryset result with the search index:

Re: send data to database

2019-12-24 Thread Kevin Dublin
ything *Happiness is a state of being, just be.* *Believe it, and it will be.* On Tue, Dec 24, 2019 at 6:20 AM Leó Horváth wrote: > Hi guys, > > I want to create a form with radio buttons that sends data to a specific > database field. How can I do it? > > My models.py looks like

send data to database

2019-12-24 Thread Leó Horváth
Hi guys, I want to create a form with radio buttons that sends data to a specific database field. How can I do it? My models.py looks like this: import datetime from django.db import models from django.utils import timezone # Create your models here. class Name(models.Model): user_name

Update value in database

2019-12-19 Thread Nuno Vieira
Hi! I have a real estate django app and i have a form to users insert a new property. I also have in the form several images fields that users can use to upload images to database whitout problem. The problem is if the *user want to delete one of the images field.* I have an ajax request

Re: Multiple Apps in one project with one database

2019-12-11 Thread Bruckner de Villiers
: on behalf of Miracle Reply to: Date: Wednesday, 11 December 2019 at 12:26 To: Subject: Re: Multiple Apps in one project with one database Multiple Apps can point to one database. What happens is that django creates different tables in the database. It uses this format to create the tables

Re: Multiple Apps in one project with one database

2019-12-11 Thread Miracle
Multiple Apps can point to one database. What happens is that django creates different tables in the database. It uses this format to create the tables 'appname_modelname' e.g. polls_question Infact, if you remember earlier on before runnung your first "python manage.py migrate"

Multiple Apps in one project with one database

2019-12-11 Thread Bruckner de Villiers
. OK So, I looked at the folders and there is only one sqlite3 file.  The Database Structure is unchanged and the original data is still intact.  The admin page now displays 2 Question tables – the 2nd one contains no data.  Also, http://127.0.0.1:8000/polls2/ shows No Questions available.

Re: Postgres database users and roles for DJango App

2019-12-08 Thread John McClain
... Cheers, On Sat, 7 Dec 2019 at 19:39, Ram wrote: > Hi, > > I'm looking for steps for configuring Postgres database user and roles for > DJango production app. > > One additional question that I've is every document that I referred so far > describes about 'PUBLIC' sche

Postgres database users and roles for DJango App

2019-12-07 Thread Ram
Hi, I'm looking for steps for configuring Postgres database user and roles for DJango production app. One additional question that I've is every document that I referred so far describes about 'PUBLIC' schema only. I'm not sure whether this is production App setting? I appreciate if someone can

Re: Django on an existing PostgreSQL Database?

2019-11-25 Thread carlos
https://docs.djangoproject.com/en/2.2/howto/legacy-databases/ On Mon, Nov 25, 2019 at 3:03 PM Ulrich Goebel wrote: > Hi, > > I have an existing PostgreSQL Database with about 20 tables, using > collating sequences, foreign keys, triggers, and even additional indexes. > For that

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread carlos
new hosting server with Postgres database (empty site so far) in a > Digital Ocean's droplet ( Ubuntu 18.04 OS). So what I'm planning now is I > will not run these commands in new server's virtual environment > > 4.1.(virtual env) ~/myprojectdir/manage.py makemigrations > 4.2. (virtual env)

Django on an existing PostgreSQL Database?

2019-11-25 Thread Ulrich Goebel
Hi, I have an existing PostgreSQL Database with about 20 tables, using collating sequences, foreign keys, triggers, and even additional indexes. For that database I want to write a WEB-frontend to insert, update and delete data in the database. I don't want to define the data model in python

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread Ram
Hi Carlos, I see there is a typo in my previous steps which could have mislead you. Basically old and new sites are different databases. Old site is running remotely in local host on our Developer's machine with MySQL dB. Now I've setup new hosting server with Postgres database (empty site so far

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-25 Thread carlos
i thing is good your plan copy your files local to server then dumpdata in local database and copy to server and last you loaddata in your server cheers On Sat, Nov 23, 2019 at 10:13 PM Mohammad yunus wrote: > Is this "migration" command will work for all type of databases o

use signals in channels2 - send message when a database field is updated

2019-11-23 Thread Levent Engin
Hi; How can i implement to use signals inside channels2? I want to send message via consumer when a database field is updated. Wiil that be inside consumer or models? Is there a sample or tutorial? Best regards -- You received this message because you are subscribed to the Google Groups

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-23 Thread Mohammad yunus
ed in my developer's localhost > 4. Once the files are copied to project folder in this new server I will > have to run following commands, but I will not run these because old and > new sites have same database software. > 4.1.(virtual env) ~/myprojectdir/manage.py makemigrations > 4.

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-23 Thread Ram
database software. 4.1.(virtual env) ~/myprojectdir/manage.py makemigrations 4.2. (virtual env) ~/myprojectdir/manage.py migrate 4.3. (virtual env) ~/myprojectdir/manage.py collectstatic 5. So I want to start with your steps pointed in your blog <https://www.calazan.com/migrating-django-app-f

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-23 Thread Ram
Hello Carlos, The steps looks promising. We will try it and let you know. Our dB is originally from MySQL configured for PHP based website and later on we moved to Django project development. Now we planned to migrate the site to Postgres database running on Ubuntu for Django project. Thank you

Re: How to migrate Django site from MySQL database to Postgres?

2019-11-23 Thread carlos
maybe this link help you! https://www.calazan.com/migrating-django-app-from-mysql-to-postgresql/ On Sat, Nov 23, 2019 at 12:23 PM Ram wrote: > Hi, > > We have our Django based website running in our local windows box with > MySQL database. We plan to deploy our site on Ubunt

How to migrate Django site from MySQL database to Postgres?

2019-11-23 Thread Ram
Hi, We have our Django based website running in our local windows box with MySQL database. We plan to deploy our site on Ubuntu, Postgress, Gunicorn and Nginx stack server. I'm looking for a way to achieve this even with the manual intervention? I appreciate if someone can point me the right

Re: reg: creating blog topic in database

2019-11-19 Thread 'Amitesh Sahay' via Django users
in my database model which I have registered in admin.py. Any idea, how can I achieve this, as this would be a like generating dynamic HTML pages based on models. I am not sure if I was able to explain my requirements. May be as I am not getting right words to express them. Please ask me questions

Re: reg: creating blog topic in database

2019-11-18 Thread 'Amitesh Sahay' via Django users
until now, but it seems to be a time taking and non-productive way. So, now I would like to write posts in my database model which I have registered in admin.py. Any idea, how can I achieve this, as this would be a like generating dynamic HTML pages based on models. I am not sure if I

Re: reg: creating blog topic in database

2019-11-16 Thread Integr@te System
r each topic,and write page > content in tags. which I have been thinking to do until now, but it > seems to be a time taking and non-productive way. So, now I would like to > write posts in my database model which I have registered in admin.py. > > Any idea, how can I achieve this, as this

reg: creating blog topic in database

2019-11-16 Thread 'Amitesh Sahay' via Django users
. which I have been thinking to do until now, but it seems to be a time taking and non-productive way. So, now I would like to write posts in my database model which I have registered in admin.py. Any idea, how can I achieve this, as this would be a like generating dynamic HTML pages based on models

Migrating MySQL Maria database to Postgres

2019-11-13 Thread Ram
Hi, We are running a Django development server with MySQL Maria database and we are planning to migrate the database to postgres for the same development server. Please let me know if 'pgLoader' would help in this case or any other option could help? thanks, ~Ram -- You received this message

Re: Multi-Tenancy MySQL Database in Django

2019-11-12 Thread Integr@te System
https://github.com/citusdata/django-multitenant welcome On Tue, Nov 12, 2019, 19:30 Senthil Kumar wrote: > We are going to do a SAAS based application for our existing application. > We need to integrate the Multi-Tenancy database using MySQL in this > application. Please su

Multi-Tenancy MySQL Database in Django

2019-11-12 Thread Senthil Kumar
We are going to do a SAAS based application for our existing application. We need to integrate the Multi-Tenancy database using MySQL in this application. Please suggest any predefined packages available in Django. For example, company1.domain.com,company2.domain.com,company3.domain.com.Here

Re: mariadb/mysql database (2006, 'MySQL server has gone away')

2019-11-07 Thread BR
I'm still having this issue, and it definitely seems Channels related. When the issue occurs, I can logout/login and do other things on the Django only portion of the site. As soon as I try to make DB requests from within a Channels consumer, the error pops up. Restarting the Daphne server

mariadb/mysql database (2006, 'MySQL server has gone away')

2019-11-01 Thread BR
I think I'm experiencing an issue related to: https://github.com/django/channels/issues/1234 where I get (2006, 'MySQL server has gone away') after trying to establish a new channels connection with calls using database_sync_to_async(). I have set my Django DB CONN_MAX_AGE to 300 (5 minutes)

Re: Multiple Database Setup

2019-10-30 Thread DANIEL URBANO DE LA RUA
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/ On Wed, 30 Oct 2019, 14:39 Rajat Chopra, wrote: > I wish to create a project with 2 apps. Each app will have its own > database - one for payments and another for statements. > > I have created a set of models within t

Multiple Database Setup

2019-10-30 Thread Rajat Chopra
I wish to create a project with 2 apps. Each app will have its own database - one for payments and another for statements. I have created a set of models within the models.py for the payments app and another set of models inside within the models.py for the statements app. When I run

Can Anyone suggest on Snowflake database connection using Django?

2019-10-29 Thread Avinash Gaurav
Hi All, I am trying to create an engine in settings.py of django app to connect to snowflake database, but not able to do so. Since snowflake is a 3rd party database for django, so not able to figure out if the connection is possible, however I am able to connect using simple python script

Django integration with Snowflakes database

2019-10-26 Thread Vikash Barnwal
Can anyone help me on integration of Django with *Snowflakes database.* I want to know that does Django supports customize database like *Snowflakes database *or not. Please feel free to reach me on My mail ID and contact number as; vikashbarnwal...@gmail.com, 8249487723. -- You received

RE: Database ORM query Help

2019-10-26 Thread dvdcedar
STATUS_TYPES, default=PENDING) From: django-users@googlegroups.com On Behalf Of wd Sent: Saturday, 26 October 2019 11:43 AM To: django-users@googlegroups.com Subject: Re: Database ORM query Help I think you could consider using raw sql, https://docs.djangoproject.com/en/2.2/topics/db/sql/

Re: Database ORM query Help

2019-10-25 Thread wd
I think you could consider using raw sql, https://docs.djangoproject.com/en/2.2/topics/db/sql/#executing-custom-sql-directly On Fri, Oct 25, 2019 at 7:56 PM Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggling to create the

Re: Database ORM query Help

2019-10-25 Thread Samiul Sk
Please post the code of Model and explain what do you want as Queryset? On Fri, 25 Oct 2019 at 17:26, Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggling to create the Django query. I have been attempting to use the >

Database ORM query Help

2019-10-25 Thread Cheda me
Hey guys, I have worked out the SQL query I would like to implement but am currently struggling to create the Django query. I have been attempting to use the .aggregate() & Max() methods but cant seem to get the right result. Any help is much appropriated. SELECT temp.* FROM item_detail temp

Re: database could't connect in python to atom

2019-10-22 Thread wd
hi, Maybe you need to check what mysql.connector is. What's the output for 'dir(mysql.connector)' ? On Wed, Oct 23, 2019 at 11:08 AM MEGA NATHAN wrote: > Hi. > > AttributeError: module 'mysql.connector' has no attribute 'connect' > > > > > > regards > Meganathan, > > -- > You received this

Re: database could't connect in python to atom

2019-10-22 Thread Suraj Thapa FC
You are using wrong syntax for connecting sql On Wed, 23 Oct, 2019, 8:38 AM MEGA NATHAN, wrote: > Hi. > > AttributeError: module 'mysql.connector' has no attribute 'connect' > > > > > > regards > Meganathan, > > -- > You received this message because you are subscribed to the Google Groups >

database could't connect in python to atom

2019-10-22 Thread MEGA NATHAN
Hi. AttributeError: module 'mysql.connector' has no attribute 'connect' regards Meganathan, -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread lemme smash
okay, man. seems like you need to read and repeat everything you know about python and django. i highly recommend you to go through django tutorial. On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote: > > Traceback: > > File >

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread Gourab Mahapatra
and now this error shows, something related to the job instance, i don't know but if you want then i can share with you my models.py file code and views.py file code please help me in this regard, I am stuck here since 2 weeks. I have attached the screenshot of the error please find attached ..

Re: unable to validate and save modelform data into mysql database...

2019-10-22 Thread Gourab Mahapatra
On Tuesday, 22 October 2019 11:33:23 UTC+5:30, Gourab Mahapatra wrote: > > and now this error shows, something related to the job instance, i don't > know but if you want then i can share with you my models.py file code and > views.py file code > please help me in this regard, > I am stuck

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
and also I tried to use statements as shown in the attached file. But still I get an error like the above thread: Exception Type: NameError Exception Value: name 'job_name' is not defined On Monday, 21 October 2019 20:38:13 UTC+5:30, lemme smash wrote: > > it's quite expected behavior. if

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
sir/madam, when I replace the particular statement with the one which you have adviced me to use. then, this gives me an error something like: Exception Type: NameError Exception Value: name 'job_name' is not defined please help me in fixing this issue Thanks & Regards Gourab Mahapatra

Re: unable to validate and save modelform data into mysql database...

2019-10-21 Thread lemme smash
it's quite expected behavior. if you want to check if job exists, you better use Job.objects.filter(name=job_name).exists() On Monday, October 21, 2019 at 3:49:01 PM UTC+3, Gourab Mahapatra wrote: > > Traceback: > > File >

unable to validate and save modelform data into mysql database...

2019-10-21 Thread Gourab Mahapatra
Traceback: File "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\base.py"

django modelforms unable to validate fields and save data entered by users into database

2019-10-21 Thread Gourab Mahapatra
Error i get : Traceback: File "C:\Users\Admin\PycharmProjects\autotask\AutoTaskVenv\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File

Re: delete image url from database

2019-10-16 Thread Nuno Vieira
I am saving the image to media folder and save the url in database. photo_5 = models.ImageField(upload_to='photos/%Y/%m/%d/', blank=True) Then when the user clicks in trash can icon, i have an ajax request to delete the image from database. But there is the problem, i am not able to update

Re: delete image url from database

2019-10-16 Thread Anirudh Jain
First of all, are you saving image url explicitly in database ? You dont need to so that to show/delete any image. Second, try delete() for deletint image entry. On Wed, 16 Oct 2019, 19:54 Nuno Vieira, wrote: > Hi there, > > i am creating a real estate app and i want users to insert a

delete image url from database

2019-10-16 Thread Nuno Vieira
listing.save(['photo_5']) return True photo_5 is an Imagefield and i want to change the value of that field in database to None. Why is not changing? Thanks for your help. -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: how to retrieve data from database using raw SQL not django ORM

2019-10-14 Thread Kanyamahanga Hubert
Your error message is pretty clear. Change a little bit your urls.py to take pk keywords like this: path("events//",getEvents,name = "getEvents"), On Mon, 14 Oct 2019 at 07:53, Kasper Laudrup wrote: > Hi Leb Dev, > > On 14/10/2019 08.28, leb dev wrote: > > > > once i tried to perform the

Re: how to retrieve data from database using raw SQL not django ORM

2019-10-14 Thread Kasper Laudrup
Hi Leb Dev, On 14/10/2019 08.28, leb dev wrote: once i tried to perform the task the system crash and display: getEvents() got unexpected keyword argument "id > That error message is pretty clear. Look at your getEvents() function. It doesn't take a keyword argument, while in your

how to retrieve data from database using raw SQL not django ORM

2019-10-14 Thread leb dev
0 I have a django project that is connected to SQL server database and when i tried to click button to retrieve data from the database the system crash . i am trying to convert the below syntax in ORM into raw sql: dbEntry = Person_.objects.get(pk =pk) Note : *I am not using ORM* once i

Re: getting error when i changed database sqllite3 to mysql

2019-10-07 Thread Desh Deepak
You can't use above version of django 2.0 with pymysql. On Mon, 7 Oct 2019, 03:24 'Dick in Texas' via Django users, < django-users@googlegroups.com> wrote: > I have tried to use a new, empty database, but that did not work. Still > got the question if I have installed MySQLclien

Re: getting error when i changed database sqllite3 to mysql

2019-10-07 Thread Tosin Ayoola
Hello in your settings.py files, you still have, sqlite3 as your db engine instead of MySQL so probably try changing that then see if it's works On Oct 5, 2019 22:35, "Gulsher Khan" wrote: > I trying to change default database(sqllite) which is given by the Django. > I w

Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread 'Dick in Texas' via Django users
efault database(sqllite) which is given by the Django. > I want to use mysql database. I put lots of effort but nothing went well. I > successfully has been install mysql, mysqlclient, mysql-connector whatever > i have read in the documentation. > > I'm using OS: Ubuntu 19.0

Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread 'Dick in Texas' via Django users
I have tried to use a new, empty database, but that did not work. Still got the question if I have installed MySQLclient. Tried the statements from Desh Deepak. The install and import went well. However, when I tried to migrate, I got the message: module 'pymysql' has no attribute

Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread Joseph Emeka
I think you need to create the database "django" on you database back-end. And try making migrations again. On Sat, Oct 5, 2019, 22:36 Gulsher Khan wrote: > I trying to change default database(sqllite) which is given by the Django. > I want to use mysql database. I pu

Re: getting error when i changed database sqllite3 to mysql

2019-10-06 Thread Desh Deepak
pip install pymysql And then, setting.py import pymysql pymysql.install_as_MySqldb() And edit DATABASE: = { 'default' :{ 'ENGINE': 'django.db.backends.mysql', 'NAME': 'database name', 'USER': 'username', 'PASSWORD': 'password', 'HOST' : 'localhost', 'PORT' : '3306

Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Motaz Hejaze
If you have data , export it to csv , then after creating the mysql database populate it with data ftom csv file On Sun, 6 Oct 2019, 1:16 am Aldian Fazrihady, wrote: > Have you created the database on MySQL? > > On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan > wrote: > >&g

Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Aldian Fazrihady
Have you created the database on MySQL? On Sun, Oct 6, 2019 at 4:36 AM Gulsher Khan wrote: > I trying to change default database(sqllite) which is given by the Django. > I want to use mysql database. I put lots of effort but nothing went well. I > successfully has been inst

Re: getting error when i changed database sqllite3 to mysql

2019-10-05 Thread Gil Obradors
HI! Maybe this tutorial can help you https://medium.com/@a01207543/django-conecta-tu-proyecto-con-la-base-de-datos-mysql-2d329c73192a (in Spanish) Missatge de Gulsher Khan del dia ds., 5 d’oct. 2019 a les 23:36: > I trying to change default database(sqllite) which is given by the Django.

Re: Database connection closed after each request?

2019-10-01 Thread deb.dasit2013
gs: > > DATABASE_ENGINE to projectname.postgresql_psycopg2_persistent > > Here is a source: http://dpaste.com/hold/86948/ > > # Custom DB backend postgresql_psycopg2 based > # implements persistent database connection using global variable > > from django.db.bac

Re: regarding adding data into database using faker library

2019-09-26 Thread Cornelis Poppema
It seems you have an unfortunate typo in your environment variable name. Change DJANGO_SETTING_MODULE -> DJANGO_SETTINGS_MODULE and try again. On Thursday, 26 September 2019 16:26:18 UTC+2, Sahil Sharma wrote: > > [image: 2019-09-26-1569507899_screenshot_1920x1080.jpg] > I did the changes but it

Re: how to copy one table content in to another table in database

2019-09-26 Thread Derek
http://www.mysqltutorial.org/mysql-insert-into-select/ On Monday, 16 September 2019 17:05:57 UTC+2, Mahendhar Reddy wrote: > > how to copy one table content in to another table in database > -- You received this message because you are subscribed to the Google Groups "Djang

Re: regarding adding data into database using faker library

2019-09-26 Thread Cornelis Poppema
The location of your first django.setup() on line 4 was actually what you need. Right now it does show the same error but from a different line: the line where you import your model. - you need to do django.setup() before importing any of your project code - you need to set

Re: regarding adding data into database using faker library

2019-09-25 Thread Cornelis Poppema
You almost had it! You're already setting DJANGO_SETTINGS_MODULE before you call django.setup() inside your main function. However, you also call django.setup() on line 4. You need to set DJANGO_SETTINGS_MODULE before the first django.setup(). On Wednesday, 25 September 2019 13:04:10 UTC+2,

rumove upload_to in the database

2019-09-19 Thread Luca Bertolotti
Hello in the model i have : file = models.FileField(upload_to='disegni/', blank=True, null=True) in the database in the column file django save : disegni/filename.xxx in which way i can save only the filename and not the folder? Best Regards -- You received this message because you

<    1   2   3   4   5   6   7   8   9   10   >