Re: Can we make 1 function to check the objects need update and update them

2018-08-29 Thread Anirudh choudhary
I have read it already and the best I found from the documentation is the 
signals but signals only save when save command is given and it is manually 

On Thursday, August 30, 2018 at 12:19:17 PM UTC+5:30, Mikhailo Keda wrote:
>
> Check Django documentation https://docs.djangoproject.com/en/2.1/
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7968bced-1a38-442f-93d8-9469a9fff5ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with mi first hello world please problems with urls

2018-08-29 Thread ireoluwa fakeye
Why are you returning  a string into the response ,there are different
approaches  to this .

On Thu, 30 Aug 2018, 07:36 Anirudh choudhary, 
wrote:

> if you understand English then use include() in your mysite.urls.py
> which is in from django.urls import include
>
> On Wednesday, August 22, 2018 at 10:31:19 PM UTC+5:30, Dario Coronel wrote:
>>
>> El problema que tengo es el siguiente soy un novato recien conociendo el
>> mundo de python y django estaba siguiendo los pasos de la documentacion
>> para crear una primera aplicacion consegui instalr django y craer con
>> startproject un projecti inicial sin problemas, mi primer problema se
>> presenta cuando configuro las urls al crear con el $python manage.py
>> startapp polls dichos archivos sigo los pasos hasta donde en el archivo
>> polls/views.py  se incrusta el siguiente codigo
>>
>>
>> polls/views.py
>>  from django.http import HttpResponse
>>
>>
>> def index(request):
>> return HttpResponse("Hello, world. You're at the polls index.")
>>
>> luego sigue
>> crear un archivo urls.py en el mismo directorio
>>
>> polls/
>> __init__.py
>> admin.py
>> apps.py
>> migrations/
>> __init__.py
>> models.py
>> tests.py
>> urls.py
>> views.py
>>
>>
>> luego sigue incrustar el codigo en el archivo
>>
>>
>> polls/urls.py
>>
>> from django.urls import path
>> from . import views
>>
>> urlpatterns = [
>> path('', views.index, name='index'),
>> ]
>>
>> seguido de agregar el siguiente codigo al siguiente directorio
>>
>> mysite/urls.py
>>
>> from django.contrib import admin
>> from django.urls import include, path
>>
>> urlpatterns = [
>> path('polls/', include('polls.urls')),
>> path('admin/', admin.site.urls),
>> ]
>>
>>
>> De ahi en teoria al ejecutar en la consola $python manage.py runserver 
>> debria de poder ver el hola mundo y solo me da el error de
>>
>> Not Found
>>
>> The requested URL / was not found on this server.
>>
>>
>>
>> cual seria mi error agradecreia mucho una ayuda.
>>
>> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fb4c03f1-8d23-4ca0-bb11-b0a0a9ba1145%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO87g12nttWapXy%2BK19wWNmiyiAh0o-1rcVMUrELM%3Dc6VtJJbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can we make 1 function to check the objects need update and update them

2018-08-29 Thread Mikhailo Keda
Check Django documentation https://docs.djangoproject.com/en/2.1/

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e1366fd-fa39-4302-a8da-98cfec2c3c2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with mi first hello world please problems with urls

2018-08-29 Thread Anirudh choudhary
if you understand English then use include() in your mysite.urls.py 
which is in from django.urls import include

On Wednesday, August 22, 2018 at 10:31:19 PM UTC+5:30, Dario Coronel wrote:
>
> El problema que tengo es el siguiente soy un novato recien conociendo el 
> mundo de python y django estaba siguiendo los pasos de la documentacion 
> para crear una primera aplicacion consegui instalr django y craer con 
> startproject un projecti inicial sin problemas, mi primer problema se 
> presenta cuando configuro las urls al crear con el $python manage.py 
> startapp polls dichos archivos sigo los pasos hasta donde en el archivo 
> polls/views.py  se incrusta el siguiente codigo 
>
>
> polls/views.py
>  from django.http import HttpResponse
>
>
> def index(request):
> return HttpResponse("Hello, world. You're at the polls index.")
>
> luego sigue
> crear un archivo urls.py en el mismo directorio
>
> polls/
> __init__.py
> admin.py
> apps.py
> migrations/
> __init__.py
> models.py
> tests.py
> urls.py
> views.py
>
>
> luego sigue incrustar el codigo en el archivo
>
>
> polls/urls.py
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('', views.index, name='index'),
> ]
>
> seguido de agregar el siguiente codigo al siguiente directorio
>
> mysite/urls.py
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> De ahi en teoria al ejecutar en la consola $python manage.py runserver debria 
> de poder ver el hola mundo y solo me da el error de 
>
> Not Found
>
> The requested URL / was not found on this server.
>
>
>
> cual seria mi error agradecreia mucho una ayuda.
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fb4c03f1-8d23-4ca0-bb11-b0a0a9ba1145%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Base Views error importing articles.models

2018-08-29 Thread Anirudh choudhary
this error means that the module articles is not in the articels and file 
name models. you may be getting this error because of spelling 

On Monday, August 27, 2018 at 7:05:43 PM UTC+5:30, Sandy Leon wrote:
>
> Hello everyone,
>
> I am trying to add another simple 'home' page to my website which is at 
> this point
> just the basic site after you finish the tutorial. I am following the 
> 'Base Views' documentation but keep getting an error when trying to import 
> 'from articles.models import Articles' the error 
> reads ModuleNotFoundError: No module named 'articles'
>
> Any help with this would be greatly appreciated!
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ae5a5ba3-a67f-4093-b8b7-164c7f96d265%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can we make 1 function to check the objects need update and update them

2018-08-29 Thread Anirudh choudhary
I am Writing the program which will collect all the content and display it 
and I want this to be robust but i am not able to find in documentation 
related this 

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a46800f-9c74-4b50-af0e-0542224f3f49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-08-29 Thread Sonali Vighne
MySQL  version-  6.0.8-alpha-community

