Re: Django : Change Backend as mysql and create sample example using django ORM

2018-08-29 Thread Tim Graham
 This list is dedicated to the discussion of developing Django itself, not 
answering usage questions. Please continue the discussion on the 
django-users thread: 

https://groups.google.com/d/topic/django-users/iuspogePH3k/discussion

On Wednesday, August 29, 2018 at 7:15:57 AM UTC-4, Sonali Vighne wrote:
>
> Hi,
>
> Below is the my models.py
>
>  
>
>  
>
> from django.db import models
>
> #from django_mysql.models import *Model*
>
>  
>
> class *Category*(models.Model):
>
> name = models.CharField(max_length=128, unique=True)
>
>  
>
> def *__unicode__*(*self*):
>
> return *self*.name
>
> 
>
> class *Page*(models.Model):
>
> category = models.ForeignKey(Category, on_delete=models.CASCADE,)
>
> title = models.CharField(max_length=128)
>
> url = models.URLField()
>
> views = models.IntegerField()
>
>  
>
> def *__unicode__*(*self*):
>
> return *self*.title
>
>  
>
> *From:* django-d...@googlegroups.com  <
> django-d...@googlegroups.com > *On Behalf Of *Raghavendrachari 
> k
> *Sent:* 29 August 2018 09:42
> *To:* django-d...@googlegroups.com 
> *Subject:* Re: Django : Change Backend as mysql and create sample example 
> using django ORM
>
>  
>
> Hi Sonali,
>
> Could you please paste the models.py file ??
>
> Might be there is some syntax error in the models you have created.
>
> Regards,
>
> Raghav
>
>  
>
> On Tue, Aug 28, 2018 at 9:41 PM parmeshwar deharkar <
> parmeshwa...@gmail.com > wrote:
>
> hi sonali 
>
>  you install sql libray in your project package then edit the setting.py 
> file at django framework with database .
>
> I hope your problem will be solve...
>
>  
>
> On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne  > wrote:
>
> Hi,
>
> I have tried a lot to change Django back-end as MySQL but not able to 
> achieve this. 
>
> please help for the same.
>
>  
>
> thanks in advance. :) 
>
>  
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-develop...@googlegroups.com .
> To post to this group, send email to django-d...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-develop...@googlegroups.com .
> To post to this group, send email to django-d...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-develop...@googlegroups.com .
> To post to this group, send email to django-d...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/CAHjM6E5Ky9BDUFi4V887V%2BkMasb6%2BZJ8V7nHKCYqgeUAun0FQA%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-developers/CAHjM6E5Ky9BDUFi4V887V%2BkMasb6%2BZJ8V7nHKCYqgeUAun0FQA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a643b239-23df-4a20-9e07-b2ec5f34ad8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Django : Change Backend as mysql and create sample example using django ORM

2018-08-29 Thread Sonali Vighne
Hi,
Below is the my models.py


from django.db import models
#from django_mysql.models import Model

class Category(models.Model):
name = models.CharField(max_length=128, unique=True)

def __unicode__(self):
return self.name

class Page(models.Model):
category = models.ForeignKey(Category, on_delete=models.CASCADE,)
title = models.CharField(max_length=128)
url = models.URLField()
views = models.IntegerField()

def __unicode__(self):
return self.title

From: django-developers@googlegroups.com  
On Behalf Of Raghavendrachari k
Sent: 29 August 2018 09:42
To: django-developers@googlegroups.com
Subject: Re: Django : Change Backend as mysql and create sample example using 
django ORM

Hi Sonali,
Could you please paste the models.py file ??
Might be there is some syntax error in the models you have created.
Regards,
Raghav

On Tue, Aug 28, 2018 at 9:41 PM parmeshwar deharkar 
mailto:parmeshwardehar...@gmail.com>> wrote:
hi sonali
 you install sql libray in your project package then edit the setting.py file 
at django framework with database .
I hope your problem will be solve...

On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne 
mailto:sonalivig...@gmail.com>> wrote:
Hi,
I have tried a lot to change Django back-end as MySQL but not able to achieve 
this.
please help for the same.

thanks in advance. :)


--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-developers@googlegroups.com<mailto:django-developers@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com<https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-developers@googlegroups.com<mailto:django-developers@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com<https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-developers@googlegroups.com<mailto:django-developers@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAHjM6E5Ky9BDUFi4V887V%2BkMasb6%2BZJ8V7nHKCYqgeUAun0FQA%40mail.gmail.com<https://groups.google.com/d/msgid/django-developers/CAHjM6E5Ky9BDUFi4V887V%2BkMasb6%2BZJ8V7nHKCYqgeUAun0FQA%40mail.gmail.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/MA1PR0101MB19116DE7D09FBF14285EAB4CE2090%40MA1PR0101MB1911.INDPRD01.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: Django : Change Backend as mysql and create sample example using django ORM