On Wednesday, August 29, 2018 at 7:26:09 PM UTC+5:30, Tom Forbes wrote:
>
> What version of MySQL are you running? 
>
> On Tuesday, 28 August 2018 07:00:52 UTC+1, Sonali Vighne wrote:
>>
>> I will paste full error and stack trace here.
>>
>> This is occurred when I am giving “python manage.py migrate” command
>>
>>  
>>
>> Operations to perform:
>>
>>   Apply all migrations: admin, auth, contenttypes, sessions
>>
>> Running migrations:
>>
>> Traceback (most recent call last):
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 83, in _execute*
>>
>> return self.cursor.execute(sql)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>  
>> line 71, in execute*
>>
>> return self.cursor.execute(query, args)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 250, in execute*
>>
>> self.errorhandler(self, exc, value)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> line 50, in defaulterrorhandler*
>>
>> raise errorvalue
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 247, in execute*
>>
>> res = self._query(query)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 411, in _query*
>>
>> rowcount = self._do_query(q)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 374, in _do_query*
>>
>> db.query(q)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> line 277, in query*
>>
>> _mysql.connection.query(self, query)
>>
>> _mysql_exceptions.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")
>>
>>  
>>
>> The above exception was the direct cause of the following exception:
>>
>>  
>>
>> Traceback (most recent call last):
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
>>  
>> line 55, in ensure_schema*
>>
>> editor.create_model(self.Migration)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>  
>> line 312, in create_model*
>>
>> self.execute(sql, params or None)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>  
>> line 133, in execute*
>>
>> cursor.execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 100, in execute*
>>
>> return super().execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 68, in execute*
>>
>> return self._execute_with_wrappers(sql, params, many=False, 
>> executor=self._execute)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 77, in _execute_with_wrappers*
>>
>> return executor(sql, params, many, context)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 85, in _execute*
>>
>> return self.cursor.execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\utils.py",
>>  
>> line 89, in __exit__*
>>
>> raise dj_exc_value.with_traceback(traceback) from exc_value
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 83, in _execute*
>>
>> return self.cursor.execute(sql)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>  
>> line 71, in execute*
>>
>> return self.cursor.execute(query, args)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 250, in execute*
>>
>> self.errorhandler(self, exc, value)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> line 50, in defaulterrorhandler*
>>
>> raise errorvalue
>>
>>   *File 
>> "C:\U

Re: Searchable dropdown from models

2018-08-29 Thread Mark Phillips
If I understand your question, there are many different django projects
that offer a solution to "autocomplete" in a form.

https://djangopackages.org/grids/g/auto-complete/

Or, you can roll your own with the addition of some Javascript.
Autocomplete is not a "built-in" function withing the django framework.

Hope this helps!

Mark

On Wed, Aug 29, 2018 at 1:02 PM, ah  wrote:

>  Hi,
> I am trying to create a searchable dropdown list  based on Django's model.
> I have a model M that has 6 objects [apple,orange,carrot,banana,
> kiwi,peach].
> I want to create a view that will have a search box like a html datalist.
> when user types in "app" -- apple should show in dropbox list. then as user
> clicks on apple, the form should send id of object apple to the view.
>
> I am using forms.py with
> forms.ModelChoiceField(queryset=M.objects.all()
>
> which gives me a dropdown list. But i am unable to implement a search box.
> Not much documentation is found online about this issue. Is there a better
> approach?
>
> Thanks
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/f03463ee-3b09-4097-b2e3-cfff6d9fa255%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEqej2Of1e67iiz1yvta3WpZi3MNSjkx5%2BGQLOA_xKeLUYbvCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to make https work in django REST framework on runserver port

2018-08-29 Thread Kasper Laudrup

Hi Rupam,

On 29/08/2018 17.44, Rupam Hazra wrote:

I want to do on production but how .
could you elaborate me because i am new in python



You shouldn't be using the development server in production. That is 
quite clearly stated in the documentation for good reasons.


You could set up a web server that forwards HTTPS requests to the Django 
development server, but that would require pretty much the same amount 
of work as doing it the proper way and set up your Django app as WSGI 
application as explained here:


https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/

Please just follow that guide instead.

Kind regards,

Kasper Laudrup

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c286e004-8007-1c62-92ec-1495a9e7b0bd%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Searchable dropdown from models

2018-08-29 Thread ah
 Hi,
I am trying to create a searchable dropdown list  based on Django's model. 
I have a model M that has 6 objects [apple,orange,carrot,banana,kiwi,peach].
I want to create a view that will have a search box like a html datalist. 
when user types in "app" -- apple should show in dropbox list. then as user 
clicks on apple, the form should send id of object apple to the view.

I am using forms.py with 
forms.ModelChoiceField(queryset=M.objects.all()

which gives me a dropdown list. But i am unable to implement a search box. 
Not much documentation is found online about this issue. Is there a better 
approach?

Thanks

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f03463ee-3b09-4097-b2e3-cfff6d9fa255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Subdomains in Version 2.1.7

2018-08-29 Thread Abednego Ng'ang'a
In what file exactly I'm I supposed to place that import?


On Wed, 29 Aug 2018 at 17:37, Tim Graham  wrote:

> Starting in Django 2.0, "The django.core.urlresolvers module is removed
> in favor of its new location, django.urls."
>
> Use from django.urls import reverse as simple_reverse
>
> On Wednesday, August 29, 2018 at 9:56:09 AM UTC-4, Abednego Ng'ang'a wrote:
>>
>> I've followed the procedure of installing subdomains according to
>> https://django-subdomains.readthedocs.io/en/latest/ but when I try
>> python3 manage.py runserver
>>
>> I get the error
>>
>> ModuleNotFoundError: No module named 'django.core.urlresolvers'
>>
>> What would be the problem?
>>
>> django-admin version => 2.1.7
>> OS platform => Kali Linux
>>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3ddbbc84-23ce-4502-923a-c15613376415%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHhweXbjOcncbaevE0Uc4QZesT-8tAfJn1aDCshwqEB8Uu2tQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trying to replace a char field with a forgein key feild

2018-08-29 Thread 'Matthew Stroud' via Django users
Thanks for the reply.

Sadly in the process of me messing around with, I somehow fixed it. I'm not 
sure how, but when I get a chance I'll look through my changes and see what did 
it.

In the meantime, I'm going to claim user error until I can figure it out.

Thanks,
Matthew Stroud

On 8/29/18, 5:33 AM, "django-users@googlegroups.com on behalf of Michal 
Petrucha"  wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Mon, Aug 27, 2018 at 09:37:03AM -0700, mattstroud via Django users wrote:
> So when we started the database, it was good enough to have a char field
> with choices. But as time progressed I need to convert that field to a
> foreign key field. The follow I'm trying to take is such:
>
>
>1. rename  to tmp_
>2. create a new field with 
>3. have a RunPython fill the data for 
>4. delete field tmp_
>
> I can get steps 1 through 3 to work with out issue. But once I remove the
> old field from the code, the migration breaks because the field no longer
> exists (which makes sense). I'm curious if there is a way to work around
> this, because my googling is coming up empty.

I'm not following – why would the migration break? What part of it
would break, and how? None of what you wrote suggests that this should
in any way fail, as long as operations 1, 2, and 4 are performed with
AlterField, AddField, and RemoveField, and you use model classes
passed into RunPython through the ``apps`` argument.

Could you perhaps provide some more details about the failure that
you're experiencing?

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJbhoRCAAoJEHA7T/IPM/klbKAQAJrCF9WNMOOsaWc3V/5PzNN3
quKafkPijxOkSl3AlLcPE6Os/2gPAc7rQZ+jKIorkXP6/RTh1U2DgGzYhLxeEzJL
tcS8cTtfsRx50En7Rbq9MnvQd/3G/xbEPaPzIp7moB1R0z7DY6uJoY39hpeJltd4
D2OVBwtryKs3r98B2PsQuwA5m7i8qy14LzosK1TQUGeUzEwINzaGQdt07aI24hpE
XJtfkUMXk7v8t3OuEPaSNCabfK0bGhV8WYRFj1JKUONrKhTl7RCXXBpmDahH2M5P
zInUKwChxa6zOwCpZ8tgoj2NSB0xlWSBzCZPV6LXiUvy7bPIJ9N64MBbIP9ntsEL
5ozGwE8oSmVpdDAlGY8IdwnJdgJzemRokD1z2PKo4zJViDrDxdOB4dVmrJ/FjrH6
cYe022N8iHHVx9aAtMXyuitfRzcNukpUTiyXPDji3XeUAxjmR3/sezWXiCA0iDua
vc3mytzQldPw2t7E9q0a/Q4QvFAh42ALzpZzZwdVmx81j3CGbbF6GiWuYiL/xYUc
bTt9RsEAFiNiDXWXiljf94ZwDQaAd+sHCwHP+zleHHKQ4n2iAZrb+Cy4vq2uNpGi
hZRAmIgOkqcN4kaD4wnImYigydSVgJ1AtL+MTcIgm8U06uSTicjRs67+RWvmvS6G
bpaFyP2KsdzU58s0sTTA
=LaQQ
-END PGP SIGNATURE-

--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20180829113220.GV1181%40konk.org.
For more options, visit https://groups.google.com/d/optout.





CONFIDENTIALITY NOTICE: This message is intended only for the use and review of 
the individual or entity to which it is addressed and may contain information 
that is privileged and confidential. If the reader of this message is not the 
intended recipient, or the employee or agent responsible for delivering the 
message solely to the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify 
sender immediately by telephone or return email. Thank you.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/43F2B1B1-ACAA-4E51-8FD6-543B8D323EE9%40overstock.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to make https work in django REST framework on runserver port

2018-08-29 Thread Rupam Hazra
@jason,

I want to do on production but how .
could you elaborate me because i am new in python

On Wednesday, 29 August 2018 17:09:34 UTC+5:30, Jason wrote:
>
> for local development, why do you need https?  for staging and production, 
> you should be using apache with mod_wsgi or nginx with uwsgi/gunicorn
>
> On Wednesday, August 29, 2018 at 7:16:15 AM UTC-4, Rupam Hazra wrote:
>>
>>
>> Hi, i am working django rest service using runserver on different port on 
>> http but i want to use the https service.
>>
>> Please help.
>>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9dc24703-b360-4fc0-9ba3-8b05d32253d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-08-29 Thread sankar ardhas
Hi all,
Thanks for your response.

On Wed, Aug 29, 2018, 9:08 PM Jani Tiainen  wrote:

> Hi,
>
> Django Girls do have excellent tutorial which also does have very detailed
> setup guide.
>
>
> ke 29. elok. 2018 klo 14.16 sankar ardhas 
> kirjoitti:
>
>> Hi all,
>>  I am a web developer in laravel and codeigniter php web
>> frameworks. I want to learn how to build web application  with django
>> framework. I have ubuntu platform in my comuputer. I want installation
>> steps for django and example also .. Can you help me?
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/18094a65-7e19-4f8d-8376-69174ee4c4cb%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 users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91of30tRAxzZvnvDCL1u5PE9MLAaLXiV24eXnYvqjNZUDsA%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAzT%2Bs6Xi5f5PNoEPsJUqL1wpUWqwe%3DW9mz-K5Gw4ZnvYJAN2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-08-29 Thread Jani Tiainen
Hi,

Django Girls do have excellent tutorial which also does have very detailed
setup guide.


ke 29. elok. 2018 klo 14.16 sankar ardhas 
kirjoitti:

> Hi all,
>  I am a web developer in laravel and codeigniter php web
> frameworks. I want to learn how to build web application  with django
> framework. I have ubuntu platform in my comuputer. I want installation
> steps for django and example also .. Can you help me?
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/18094a65-7e19-4f8d-8376-69174ee4c4cb%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91of30tRAxzZvnvDCL1u5PE9MLAaLXiV24eXnYvqjNZUDsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Mysql Error : Unknown system variable 'innodb_strict_mode

2018-08-29 Thread Jason
you shouldn't need to set the storage engine to innodb

https://docs.djangoproject.com/en/2.1/ref/databases/#storage-engines

MySQL’s default storage engine is InnoDB 
. This 
engine is fully transactional and supports foreign key references. It’s the 
recommended choice.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed6092f3-0fb7-4731-8d7f-b5cb660de7fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can anyone please help me solve this question?

2018-08-29 Thread Anirudh Jain
Here is the question that I posted earlier yesterday and it is still 
unsolved

https://stackoverflow.com/questions/52054246/how-to-add-a-foreign-key-from-multiple-options-available-in-model-for-that-key-i

It is very urgent for me to solve this question and this is the last part 
where I am stuck while building a product. Please help me solve the 
question.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/631e032c-108e-4034-8a65-a8bb403c18c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Subdomains in Version 2.1.7

2018-08-29 Thread Tim Graham
Starting in Django 2.0, "The django.core.urlresolvers module is removed in 
favor of its new location, django.urls."

Use from django.urls import reverse as simple_reverse

On Wednesday, August 29, 2018 at 9:56:09 AM UTC-4, Abednego Ng'ang'a wrote:
>
> I've followed the procedure of installing subdomains according to 
> https://django-subdomains.readthedocs.io/en/latest/ but when I try 
> python3 manage.py runserver
>
> I get the error 
>
> ModuleNotFoundError: No module named 'django.core.urlresolvers'
>
> What would be the problem?
>
> django-admin version => 2.1.7
> OS platform => Kali Linux
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3ddbbc84-23ce-4502-923a-c15613376415%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-08-29 Thread Tom Forbes
What version of MySQL are you running? 

On Tuesday, 28 August 2018 07:00:52 UTC+1, Sonali Vighne wrote:
>
> I will paste full error and stack trace here.
>
> This is occurred when I am giving “python manage.py migrate” command
>
>  
>
> Operations to perform:
>
>   Apply all migrations: admin, auth, contenttypes, sessions
>
> Running migrations:
>
> Traceback (most recent call last):
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 83, in _execute*
>
> return self.cursor.execute(sql)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>  
> line 71, in execute*
>
> return self.cursor.execute(query, args)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 250, in execute*
>
> self.errorhandler(self, exc, value)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 50, in defaulterrorhandler*
>
> raise errorvalue
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 247, in execute*
>
> res = self._query(query)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 411, in _query*
>
> rowcount = self._do_query(q)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 374, in _do_query*
>
> db.query(q)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 277, in query*
>
> _mysql.connection.query(self, query)
>
> _mysql_exceptions.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")
>
>  
>
> The above exception was the direct cause of the following exception:
>
>  
>
> Traceback (most recent call last):
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
>  
> line 55, in ensure_schema*
>
> editor.create_model(self.Migration)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>  
> line 312, in create_model*
>
> self.execute(sql, params or None)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>  
> line 133, in execute*
>
> cursor.execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 100, in execute*
>
> return super().execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 68, in execute*
>
> return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 77, in _execute_with_wrappers*
>
> return executor(sql, params, many, context)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 85, in _execute*
>
> return self.cursor.execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\utils.py",
>  
> line 89, in __exit__*
>
> raise dj_exc_value.with_traceback(traceback) from exc_value
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 83, in _execute*
>
> return self.cursor.execute(sql)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>  
> line 71, in execute*
>
> return self.cursor.execute(query, args)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 250, in execute*
>
> self.errorhandler(self, exc, value)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 50, in defaulterrorhandler*
>
> raise errorvalue
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 247, in execute*
>
> res = self._query(query)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 411, in

Using Subdomains in Version 2.1.7

2018-08-29 Thread Abednego Ng'ang'a
I've followed the procedure of installing subdomains according to 
https://django-subdomains.readthedocs.io/en/latest/ but when I try 
python3 manage.py runserver

I get the error 
from django.core.urlresolvers import reverse as simple_reverse
ModuleNotFoundError: No module named 'django.core.urlresolvers'

What would be the problem?

django-admin version => 2.1.7
OS platform => Kali Linux

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/11636815-6d35-43a2-ad9b-fa130e70fa4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-08-29 Thread Tim Graham
MySQL 6.0? I've never seen such a version... maybe that's the issue. Django 
2.1 should work with MySQL 5.6, 5.7, and 8.0.

On Wednesday, August 29, 2018 at 8:58:50 AM UTC-4, Sonali Vighne wrote:
>
> Django - 2.1
> mysql  community server -  6.0.8
> mysqlclient - mysqlclient   1.3.12
>
> On Wednesday, August 29, 2018 at 6:24:05 PM UTC+5:30, Tim Graham wrote:
>>
>> What version of Django, MySQL, and mysqlclient are you using?
>>
>> On Tuesday, August 28, 2018 at 2:00:52 AM UTC-4, Sonali Vighne wrote:
>>>
>>> I will paste full error and stack trace here.
>>>
>>> This is occurred when I am giving “python manage.py migrate” command
>>>
>>>  
>>>
>>> Operations to perform:
>>>
>>>   Apply all migrations: admin, auth, contenttypes, sessions
>>>
>>> Running migrations:
>>>
>>> Traceback (most recent call last):
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 83, in _execute*
>>>
>>> return self.cursor.execute(sql)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>>  
>>> line 71, in execute*
>>>
>>> return self.cursor.execute(query, args)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>>  
>>> line 250, in execute*
>>>
>>> self.errorhandler(self, exc, value)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>>  
>>> line 50, in defaulterrorhandler*
>>>
>>> raise errorvalue
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>>  
>>> line 247, in execute*
>>>
>>> res = self._query(query)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>>  
>>> line 411, in _query*
>>>
>>> rowcount = self._do_query(q)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>>  
>>> line 374, in _do_query*
>>>
>>> db.query(q)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>>  
>>> line 277, in query*
>>>
>>> _mysql.connection.query(self, query)
>>>
>>> _mysql_exceptions.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")
>>>
>>>  
>>>
>>> The above exception was the direct cause of the following exception:
>>>
>>>  
>>>
>>> Traceback (most recent call last):
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
>>>  
>>> line 55, in ensure_schema*
>>>
>>> editor.create_model(self.Migration)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>>  
>>> line 312, in create_model*
>>>
>>> self.execute(sql, params or None)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>>  
>>> line 133, in execute*
>>>
>>> cursor.execute(sql, params)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 100, in execute*
>>>
>>> return super().execute(sql, params)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 68, in execute*
>>>
>>> return self._execute_with_wrappers(sql, params, many=False, 
>>> executor=self._execute)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 77, in _execute_with_wrappers*
>>>
>>> return executor(sql, params, many, context)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 85, in _execute*
>>>
>>> return self.cursor.execute(sql, params)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\utils.py",
>>>  
>>> line 89, in __exit__*
>>>
>>> raise dj_exc_value.with_traceback(traceback) from exc_value
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>>  
>>> line 83, in _execute*
>>>
>>> return self.cursor.execute(sql)
>>>
>>>   *File 
>>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>>  
>>> line 71, in execute*
>>>
>>> retur

Re: Deploying with apache2 and modwsgi

2018-08-29 Thread Joel Mathew
I surmised as much. But where does it go? Do you have a full working
configuration of the conf file?


On Wed, 29 Aug 2018 at 19:17, Jason  wrote:
>
> well, that's self-explainatory.  you have a bad config because that 
> WSGIPythonHome directive can't exist inside a VirtualHost section.
>
> On Wednesday, August 29, 2018 at 9:36:20 AM UTC-4, Joel wrote:
>>
>> I get this:
>>
>> Aug 29 12:24:52 localhost systemd[1]: Starting The Apache HTTP Server...
>> Aug 29 12:24:52 localhost apachectl[12718]: AH00526: Syntax error on
>> line 31 of /etc/apache2/sites-enabled/000-default.conf:
>> Aug 29 12:24:52 localhost apachectl[12718]: WSGIPythonHome cannot
>> occur within  section
>> Aug 29 12:24:52 localhost apachectl[12718]: Action 'start' failed.
>> Aug 29 12:24:52 localhost apachectl[12718]: The Apache error log may
>> have more information.
>> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Control process
>> exited, code=exited status=1
>> Aug 29 12:24:52 localhost systemd[1]: Failed to start The Apache HTTP Server.
>> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Unit entered
>> failed state.
>> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Failed with
>> result 'exit-code'.
>>
>> On Wed, 29 Aug 2018 at 17:12, Jason  wrote:
>> >
>> > just to cnfirm, are you using mod_wsgi3 for python3?
>> >
>> > and what do you get when you run apachectl configtest
>> >
>> > --
>> > 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 django-users...@googlegroups.com.
>> > To post to this group, send email to django...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/django-users.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/django-users/f290afe5-bd7c-467c-890b-e0faef16ad03%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 users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/9f2d7bed-9eb4-4bfa-bdee-5e1e5c52f6a6%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw__Ko31H3pr9_rqm3-S_1LzvdXQ5gR6BgtH5J4hxeazWYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying with apache2 and modwsgi

2018-08-29 Thread Jason
well, that's self-explainatory.  you have a bad config because that 
WSGIPythonHome directive can't exist inside a VirtualHost section.

On Wednesday, August 29, 2018 at 9:36:20 AM UTC-4, Joel wrote:
>
> I get this: 
>
> Aug 29 12:24:52 localhost systemd[1]: Starting The Apache HTTP Server... 
> Aug 29 12:24:52 localhost apachectl[12718]: AH00526: Syntax error on 
> line 31 of /etc/apache2/sites-enabled/000-default.conf: 
> Aug 29 12:24:52 localhost apachectl[12718]: WSGIPythonHome cannot 
> occur within  section 
> Aug 29 12:24:52 localhost apachectl[12718]: Action 'start' failed. 
> Aug 29 12:24:52 localhost apachectl[12718]: The Apache error log may 
> have more information. 
> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Control process 
> exited, code=exited status=1 
> Aug 29 12:24:52 localhost systemd[1]: Failed to start The Apache HTTP 
> Server. 
> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Unit entered 
> failed state. 
> Aug 29 12:24:52 localhost systemd[1]: apache2.service: Failed with 
> result 'exit-code'. 
>
> On Wed, 29 Aug 2018 at 17:12, Jason > 
> wrote: 
> > 
> > just to cnfirm, are you using mod_wsgi3 for python3? 
> > 
> > and what do you get when you run apachectl configtest 
> > 
> > -- 
> > 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 django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f290afe5-bd7c-467c-890b-e0faef16ad03%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f2d7bed-9eb4-4bfa-bdee-5e1e5c52f6a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying with apache2 and modwsgi

2018-08-29 Thread Joel Mathew
I get this:

Aug 29 12:24:52 localhost systemd[1]: Starting The Apache HTTP Server...
Aug 29 12:24:52 localhost apachectl[12718]: AH00526: Syntax error on
line 31 of /etc/apache2/sites-enabled/000-default.conf:
Aug 29 12:24:52 localhost apachectl[12718]: WSGIPythonHome cannot
occur within  section
Aug 29 12:24:52 localhost apachectl[12718]: Action 'start' failed.
Aug 29 12:24:52 localhost apachectl[12718]: The Apache error log may
have more information.
Aug 29 12:24:52 localhost systemd[1]: apache2.service: Control process
exited, code=exited status=1
Aug 29 12:24:52 localhost systemd[1]: Failed to start The Apache HTTP Server.
Aug 29 12:24:52 localhost systemd[1]: apache2.service: Unit entered
failed state.
Aug 29 12:24:52 localhost systemd[1]: apache2.service: Failed with
result 'exit-code'.

On Wed, 29 Aug 2018 at 17:12, Jason  wrote:
>
> just to cnfirm, are you using mod_wsgi3 for python3?
>
> and what do you get when you run apachectl configtest
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f290afe5-bd7c-467c-890b-e0faef16ad03%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-CWV%3DpTUU%2B5FZ6LoUks1foHyfW43yF49FwO%2BZQvgiYPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to filter choices in Django2's autocomplete_fields?

2018-08-29 Thread ciaran . courtney
Not possible ATM it seems, pity https://code.djangoproject.com/ticket/29010

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b7492c86-2a3e-4d29-9add-b90f5284b718%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-08-29 Thread Sonali Vighne
Django - 2.1
mysql  community server -  6.0.8
mysqlclient - mysqlclient   1.3.12

On Wednesday, August 29, 2018 at 6:24:05 PM UTC+5:30, Tim Graham wrote:
>
> What version of Django, MySQL, and mysqlclient are you using?
>
> On Tuesday, August 28, 2018 at 2:00:52 AM UTC-4, Sonali Vighne wrote:
>>
>> I will paste full error and stack trace here.
>>
>> This is occurred when I am giving “python manage.py migrate” command
>>
>>  
>>
>> Operations to perform:
>>
>>   Apply all migrations: admin, auth, contenttypes, sessions
>>
>> Running migrations:
>>
>> Traceback (most recent call last):
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 83, in _execute*
>>
>> return self.cursor.execute(sql)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>  
>> line 71, in execute*
>>
>> return self.cursor.execute(query, args)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 250, in execute*
>>
>> self.errorhandler(self, exc, value)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> line 50, in defaulterrorhandler*
>>
>> raise errorvalue
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 247, in execute*
>>
>> res = self._query(query)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 411, in _query*
>>
>> rowcount = self._do_query(q)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 374, in _do_query*
>>
>> db.query(q)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> line 277, in query*
>>
>> _mysql.connection.query(self, query)
>>
>> _mysql_exceptions.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")
>>
>>  
>>
>> The above exception was the direct cause of the following exception:
>>
>>  
>>
>> Traceback (most recent call last):
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
>>  
>> line 55, in ensure_schema*
>>
>> editor.create_model(self.Migration)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>  
>> line 312, in create_model*
>>
>> self.execute(sql, params or None)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>>  
>> line 133, in execute*
>>
>> cursor.execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 100, in execute*
>>
>> return super().execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 68, in execute*
>>
>> return self._execute_with_wrappers(sql, params, many=False, 
>> executor=self._execute)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 77, in _execute_with_wrappers*
>>
>> return executor(sql, params, many, context)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 85, in _execute*
>>
>> return self.cursor.execute(sql, params)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\utils.py",
>>  
>> line 89, in __exit__*
>>
>> raise dj_exc_value.with_traceback(traceback) from exc_value
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>>  
>> line 83, in _execute*
>>
>> return self.cursor.execute(sql)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>>  
>> line 71, in execute*
>>
>> return self.cursor.execute(query, args)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>>  
>> line 250, in execute*
>>
>> self.errorhandler(self, exc, value)
>>
>>   *File 
>> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>>  
>> l

Re: How to filter choices in Django2's autocomplete_fields?

2018-08-29 Thread ciaran . courtney
You need to override  ModelAdmin.get_search_results()  as per 
https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields

My problem is I override ForeignKeyField in AdminForm, where I can filter 
based on self.instance, this is not possible in current implementation 
AFAICS? The instance ID would have to be passed to the autocomplete_view

On Monday, 8 January 2018 16:49:56 UTC, Oren wrote:
>
> In Django 2.0, autocomplete_fields 
> 
>  was 
> added, which is great.
>
> Without autocomplete_fields, I can change the queryset of a 
> ForeignKeyField using formfield_for_foreignkey 
> 
> .
>
> But combining the two together doesn't work - it looks like the list of 
> options for autocomplete is dynamic and coming from a different url, 
> instead of from the current form.
>
> So the question is -
>
> How can I change the queryset in the autocomplete widget?
> Thanks,
> Oren
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f1b313c-82d6-454d-ba4e-85d7bbaa01c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-08-29 Thread Tim Graham
What version of Django, MySQL, and mysqlclient are you using?

On Tuesday, August 28, 2018 at 2:00:52 AM UTC-4, Sonali Vighne wrote:
>
> I will paste full error and stack trace here.
>
> This is occurred when I am giving “python manage.py migrate” command
>
>  
>
> Operations to perform:
>
>   Apply all migrations: admin, auth, contenttypes, sessions
>
> Running migrations:
>
> Traceback (most recent call last):
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 83, in _execute*
>
> return self.cursor.execute(sql)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>  
> line 71, in execute*
>
> return self.cursor.execute(query, args)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 250, in execute*
>
> self.errorhandler(self, exc, value)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 50, in defaulterrorhandler*
>
> raise errorvalue
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 247, in execute*
>
> res = self._query(query)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 411, in _query*
>
> rowcount = self._do_query(q)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 374, in _do_query*
>
> db.query(q)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 277, in query*
>
> _mysql.connection.query(self, query)
>
> _mysql_exceptions.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")
>
>  
>
> The above exception was the direct cause of the following exception:
>
>  
>
> Traceback (most recent call last):
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\migrations\recorder.py",
>  
> line 55, in ensure_schema*
>
> editor.create_model(self.Migration)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>  
> line 312, in create_model*
>
> self.execute(sql, params or None)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\base\schema.py",
>  
> line 133, in execute*
>
> cursor.execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 100, in execute*
>
> return super().execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 68, in execute*
>
> return self._execute_with_wrappers(sql, params, many=False, 
> executor=self._execute)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 77, in _execute_with_wrappers*
>
> return executor(sql, params, many, context)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 85, in _execute*
>
> return self.cursor.execute(sql, params)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\utils.py",
>  
> line 89, in __exit__*
>
> raise dj_exc_value.with_traceback(traceback) from exc_value
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
>  
> line 83, in _execute*
>
> return self.cursor.execute(sql)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
>  
> line 71, in execute*
>
> return self.cursor.execute(query, args)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 250, in execute*
>
> self.errorhandler(self, exc, value)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
>  
> line 50, in defaulterrorhandler*
>
> raise errorvalue
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
>  
> line 247, in execute*
>
> res = self._query(query)
>
>   *File 
> "C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cur

Django Mysql Error : Unknown system variable 'innodb_strict_mode

2018-08-29 Thread Sonali Vighne
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


setting.py


INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mysqlApp',
'django_mysql',
]



DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER': 'django_user',
'PASSWORD': 'root',
'HOST': 'localhost',
'PORT': '3306',
  'OPTIONS':{  
  'init_command': 'SET storage_engine=INNODB',
  },
 
}
}