2018-08-28 Thread Raghavendrachari k
Hi Sonali,
Could you please paste the models.py file ??
Might be there is some syntax error in the models you have created.
Regards,
Raghav

On Tue, Aug 28, 2018 at 9:41 PM parmeshwar deharkar <
parmeshwardehar...@gmail.com> wrote:

> hi sonali
>  you install sql libray in your project package then edit the setting.py
> file at django framework with database .
> I hope your problem will be solve...
>
> On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne 
> wrote:
>
>> Hi,
>> I have tried a lot to change Django back-end as MySQL but not able to
>> achieve this.
>> please help for the same.
>>
>> thanks in advance. :)
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAHjM6E5Ky9BDUFi4V887V%2BkMasb6%2BZJ8V7nHKCYqgeUAun0FQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django : Change Backend as mysql and create sample example using django ORM

2018-08-28 Thread parmeshwar deharkar
hi sonali
 you install sql libray in your project package then edit the setting.py
file at django framework with database .
I hope your problem will be solve...

On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne 
wrote:

> Hi,
> I have tried a lot to change Django back-end as MySQL but not able to
> achieve this.
> please help for the same.
>
> thanks in advance. :)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFyF%2BQg5LcYkXWygyhdu03ciqYUBMifNBWnS923Mstq8jfTnLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Django : Change Backend as mysql and create sample example using django ORM

2018-08-28 Thread Sonali Vighne
s\MySQLdb\connections.py",
 line 277, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right 
syntax to use near '(6) NOT NULL)' at line 1")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\EclipsePython\DjangoMysql\manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py",
 line 381, in execute_from_command_line
utility.execute()
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\__init__.py",
 line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 line 316, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 line 353, in execute
output = self.handle(*args, **options)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 line 83, in wrapped
res = handle_func(*args, **kwargs)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\migrate.py",
 line 203, in handle
fake_initial=fake_initial,
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\executor.py",
 line 91, in migrate
self.recorder.ensure_schema()
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
 line 57, in ensure_schema
raise MigrationSchemaMissing("Unable to create the django_migrations table 
(%s)" % exc)
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the 
django_migrations table ((1064, "You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near '(6) NOT NULL)' at line 1"))
Finished "D:\EclipsePython\DjangoMysql\manage.py migrate" execution.





Setting.py


INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mysqlApp' #this is app created
]


DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.mysql',
'NAME': 'hospital',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '3306'
}
}


From: django-developers@googlegroups.com  
On Behalf Of Raghavendrachari k
Sent: 27 August 2018 18:02
To: django-developers@googlegroups.com
Subject: Re: Django : Change Backend as mysql and create sample example using 
django ORM

if you explain briefly what is the issue you are facing , then we can can 
answer you !
Thanks
Raghav

On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne 
mailto:sonalivig...@gmail.com>> wrote:
Hi,
I have tried a lot to change Django back-end as MySQL but not able to achieve 
this.
please help for the same.

thanks in advance. :)


--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-developers@googlegroups.com<mailto:django-developers@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com<https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-developers@googlegroups.com<mailto:django-developers@googlegroups.com>.
Visit this group at https://groups.google.com/group/d

Re: Django : Change Backend as mysql and create sample example using django ORM

2018-08-27 Thread Tim Graham
This list is dedicated to the discussion of developing Django itself, not 
answering usage questions. You might try the django-users group (
https://groups.google.com/forum/#!forum/django-users), or StackOverflow.

On Monday, August 27, 2018 at 9:41:30 AM UTC-4, Raghavendrachari k wrote:
>
> if you explain briefly what is the issue you are facing , then we can can 
> answer you !
> Thanks
> Raghav
>
> On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne  > wrote:
>
>> Hi,
>> I have tried a lot to change Django back-end as MySQL but not able to 
>> achieve this. 
>> please help for the same.
>>
>> thanks in advance. :) 
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com .
>> To post to this group, send email to django-d...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4b2a303e-5e3b-453b-926f-1b386d2d7f39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django : Change Backend as mysql and create sample example using django ORM

2018-08-27 Thread Raghavendrachari k
if you explain briefly what is the issue you are facing , then we can can
answer you !
Thanks
Raghav

On Mon, Aug 27, 2018 at 4:54 PM Sonali Vighne 
wrote:

> Hi,
> I have tried a lot to change Django back-end as MySQL but not able to
> achieve this.
> please help for the same.
>
> thanks in advance. :)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/2c673679-4532-4147-a072-5b712b62a621%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAHjM6E5aibbR%3DjcsrESHskJaxDd8w6qWMZjojhQ16z2W4PLSUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.