below is traceback...


Traceback (most recent call last):
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 83, in _execute
return self.cursor.execute(sql)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\mysql\base.py",
 
line 71, in execute
return self.cursor.execute(query, args)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 250, in execute
self.errorhandler(self, exc, value)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
 
line 50, in defaulterrorhandler
raise errorvalue
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 247, in execute
res = self._query(query)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 411, in _query
rowcount = self._do_query(q)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\cursors.py",
 
line 374, in _do_query
db.query(q)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\MySQLdb\connections.py",
 
line 277, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1193, "Unknown system variable 
'innodb_strict_mode'")

The above exception was the direct cause of the following exception:

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 350, in execute
self.check()
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 379, in check
include_deployment_checks=include_deployment_checks,
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\commands\migrate.py",
 
line 60, in _run_checks
issues.extend(super()._run_checks(**kwargs))
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\management\base.py",
 
line 366, in _run_checks
return checks.run_checks(**kwargs)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\checks\registry.py",
 
line 71, in run_checks
new_errors = check(app_configs=app_configs)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django_mysql\checks.py",
 
line 23, in check_variables
@@character_set_connection""")
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 100, in execute
return super().execute(sql, params)
  File 
"C:\Users\sonali_vighne\AppData\Local\Programs\Python\Python36\lib\site-packages\django\db\backends\utils.py",
 
line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, 
executor=self._execute)
  File 
"C:\Users\sonali_v

Re: Cannot migrate database development changes to Live Database (Production)

2018-08-29 Thread Mikhailo Keda
Let me clarify, you added just one new model B that has a foreign key to 
existing model A and Django complains that A doesn't exist, right?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9a019a6-9b0b-416a-8d71-69367cd54aeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-08-29 Thread tamangsiddharth12
Please make sure you install latest django. I have also started working on 
django and used the django 2.0.2 version.  To install this you will need 
pip3 which is from python3. You can use django 2 versions.

On Wednesday, August 29, 2018 at 4:46:15 PM UTC+5:30, sankar ardhas wrote:
>
> Hi all,
>  I am a web developer in laravel and codeigniter php web 
> frameworks. I want to learn how to build web application  with django 
> framework. I have ubuntu platform in my comuputer. I want installation 
> steps for django and example also .. Can you help me?
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8e997707-26f8-4fb2-9aec-641a289c75fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying with apache2 and modwsgi

2018-08-29 Thread Jason
just to cnfirm, are you using mod_wsgi3 for python3?  

and what do you get when you run *apachectl configtest*

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f290afe5-bd7c-467c-890b-e0faef16ad03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to make https work in django REST framework on runserver port

2018-08-29 Thread Jason
for local development, why do you need https?  for staging and production, 
you should be using apache with mod_wsgi or nginx with uwsgi/gunicorn

On Wednesday, August 29, 2018 at 7:16:15 AM UTC-4, Rupam Hazra wrote:
>
>
> Hi, i am working django rest service using runserver on different port on 
> http but i want to use the https service.
>
> Please help.
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd1a7b25-b865-4c7b-b4cb-abb357c8f72c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create complex gin index in postgres db using django

2018-08-29 Thread Jason
you need to make a migration to apply the index.

https://www.endpoint.com/blog/2016/09/17/executing-custom-sql-in-django-migration

something like 

class Migration(migrations.Migration):

dependencies = [
('blog', '0001_initial'),
]

operations = [
migrations.RunSQL(
"CREATE INDEX pgweb_idx ON pgweb USING GIN 
(to_tsvector('english', title || ' ' || body));",
)
]

On Wednesday, August 29, 2018 at 7:16:15 AM UTC-4, Максим Родин wrote:
>
> Hello,
> I'm trying to make the text search index like this:
>
> https://www.postgresql.org/docs/current/static/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX
> :
> "CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', title 
> || ' ' || body));"
>
> I cannot imagine how to do it in django
> Here is my table:
>
> from django.contrib.postgres.indexes import GinIndex
> from django.contrib.postgres.search import SearchQuery
> from django.contrib.postgres.search import SearchVector
> import django.contrib.postgres.search as pg_search
>
>
> class Request(models.Model):
>
> open_date = models.DateTimeField(verbose_name='Creation Date',
>  blank=True)
> close_date = models.DateTimeField(verbose_name='Closing Date',
>   blank=True,
>   null=True,
>   )
>
>
> def in_work_time(self):
> return timezone.now() - self.open_date
>
>
> def set_open_time(self):
> self.open_date = timezone.now()
>
>
> subject = models.CharField(max_length=500,
>verbose_name='Request subject')
> author = models.CharField(max_length=500,
>   verbose_name='Request author')
> content = models.TextField(verbose_name='Request content')
> engineer = models.ForeignKey(User, on_delete=models.PROTECT,
>  blank=True,
>  verbose_name='Engineer assigned')
> priority = models.IntegerField(default=10,
>verbose_name='Priority')
>
>
> def __str__(self):
> return self.subject
>
>
> And here are my thoughts how it could look like.
> (It doesn't work):
>
> en_sv = pg_search.SearchVectorField(SearchVector(
> 'subject', 'content', config='english'), null=True)
> ru_sv = pg_search.SearchVectorField(SearchVector(
> 'subject', 'content', config='russian'), null=True)
>
>
> class Meta:
> indexes = [
> GinIndex(fields=['ru_sv'],
>  fastupdate=False, name='gin_search_ru_idx'),
> GinIndex(fields=['en_sv'],
>  fastupdate=False, name='gin_search_en_idx'),
>  ]
>
>
> Any thoughts?
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/101662a8-770b-4b39-8185-015c2f236656%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trying to replace a char field with a forgein key feild

2018-08-29 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Mon, Aug 27, 2018 at 09:37:03AM -0700, mattstroud via Django users wrote:
> So when we started the database, it was good enough to have a char field 
> with choices. But as time progressed I need to convert that field to a 
> foreign key field. The follow I'm trying to take is such:
> 
> 
>1. rename  to tmp_
>2. create a new field with 
>3. have a RunPython fill the data for 
>4. delete field tmp_
> 
> I can get steps 1 through 3 to work with out issue. But once I remove the 
> old field from the code, the migration breaks because the field no longer 
> exists (which makes sense). I'm curious if there is a way to work around 
> this, because my googling is coming up empty.

I'm not following – why would the migration break? What part of it
would break, and how? None of what you wrote suggests that this should
in any way fail, as long as operations 1, 2, and 4 are performed with
AlterField, AddField, and RemoveField, and you use model classes
passed into RunPython through the ``apps`` argument.

Could you perhaps provide some more details about the failure that
you're experiencing?

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJbhoRCAAoJEHA7T/IPM/klbKAQAJrCF9WNMOOsaWc3V/5PzNN3
quKafkPijxOkSl3AlLcPE6Os/2gPAc7rQZ+jKIorkXP6/RTh1U2DgGzYhLxeEzJL
tcS8cTtfsRx50En7Rbq9MnvQd/3G/xbEPaPzIp7moB1R0z7DY6uJoY39hpeJltd4
D2OVBwtryKs3r98B2PsQuwA5m7i8qy14LzosK1TQUGeUzEwINzaGQdt07aI24hpE
XJtfkUMXk7v8t3OuEPaSNCabfK0bGhV8WYRFj1JKUONrKhTl7RCXXBpmDahH2M5P
zInUKwChxa6zOwCpZ8tgoj2NSB0xlWSBzCZPV6LXiUvy7bPIJ9N64MBbIP9ntsEL
5ozGwE8oSmVpdDAlGY8IdwnJdgJzemRokD1z2PKo4zJViDrDxdOB4dVmrJ/FjrH6
cYe022N8iHHVx9aAtMXyuitfRzcNukpUTiyXPDji3XeUAxjmR3/sezWXiCA0iDua
vc3mytzQldPw2t7E9q0a/Q4QvFAh42ALzpZzZwdVmx81j3CGbbF6GiWuYiL/xYUc
bTt9RsEAFiNiDXWXiljf94ZwDQaAd+sHCwHP+zleHHKQ4n2iAZrb+Cy4vq2uNpGi
hZRAmIgOkqcN4kaD4wnImYigydSVgJ1AtL+MTcIgm8U06uSTicjRs67+RWvmvS6G
bpaFyP2KsdzU58s0sTTA
=LaQQ
-END PGP SIGNATURE-

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20180829113220.GV1181%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-08-29 Thread Joel Mathew
There are two steps:
Install pip,
Use pip to install django

Follow the tutorial: https://docs.djangoproject.com/en/2.1/intro/install/

On Wed, 29 Aug 2018 at 16:46, sankar ardhas  wrote:
>
> Hi all,
>  I am a web developer in laravel and codeigniter php web frameworks. 
> I want to learn how to build web application  with django framework. I have 
> ubuntu platform in my comuputer. I want installation steps for django and 
> example also .. Can you help me?
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/18094a65-7e19-4f8d-8376-69174ee4c4cb%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 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-FGJGPxcEgQjoVvFpRVqAi1aJgun%3DJqw0bKr0b7cKw4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Deploying with apache2 and modwsgi

2018-08-29 Thread Joel Mathew
After working with the development server for a month, I'm ready to
deploy to a VPS.
I've installed a debian9 environment and installed apache2 and
modwsgi. I'm having trouble editing the httpd.conf and apache wont
start with the added lines.

My project is at /home/joel/myappointments and the tree looks like this:
root@localhost:/home/joel/myappointments# tree -L 2
.
├── appointments
│   ├── admin.py
│   ├── apps.py
│   ├── forms.py
│   ├── migrations
│   ├── models.py
│   ├── __pycache__
│   ├── static
│   ├── templates
│   ├── tests.py
│   ├── urls.py
│   ├── using shell.txt
│   └── views.py
├── bugs.txt
├── db.sqlite3
├── django-todo.txt
├── manage.py
├── myappointments
│   ├── __init__.py
│   ├── middleware.py
│   ├── __pycache__
│   ├── settings.py
│   ├── settings.py~
│   ├── urls.py
│   └── wsgi.py
├── notebook.tex
├── propellor
│   ├── button.css
│   ├── floating-action-button.css
│   ├── materialicons.css
│   └── typography.css
├── README.md
├── requirements.txt
├── requirements.txt~
└── venv
├── bin
├── include
├── lib
└── pip-selfcheck.json

My apache conf is /home/joel/myappointments# cat
/etc/apache2/sites-enabled/000-default.conf:

# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

WSGIScriptAlias / /home/joel/myappointments/myappointments/wsgi.py
WSGIPythonHome /home/joel/myappointments/venv
WSGIPythonPath /home/joel/myappointments



Require all granted





# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


Can you tell me how to modify my apache conf file?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-ayMNk1CWkxQ7vaDwOwccC9t9hEXACF3Z20ifzgTg1Fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What would be the best way to implement a slider bar with django?

2018-08-29 Thread augustine tharakan
you can use post request using ajax to send the data to the server and when 
you reload the page the data can be read from the server.

For more info go to this link
https://ruddra.com/2015/09/17/sample-ajax-get-post-request-in-django/

On Wednesday, August 29, 2018 at 12:30:39 AM UTC+5:30, Geoffrey wrote:
>
> Hello,
>
> I'm a complete noob with django and web development in general, but I'm 
> trying to figure out how one would go about implementing widgets on my 
> website such a slider bars that can make use of the data stored in the 
> django databases. For example, if my database stores a bunch of values, I 
> might want to extract the minimum and maximum values and create a slider 
> bar with those values as the min and max.The user would select a value 
> using the slider and then the value would need to be saved to be used on 
> other pages. I've gotten a slider bar widget to work using jQuery code I 
> found online, but I'm not sure how I would connect this to the data being 
> stored within the django framework or if that would even be the right 
> strategy. Any tips you could give me would be extremely helpful!
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c739d4d3-de57-402a-be67-78cd1ac58036%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


new to django

2018-08-29 Thread sankar ardhas
Hi all,
 I am a web developer in laravel and codeigniter php web 
frameworks. I want to learn how to build web application  with django 
framework. I have ubuntu platform in my comuputer. I want installation 
steps for django and example also .. Can you help me?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/18094a65-7e19-4f8d-8376-69174ee4c4cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django website hosting

2018-08-29 Thread augustine tharakan
Checkout 
this 
https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html
 
(Credits to the Author)

On Saturday, August 25, 2018 at 8:06:08 PM UTC+5:30, ERICK OMONDI AYARA 
wrote:
>
> I would like to host a django project onto a web domain but cant seem to 
> get around it. i cant also find the python setup on the SOFTWARE section of 
> my file manager. Is there a way to do this? Thanks
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1e6d2f63-6ce2-425d-be48-d7054426afc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Cannot migrate database development changes to Live Database (Production)

2018-08-29 Thread Abhigyan Tiwari
Hi,

We had our first deployment recently. Later, we were in the development 
stage for a month on copy of the live database locally.
Today we tried to migrate the changes to the production database but were 
unable to due to table creation errors.

We are having a new table (model) with nullable foreign keys to others. 
When we try to migrate, it says table does not exist
on the production database.

Please help,
Thanks.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf9177b0-2955-4bd4-93c3-eb01b3fdc355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to make https work in django REST framework on runserver port

2018-08-29 Thread Rupam Hazra

Hi, i am working django rest service using runserver on different port on 
http but i want to use the https service.

Please help.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf1178a2-009b-4095-8420-da4e92e6fac3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to create complex gin index in postgres db using django

2018-08-29 Thread Максим Родин
Hello,
I'm trying to make the text search index like this:
https://www.postgresql.org/docs/current/static/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX:
"CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', title || 
' ' || body));"

I cannot imagine how to do it in django
Here is my table:

from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchQuery
from django.contrib.postgres.search import SearchVector
import django.contrib.postgres.search as pg_search


class Request(models.Model):

open_date = models.DateTimeField(verbose_name='Creation Date',
 blank=True)
close_date = models.DateTimeField(verbose_name='Closing Date',
  blank=True,
  null=True,
  )


def in_work_time(self):
return timezone.now() - self.open_date


def set_open_time(self):
self.open_date = timezone.now()


subject = models.CharField(max_length=500,
   verbose_name='Request subject')
author = models.CharField(max_length=500,
  verbose_name='Request author')
content = models.TextField(verbose_name='Request content')
engineer = models.ForeignKey(User, on_delete=models.PROTECT,
 blank=True,
 verbose_name='Engineer assigned')
priority = models.IntegerField(default=10,
   verbose_name='Priority')


def __str__(self):
return self.subject


And here are my thoughts how it could look like.
(It doesn't work):

en_sv = pg_search.SearchVectorField(SearchVector(
'subject', 'content', config='english'), null=True)
ru_sv = pg_search.SearchVectorField(SearchVector(
'subject', 'content', config='russian'), null=True)


class Meta:
indexes = [
GinIndex(fields=['ru_sv'],
 fastupdate=False, name='gin_search_ru_idx'),
GinIndex(fields=['en_sv'],
 fastupdate=False, name='gin_search_en_idx'),
 ]


Any thoughts?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/03077eeb-93bb-4991-a24b-f00fcaff0835%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.