Off-topic - venv problem in Windows 8.1

2017-12-04 Thread Mike Dewhirst
I did a pip freeze in a virtualenv and saw packages I should not have 
seen. So I checked sys.path as follows ...


C:\Users\mike\envs\xxct3\train>..\Scripts\activate

(xxct3) C:\Users\mike\envs\xxct3\train>python

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit 
(AMD64)] on win32


Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> sys.path

['', 'C:\\Python36\\python36.zip', 'C:\\Python36\\DLLs', 
'C:\\Python36\\lib', 'C:\\Python36', 'C:\\Python36\\lib\\site-packages']


>>>


... and it doesn't have C:\Users\mike\envs\xxct3\Lib\site-packages in 
the path!


Anyone know what I'm doing wrong?

Thanks

Mike

--
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/5e4adf5d-bb39-3f58-d18d-0ddd2c2f284f%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Constantine Covtushenko
Hi,

Can you please describe why you did not want to call author.save()
explicitly?
What is wrong with this approach?

Regards,
Constantine C.

On Mon, Dec 4, 2017 at 7:36 PM, Priyanka Thakur 
wrote:

> Hi,
>
>
> I want to create a bunch of objects that are interconnected in my  model
> (eg, one Book and one Author object) and then call save() on  the Book
> object to add everything to the database. In other words, I  don't want to
> save Author object explicitly.
>
> Example:
>
> class Author(models.Model):
>   name = models.CharField(max_length=255L, blank=True)
>
>
> class Book(models.Model):
> author = models.ForeignKey(Author)
>
>
> I want to do:
>
>
> author = Author('Robert Frost')
>
> book = Book(author)
>
> book.save()
>
> Can this be done in Django 1.10 ?
>
> Regards,
> Priyanka
>
> --
> 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/db02ab72-45a3-4f5d-a256-3a32bb4a35d7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sincerely yours,
Constantine C

-- 
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/CAK52boXJeP-ACPxWuY804ZE%2BvXnpiwu9DgBm9eAU0Dng%2BkPhfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Priyanka Thakur
Hi,


I want to create a bunch of objects that are interconnected in my  model 
(eg, one Book and one Author object) and then call save() on  the Book 
object to add everything to the database. In other words, I  don't want to 
save Author object explicitly.

Example:

class Author(models.Model):
  name = models.CharField(max_length=255L, blank=True)


class Book(models.Model):
author = models.ForeignKey(Author)


I want to do:


author = Author('Robert Frost')

book = Book(author)

book.save()

Can this be done in Django 1.10 ?   

Regards,
Priyanka

-- 
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/db02ab72-45a3-4f5d-a256-3a32bb4a35d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-channels - building JS websocket wrapper

2017-12-04 Thread Filbert
Duh, "npm run compile" Sorry.

On Monday, December 4, 2017 at 6:47:25 PM UTC-5, Filbert wrote:
>
> Probably just my lack of client-side/JavaScript knowledge, but when I 
> build the library:
>
>   git clone https://github.com/django/channels.git
>
>   cd channels/js_client
>
>   npm install browserify
>
>   npm install
>
>
> Probably just my lack of client-side/JavaScript knowledge, but when I 
> build the library and use the resulting lib/index.js file, I get:
>
>
> 'use strict';
>
>
> Object.defineProperty(exports, "__esModule", {    *Uncaught 
> ReferenceError: exports is not defined*
>
>   value: true
>
> });
>
> exports.WebSocketBridge = undefined;
>
>
> ...
>
>  
> 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/f71eb319-d974-4ea5-8643-54a6e7d04f0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-channels - building JS websocket wrapper

2017-12-04 Thread Filbert
Probably just my lack of client-side/JavaScript knowledge, but when I build 
the library:

  git clone https://github.com/django/channels.git

  cd channels/js_client

  npm install browserify

  npm install


Probably just my lack of client-side/JavaScript knowledge, but when I build 
the library and use the resulting lib/index.js file, I get:


'use strict';


Object.defineProperty(exports, "__esModule", {    *Uncaught 
ReferenceError: exports is not defined*

  value: true

});

exports.WebSocketBridge = undefined;


...

 
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/e0dec4c1-8f23-4f7e-9326-77d6b8072da3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to make a subscription form for use with Stripe / dj-stripe?

2017-12-04 Thread Daniel Grace
I have set up a Stripe account and installed dj-stripe, but I can't find 
information on how to set up a subscription form.  I understand that 
dj-stripe looks for a template in the djstripe directory, but I don't know 
what should be in the template.

-- 
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/db194ef1-96f7-4e5d-9c6e-994a808766be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Login

2017-12-04 Thread Che Sampat
hey and there is a really good youtube series made by a guy called max i 
will leave a link to his FREE course and guides you to build exactly what 
your asking for i HIGHLY suggest doing it

https://www.youtube.com/watch?v=Fc2O3_2kax8=PLw02n0FEB3E3VSHjyYMcFadtQORvl1Ssj

On Monday, December 4, 2017 at 5:49:32 PM UTC, chaitanya.creator wrote:
>
> Hi 
>  i am new users django .please help in making a login system using django 
> 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/82078fd8-13c6-4d21-9224-accee563b812%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need Help with Field Validation

2017-12-04 Thread Mark Phillips
I found my error after some more reading...The corrected
clean_storage_file_name(self)

def clean_storage_file_name(self):
current_data = self.instance
computed_sha256 =
compute_sha256(self.cleaned_data.get("storage_file_name"))
duplicates =
Document.objects.filter(computed_sha256__exact=computed_sha256)
for d in duplicates:
if (current_data.document_id != d.document_id):
# new document that is already in database, just updating
the information so save it.
raise forms.ValidationError("The image '%s' is already in
the database" % (self.cleaned_data.get("storage_file_name")))
return self.cleaned_data['storage_file_name']

I had to use self.instance to get the document_id of the object returned to
the form, and self.cleaned_data.get("") to access the other fields in
the returned data. No idea why, but it works now!

Can someone explain the difference between self.cleaned_data and
self.instance in a ModelForm?

Thanks!

Mark

On Sun, Dec 3, 2017 at 7:43 PM, Mark Phillips 
wrote:

> I have a model called Document that has a FileField for uploading files.
>
> class Document(models.Model):
> document_id = models.AutoField(primary_key=True)
> title = models.CharField('title', max_length=200)
> description = models.TextField('description')
> storage_file_name = models.FileField('File name',
> upload_to=unique_file_path)
> computed_sha256 = models.CharField(editable=False, max_length=64)
> .
>
> I am trying to validate the storage_file_name field in the Admin form. The
> validation logic is as follows:
>
> If there is another Document with the same computed_sha256, and this is a
> new Document, then raise a ValidationError.
>
> The tricky part is the "and this is a new Document".
>
> In the admin.py, I have a ModelForm called DocumentForm.
>
> class DocumentForm(forms.ModelForm):
> class Meta:
> model = Document
> fields = "__all__"
>
> def clean_storage_file_name(self):
> cleaned_data = self.cleaned_data
> computed_sha256 = compute_sha256(cleaned_data.
> get("storage_file_name"))
> duplicates = Document.objects.filter(computed_sha256__exact=
> computed_sha256)
> current_doc_id = cleaned_data.get('document_id')
> for d in duplicates:
> if (existing_doc_id != d.document_id):
> raise forms.ValidationError("The image '%s' is already in
> the database" % (cleaned_data.get("storage_file_name")))
> return self.cleaned_data['storage_file_name']
>
> The current_doc_id is always None, whether I am uploading a new file or I
> am editing a current file already in the database. I can read all the other
> document fields, but not the document_id field. If I am updating an
> existing document, then the current_document_id should exist and be equal
> to the d.document_id (the id of the document found in the search).
>
> I can't figure out why the current_document_id is always None. What am I
> missing here?
>
> How else can I block the ValidationError when I am merely updating another
> Document field, because that also returns a duplicate image based on the
> computed_sha256.
>
> Thanks!
>
> Mark
>
>
>
>

-- 
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/CAEqej2OzWMAMrCvOSvzAgjjReLdqy6jF_5HT%3DE4cehm49c6%2BgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Constraints across foreign keys

2017-12-04 Thread Rich Rauenzahn

Let's say I have:

class Restaurant(Model):
   pass

class Table(Model)
   restaurant = ForeignKey(Restaurant)

class Chair(Model)
   restaurant = ForeignKey(Restaurant)
   table = ForeignKey(Table)

Is there a best practice for ensuring that the chair assigned to a table is 
always from the same restaurant?  These models above assume that we might 
have spare chairs not yet assigned to tables.

My actual case is more like this:

class A(Model):
   pass

class B(Model):
   a = ForeignKey(A)

class C(Model):
   a = ForeignKey(A)

class D(Model):
   b = ForeignKey(B)
   c = ForeignKey(C)

And I want to ensure b.a == c.a.

(I think I just have to manually add db sql constraints in my migrations 
and also override save())

Are there any well supported / used django packages to manage this for me?  
This https://github.com/rapilabs/django-db-constraints looks promising, but 
is awfully quiet.

Rich


-- 
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/eea28a8f-4a73-4f74-a182-d6ade68a6737%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Login

2017-12-04 Thread Martin Peveri
Check this: 

https://simpleisbetterthancomplex.com/tutorial/2016/06/27/how-to-use-djangos-built-in-login-system.html

El lunes, 4 de diciembre de 2017, 14:49:32 (UTC-3), chaitanya.creator 
escribió:
>
> Hi 
>  i am new users django .please help in making a login system using django 
> 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/a4e6e3ef-d318-4ccd-8d1f-ae94540cf52d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RenameField with django 2.0: AttributeError: 'ManyToManyRel' object has no attribute 'field_name'

2017-12-04 Thread edigiacomo
Thanks Simon,
I've filed a new ticket https://code.djangoproject.com/ticket/28884

   Emanuele

On Monday, December 4, 2017 at 6:00:30 PM UTC+1, Simon Charette wrote:
>
> Hello there,
>
> This looks like a regression in Django 2.0 caused by 095c1aaa[0].
>
> Please file a new ticket mentioning it's a regression in Django 2.0
> and mark it as a release blocker. [1]
>
> Thanks,
> Simon
>
> [0] 
> https://github.com/django/django/commit/095c1aaa898bed40568009db836aa8434f1b983d
> [1] https://code.djangoproject.com/newticket
>
> Le lundi 4 décembre 2017 08:19:50 UTC-5, edigi...@arpae.it a écrit :
>>
>> With Django==2.0, a RenameField on a model which has a reverse many to 
>> many relationship raises an exception:
>>
>> AttributeError: 'ManyToManyRel' object has no attribute 'field_name'
>>
>> The same migration with Django==1.11 terminates successfully.
>>
>> Migrations are automatically generated by `manage.py makemigrations`.
>>
>> Am I missing something?
>>
>> Below the code and the commands to reproduce the problem:
>>
>> # myapp/models.py
>>
>> from django.db import models
>>
>>
>> class ModelA(models.Model):
>> new_name = models.IntegerField()
>>
>>
>> class ModelB(models.Model):
>> model_as = models.ManyToManyField('ModelA')
>>
>> # myapp/migrations/0001_initial.py
>>
>> from django.db import migrations, models
>>
>>
>> class Migration(migrations.Migration):
>>
>> initial = True
>>
>> dependencies = [
>> ]
>>
>> operations = [
>> migrations.CreateModel(
>> name='ModelA',
>> fields=[
>> ('id', models.AutoField(auto_created=True, 
>> primary_key=True, serialize=False, verbose_name='ID')),
>> ('old_name', models.IntegerField()),
>> ],
>> ),
>> migrations.CreateModel(
>> name='ModelB',
>> fields=[
>> ('id', models.AutoField(auto_created=True, 
>> primary_key=True, serialize=False, verbose_name='ID')),
>> ('model_as', models.ManyToManyField(to='myapp.ModelA')),
>> ],
>> ),
>> ]
>>
>> # myapp/migrations/0002_auto_20171204_1012.py
>>
>> from django.db import migrations
>>
>>
>> class Migration(migrations.Migration):
>>
>> dependencies = [
>> ('myapp', '0001_initial'),
>> ]
>>
>> operations = [
>> migrations.RenameField(
>> model_name='modela',
>> old_name='old_name',
>> new_name='new_name',
>> ),
>> ]
>>
>> $ ./manage.py migrate
>> Operations to perform:
>>   Apply all migrations: admin, auth, contenttypes, myapp, sessions
>> Running migrations:
>>   Applying contenttypes.0001_initial... OK
>>   Applying auth.0001_initial... OK
>>   Applying admin.0001_initial... OK
>>   Applying admin.0002_logentry_remove_auto_add... OK
>>   Applying contenttypes.0002_remove_content_type_name... OK
>>   Applying auth.0002_alter_permission_name_max_length... OK
>>   Applying auth.0003_alter_user_email_max_length... OK
>>   Applying auth.0004_alter_user_username_opts... OK
>>   Applying auth.0005_alter_user_last_login_null... OK
>>   Applying auth.0006_require_contenttypes_0002... OK
>>   Applying auth.0007_alter_validators_add_error_messages... OK
>>   Applying auth.0008_alter_user_username_max_length... OK
>>   Applying auth.0009_alter_user_last_name_max_length... OK
>>   Applying myapp.0001_initial... OK
>>   Applying myapp.0002_auto_20171204_1012...Traceback (most recent call 
>> last):
>>   File "./manage.py", line 15, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
>>  
>> line 371, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
>>  
>> line 365, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
>>  
>> line 288, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
>>  
>> line 335, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>>  
>> line 200, in handle
>> fake_initial=fake_initial,
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
>>  
>> line 117, in migrate
>> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
>> fake_initial=fake_initial)
>>   File 
>> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
>>  
>> line 147, in _migrate_all_forwards
>> state = self.apply_migration(state, migration, fake=fake, 
>> fake_initial=fake_initial)
>>   File 
>> 

Login

2017-12-04 Thread chaitanya.creator
Hi
 i am new users django .please help in making a login system using django
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/c76cbff9-1aa9-40c4-99bd-880ab57b2b38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting channels 2 to work

2017-12-04 Thread Andrew Godwin
Hi John,

The ProtocolTypeRouter currently does this for you automatically as long as
you don't specify a `http` handler. Otherwise, the ASGI application that
runs Django's view system is channels.http.AsgiHandler

Andrew

On Mon, Dec 4, 2017 at 7:56 AM, John Wayne  wrote:

> Hi Andrew,
>
> first of all thanks for your reply. With your answer and the information
> from your blog I was able to get my asgi application running.
>
> Now I want to route all http traffic to django's viewsystem back as i dont
> need channel's http handling. On your blog you posted this snippet
>
> application = ProtocolTypeRouter({
> "http": URLRouter([
> url("^", DjangoViewSystem),
> ]),
>
> But how should the DjangoViewSystem class look like? There is no such file
> included.
>
>
> John
>
> On Friday, December 1, 2017 at 6:22:06 PM UTC+1, Andrew Godwin wrote:
>>
>> Hi John,
>>
>> It's not in an end-user-useable state quite yet, so apologies for it
>> being hard to install. Crucially, the docs on ASGI_APPLICATION aren't
>> written yet as I'm still working on authentication stuff!
>>
>> A brief guide is:
>>
>>  - Make an asgi.py as specified in http://channels.readthedocs
>> .io/en/2.0/deploying.html
>>  - Make a channels.routing.ProtocolTypeRouter in your project's
>> routing.py and configure this as needed (you'll have to read the code for
>> now)
>>  - Point ASGI_APPLICATION to that root router.
>>
>> I'll have a lot more docs and stuff coming soon as I start prepping
>> Channels 2 for a beta release, which will include routing and setup
>> examples.
>>
>> Andrew
>>
>> On Fri, Dec 1, 2017 at 6:03 AM, John Wayne  wrote:
>>
>>> Hi everyone,
>>>
>>> I am stuck getting the new channels 2 to a working state. I installed
>>> django==2.0rc1,  and channels==2.0.x, daphne==2.0.x, asgiref==2.0.x from
>>> the git repo
>>> channels is enabled inside the settings.py. I also created the asgi.py
>>> file in the direcotry of the wsgi.py file acording to the docs. But still i
>>> get this error
>>>
>>> raise ImproperlyConfigured("Cannot find ASGI_APPLICATION setting.")
>>> django.core.exceptions.ImproperlyConfigured: Cannot find
>>> ASGI_APPLICATION setting.
>>>
>>> So it seems that ASGI_APPLICATION has to be specified. So after adding
>>> the following line:
>>> ASGI_APPLICATION='mytestproject.asgi.application'
>>> and starting ./manage.py runserver it now complains again. So which
>>> value is supposed to be there?
>>>
>>>   raise ImproperlyConfigured("Cannot find %r in ASGI_APPLICATION
>>> module %s" % (name, path))
>>> django.core.exceptions.ImproperlyConfigured: Cannot find 'application'
>>> in ASGI_APPLICATION module mytestproject.asgi
>>>
>>> I need to stick to version 2 as i want to try out asgigram (
>>> https://github.com/andrewgodwin/asgigram).
>>>
>>> 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...@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/ms
>>> gid/django-users/3c426628-13da-4ad3-8e4c-3e8938ab0c8d%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/22ceb8b4-e28e-4301-857a-3fffb211e5a9%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/CAFwN1uorrAVs5BBb%3DGvf487CP10To9o2TvbTt6aREVS4bbD9-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: RenameField with django 2.0: AttributeError: 'ManyToManyRel' object has no attribute 'field_name'

2017-12-04 Thread Simon Charette
Hello there,

This looks like a regression in Django 2.0 caused by 095c1aaa[0].

Please file a new ticket mentioning it's a regression in Django 2.0
and mark it as a release blocker. [1]

Thanks,
Simon

[0] 
https://github.com/django/django/commit/095c1aaa898bed40568009db836aa8434f1b983d
[1] https://code.djangoproject.com/newticket

Le lundi 4 décembre 2017 08:19:50 UTC-5, edigi...@arpae.it a écrit :
>
> With Django==2.0, a RenameField on a model which has a reverse many to 
> many relationship raises an exception:
>
> AttributeError: 'ManyToManyRel' object has no attribute 'field_name'
>
> The same migration with Django==1.11 terminates successfully.
>
> Migrations are automatically generated by `manage.py makemigrations`.
>
> Am I missing something?
>
> Below the code and the commands to reproduce the problem:
>
> # myapp/models.py
>
> from django.db import models
>
>
> class ModelA(models.Model):
> new_name = models.IntegerField()
>
>
> class ModelB(models.Model):
> model_as = models.ManyToManyField('ModelA')
>
> # myapp/migrations/0001_initial.py
>
> from django.db import migrations, models
>
>
> class Migration(migrations.Migration):
>
> initial = True
>
> dependencies = [
> ]
>
> operations = [
> migrations.CreateModel(
> name='ModelA',
> fields=[
> ('id', models.AutoField(auto_created=True, 
> primary_key=True, serialize=False, verbose_name='ID')),
> ('old_name', models.IntegerField()),
> ],
> ),
> migrations.CreateModel(
> name='ModelB',
> fields=[
> ('id', models.AutoField(auto_created=True, 
> primary_key=True, serialize=False, verbose_name='ID')),
> ('model_as', models.ManyToManyField(to='myapp.ModelA')),
> ],
> ),
> ]
>
> # myapp/migrations/0002_auto_20171204_1012.py
>
> from django.db import migrations
>
>
> class Migration(migrations.Migration):
>
> dependencies = [
> ('myapp', '0001_initial'),
> ]
>
> operations = [
> migrations.RenameField(
> model_name='modela',
> old_name='old_name',
> new_name='new_name',
> ),
> ]
>
> $ ./manage.py migrate
> Operations to perform:
>   Apply all migrations: admin, auth, contenttypes, myapp, sessions
> Running migrations:
>   Applying contenttypes.0001_initial... OK
>   Applying auth.0001_initial... OK
>   Applying admin.0001_initial... OK
>   Applying admin.0002_logentry_remove_auto_add... OK
>   Applying contenttypes.0002_remove_content_type_name... OK
>   Applying auth.0002_alter_permission_name_max_length... OK
>   Applying auth.0003_alter_user_email_max_length... OK
>   Applying auth.0004_alter_user_username_opts... OK
>   Applying auth.0005_alter_user_last_login_null... OK
>   Applying auth.0006_require_contenttypes_0002... OK
>   Applying auth.0007_alter_validators_add_error_messages... OK
>   Applying auth.0008_alter_user_username_max_length... OK
>   Applying auth.0009_alter_user_last_name_max_length... OK
>   Applying myapp.0001_initial... OK
>   Applying myapp.0002_auto_20171204_1012...Traceback (most recent call 
> last):
>   File "./manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 371, in execute_from_command_line
> utility.execute()
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 365, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 288, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 335, in execute
> output = self.handle(*args, **options)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>  
> line 200, in handle
> fake_initial=fake_initial,
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 117, in migrate
> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
> fake_initial=fake_initial)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 147, in _migrate_all_forwards
> state = self.apply_migration(state, migration, fake=fake, 
> fake_initial=fake_initial)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
>  
> line 244, in apply_migration
> state = migration.apply(state, schema_editor)
>   File 
> "/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/migration.py",
>  
> line 122, in apply
> 

Re: Password reset to Gmail addresses fails

2017-12-04 Thread Alastair Campbell
Jason wrote:

> what do you have for EMAIL_PORT and EMAIL_USE_TLS?  IIRC, gmail requires
> TLS to be True.
>

They are default (not set in the config). I believe the TLS is set by the
mail agent, and the email I sent from Mutt on the command line used TLS so
that appears to work.

Vivek wrote:
> Also, please check if "allow insure access" is turned on for GMail.

I'm confused, I'm not use a google app or hosting. My Django app is hosted
on a Debian box with a pretty standard setup, but email from Django through
Postfix to a Gmail inbox is not working...

-Alastair

-- 
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/CAC5%2BKCEaSSHm5a8G%3Dj3a1JHaRNzQ-PV48Gw%3DMtUEwZz4HY2VLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting channels 2 to work

2017-12-04 Thread John Wayne
Hi Andrew,

first of all thanks for your reply. With your answer and the information 
from your blog I was able to get my asgi application running. 

Now I want to route all http traffic to django's viewsystem back as i dont 
need channel's http handling. On your blog you posted this snippet

application = ProtocolTypeRouter({
"http": URLRouter([
url("^", DjangoViewSystem),
]),

But how should the DjangoViewSystem class look like? There is no such file 
included.


John

On Friday, December 1, 2017 at 6:22:06 PM UTC+1, Andrew Godwin wrote:
>
> Hi John,
>
> It's not in an end-user-useable state quite yet, so apologies for it being 
> hard to install. Crucially, the docs on ASGI_APPLICATION aren't written yet 
> as I'm still working on authentication stuff!
>
> A brief guide is:
>
>  - Make an asgi.py as specified in 
> http://channels.readthedocs.io/en/2.0/deploying.html
>  - Make a channels.routing.ProtocolTypeRouter in your project's routing.py 
> and configure this as needed (you'll have to read the code for now)
>  - Point ASGI_APPLICATION to that root router.
>
> I'll have a lot more docs and stuff coming soon as I start prepping 
> Channels 2 for a beta release, which will include routing and setup 
> examples.
>
> Andrew
>
> On Fri, Dec 1, 2017 at 6:03 AM, John Wayne  > wrote:
>
>> Hi everyone,
>>
>> I am stuck getting the new channels 2 to a working state. I installed 
>> django==2.0rc1,  and channels==2.0.x, daphne==2.0.x, asgiref==2.0.x from 
>> the git repo
>> channels is enabled inside the settings.py. I also created the asgi.py 
>> file in the direcotry of the wsgi.py file acording to the docs. But still i 
>> get this error
>>
>> raise ImproperlyConfigured("Cannot find ASGI_APPLICATION setting.")
>> django.core.exceptions.ImproperlyConfigured: Cannot find ASGI_APPLICATION 
>> setting.
>>
>> So it seems that ASGI_APPLICATION has to be specified. So after adding 
>> the following line:
>> ASGI_APPLICATION='mytestproject.asgi.application'
>> and starting ./manage.py runserver it now complains again. So which value 
>> is supposed to be there?
>>
>>   raise ImproperlyConfigured("Cannot find %r in ASGI_APPLICATION 
>> module %s" % (name, path))
>> django.core.exceptions.ImproperlyConfigured: Cannot find 'application' in 
>> ASGI_APPLICATION module mytestproject.asgi
>>
>> I need to stick to version 2 as i want to try out asgigram (
>> https://github.com/andrewgodwin/asgigram).
>>
>> 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...@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/3c426628-13da-4ad3-8e4c-3e8938ab0c8d%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/22ceb8b4-e28e-4301-857a-3fffb211e5a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset to Gmail addresses fails

2017-12-04 Thread Vivek Shrivastava
Also, please check if "allow insure access" is turned on for GMail.

On Mon, Dec 4, 2017 at 10:13 AM, Jason  wrote:

> what do you have for EMAIL_PORT and EMAIL_USE_TLS?  IIRC, gmail requires
> TLS to be True.
>
> --
> 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/1cfa944e-3fc5-447f-80f3-643520d4dba4%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/CAGaCEHuB4ARXqyM1ocjV8RAnA6NHjugzRdWBL2X3KyrGHev_qQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset to Gmail addresses fails

2017-12-04 Thread Jason
what do you have for EMAIL_PORT and EMAIL_USE_TLS?  IIRC, gmail requires 
TLS to be True.

-- 
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/1cfa944e-3fc5-447f-80f3-643520d4dba4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset to Gmail addresses fails

2017-12-04 Thread Alastair Campbell
Thanks,

The django settings are very straightforward (localhost, email address
set), and I've just tried sending from Mutt on that server (command line
email from localhost), with the same email address, and that appears in the
logs and gets delivered.

But from the password reset: nothing happens in the mail logs, nothing is
delivered.

I get emails to my own (non-gmail) email from the password reset, and they
show in the logs as well.

It is just from django, and just to gmail.

Very odd,

-Alastair


On Mon, Dec 4, 2017 at 9:28 AM, Antonis Christofides <
anto...@djangodeployment.com> wrote:

> Hello,
>
> could you show your EMAIL_* settings?
>
> (Meanwhile https://djangodeployment.com/2017/01/18/why-does-django-not-
> email-me-the-500-internal-server-error/ might help.)
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
>

-- 
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/CAC5%2BKCG_uQptq-9bv3iNvDoGmUcZw5RbRBQ7deuWrSDZ-k98mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does this test fail?

2017-12-04 Thread Johann Spies
My question was answered on Stackoverflow:

The correct line in the function should be

response = client.get('/wos_2017_2/') 


*because of my project urls.py that I did not provide initially:*

urlpatterns = [
 url(r'^wos_2017_2/', include('wos_2017_2.urls')),
 url(r'^admin/', admin.site.urls),
]



 

-- 
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/16c0194c-b5df-406f-a447-0df904c5ae9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread Tim Chase
On 2017-12-04 01:15, BIJAL MANIAR wrote:
> Do we need to purchase SSL certificate? Any links on that would be
> helpful.

There are two types of cert: DV ("Domain Validation" merely lets you
know that you're securely talking with the domain you think you are)
and EV ("Extended Validation" where they actually check up on you,
verifying your identity as a business/individual).



You can get free DV certs through several providers, but setting it
up with Let's Encrypt is broadly supported on a variety of
platforms.  They're only valid for a fairly short period of time (90
days, IIRC) but there are good tools to automate the renewal of the
cert.

  https://letsencrypt.org

For an EV cert, you have to pay and submit various forms of
documentation.  I've heard good things from multiple people about
obtaining theirs from DigiCert and multiple complaints about Comodo.

  https://www.digicert.com/

Hope this helps,

-tkc



-- 
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/20171204075738.2f9c25f9%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


RenameField with django 2.0: AttributeError: 'ManyToManyRel' object has no attribute 'field_name'

2017-12-04 Thread edigiacomo
With Django==2.0, a RenameField on a model which has a reverse many to many 
relationship raises an exception:

AttributeError: 'ManyToManyRel' object has no attribute 'field_name'

The same migration with Django==1.11 terminates successfully.

Migrations are automatically generated by `manage.py makemigrations`.

Am I missing something?

Below the code and the commands to reproduce the problem:

# myapp/models.py

from django.db import models


class ModelA(models.Model):
new_name = models.IntegerField()


class ModelB(models.Model):
model_as = models.ManyToManyField('ModelA')

# myapp/migrations/0001_initial.py

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='ModelA',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
('old_name', models.IntegerField()),
],
),
migrations.CreateModel(
name='ModelB',
fields=[
('id', models.AutoField(auto_created=True, 
primary_key=True, serialize=False, verbose_name='ID')),
('model_as', models.ManyToManyField(to='myapp.ModelA')),
],
),
]

# myapp/migrations/0002_auto_20171204_1012.py

from django.db import migrations


class Migration(migrations.Migration):

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

operations = [
migrations.RenameField(
model_name='modela',
old_name='old_name',
new_name='new_name',
),
]

$ ./manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, myapp, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying myapp.0001_initial... OK
  Applying myapp.0002_auto_20171204_1012...Traceback (most recent call 
last):
  File "./manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 371, in execute_from_command_line
utility.execute()
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
 
line 288, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/base.py",
 
line 335, in execute
output = self.handle(*args, **options)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
 
line 200, in handle
fake_initial=fake_initial,
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
 
line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
fake_initial=fake_initial)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
 
line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, 
fake_initial=fake_initial)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/executor.py",
 
line 244, in apply_migration
state = migration.apply(state, schema_editor)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/migration.py",
 
line 122, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, 
project_state)
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/migrations/operations/fields.py",
 
line 304, in database_forwards
to_model._meta.get_field(self.new_name),
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/backends/sqlite3/schema.py",
 
line 81, in alter_field
any(r.field_name == old_field.name for r in 
model._meta.related_objects)):
  File 
"/home/edg/src/example/env/lib/python3.6/site-packages/django/db/backends/sqlite3/schema.py",
 
line 81, in 
any(r.field_name == old_field.name for r in 
model._meta.related_objects)):
AttributeError: 

Why does this test fail?

2017-12-04 Thread Johann Spies
I am new to Testing Driven Development as well as to Django and will 
appreciate some help please.

I have just worked through the tutorials of the official documentation for 
1.11 and am trying 
to get going with TDD and Django.

The app is wos_2017_2 and I get this in the shell (which is run in the 
project root)

in the app's urls.py I have

>>> from django.test import Client
>>> client = Client()
>>> response = client.get('/')
Not Found: /
>>> response = client.get('/wos_2017_2/')
>>> response
.status_code
200

from . import views

from django.conf.urls import url

urlpatterns = [
 url(r'^$', views.index, name='index'),

]

and the in "wos_2017_2/test.py"


import unittest
from django.test import TestCase
from django.test import Client


# Create your tests here.

from .models import *
from .views import *

class SimpleTest(unittest.TestCase):

def test_index(self):
client = Client()
response = client.get('/')
self.assertEqual(response.status_code, 200)


And the test fails with
FAIL: test_index (wos_2017_2.tests.SimpleTest)
--
Traceback (most recent call last):
  File "/home/js/django/wos/wos_2017_2/tests.py", line 16, in test_index
self.assertEqual(response.status_code, 200)
AssertionError: 404 != 200

--
Ran 1 test in 0.006s

Using the url
http://localhost:8000/wos_2017_2/

in a browser works as expected.

Johann

-- 
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/5aaaf15d-db66-4fca-b44e-39b8159d38be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset to Gmail addresses fails

2017-12-04 Thread Julio Biason
Hi Alastair,

Just one question: are you using Gmail SMTP to send those messages or are you 
using your own/a third party?

Because Google could’ve marked your domain/server as spam and it is simply 
deleting all messages incoming from it (we had a similar problem a few days 
ago). If that’s the case, you need to contact the GMail team to ask what 
happened (I don’t have their contact ‘cause it was someone else here that 
solved that problem).

> On 4 Dec 2017, at 07:22, Alastair Campbell  wrote:
> 
> Hi everyone,
> 
> I have a very strange problem, I'm looking for ideas on where to debug.
> 
> Using the standard password reset in Django (v 1.10), it silently fails to 
> send to Gmail addresses.
> 
> There is no error generated by Django, and it works for non-Gmail addresses.
> 
> In /var/log/mail.log (a Debian VM on Linode), nothing gets passed to the mail 
> log (and I checked .err, .warn and .info as well), it is like it didn't 
> happen.
> 
> I can send email from that box to gmail addresses via my email client, that 
> works fine and shows up in the logs. (And the TLS cert is being used, and I 
> have done SPF.)
> 
> Is there somewhere between the mail log and django that I need to check? Any 
> clues or similar problems recently?
> 
> Thanks,
> 
> -Alastair
> 
> -- 
> 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/CAC5%2BKCFBuei5Cnue8yRwac%3Da92yr2e9AmUzuN_Q6OTf8mMV5vg%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/FE948D46-057A-4D8A-988F-7B84DB8C38E2%40azion.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password reset to Gmail addresses fails

2017-12-04 Thread Antonis Christofides
Hello,

could you show your EMAIL_* settings?

(Meanwhile
https://djangodeployment.com/2017/01/18/why-does-django-not-email-me-the-500-internal-server-error/
might help.)

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 2017-12-04 11:22, Alastair Campbell wrote:
> Hi everyone,
>
> I have a very strange problem, I'm looking for ideas on where to debug.
>
> Using the standard password reset in Django (v 1.10), it silently fails to
> send to Gmail addresses.
>
> There is no error generated by Django, and it works for non-Gmail addresses.
>
> In /var/log/mail.log (a Debian VM on Linode), nothing gets passed to the mail
> log (and I checked .err, .warn and .info as well), it is like it didn't 
> happen.
>
> I can send email from that box to gmail addresses via my email client, that
> works fine and shows up in the logs. (And the TLS cert is being used, and I
> have done SPF.)
>
> Is there somewhere between the mail log and django that I need to check? Any
> clues or similar problems recently?
>
> Thanks,
>
> -Alastair
> -- 
> 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/CAC5%2BKCFBuei5Cnue8yRwac%3Da92yr2e9AmUzuN_Q6OTf8mMV5vg%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/94c24625-7c36-cf2b-cb0e-2957001e086b%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread Jason
Let's Encrypt is great, especially with wildcard certificates coming next 
month.  Downside is they're time-limited to 90 days of validity, so you'll 
have to come up with some automatic process to regenerate the certificate.  
Fortunately, the process is well documented and simple to execute.

-- 
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/64004d94-14ed-44e3-9b0c-5f4acfc742fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unresolved filter 'crispy'

2017-12-04 Thread Jason
That's coming from your IDE.  Assuming its Pycharm, I've noticed it doesn't 
often pick up new additions to the virtualenv so I've made it a habit to 
invalidate caches and restart when making any additions.  This is primarly 
for vagrant and remote interpreters.

-- 
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/7e9b46c4-e348-4ad2-96f7-522dbf78b593%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.0 released

2017-12-04 Thread Vijay Khemlani
I just wanted to take the chance to thank Tim and all the other people
working on Django, especially on this big milestone for the project.

At least for me It has served me well over the last 5 years, has
incorporated many useful features while still being relatively lean, and
has top notch documentation.

Thanks for the hard work guys!

On Sun, Dec 3, 2017 at 10:40 PM, Jorge Gimeno  wrote:

> If you use pipenv, it will do that for you.
>
> -Jorge
>
> On Dec 3, 2017 3:05 PM, "Simon Charette"  wrote:
>
>> > My mistake? My "requirements.txt" file did not mention package versions.
>>
>> You should definitely make sure to lock/freeze your requirements to
>> prevent
>> your application's behavior from changing under your feet.
>>
>> Best,
>> Simon
>>
>> Le samedi 2 décembre 2017 15:02:55 UTC-5, Adler Neves a écrit :
>>>
>>> I guess I noticed it updated the worst way possible:
>>>
>>>- A commit has been pushed
>>>- Continuous Integration tests passes
>>>- CI sends "it's safe to deploy" signal to production server
>>>- Downtime in production
>>>
>>> My mistake? My "requirements.txt" file did not mention package versions.
>>>
>>> Seeing the changelog, a lot of stuff changed. Seeing the tracebacks,
>>> some helper applications I use ("django-avatar" is one of them) will need
>>> updates before I migrate to the newer version.
>>>
>>> Em sábado, 2 de dezembro de 2017 14:28:59 UTC-2, Tim Graham escreveu:

 Django 2.0 is now available:

 https://www.djangoproject.com/weblog/2017/dec/02/django-20-released/

 With the release of Django 2.0, Django 1.11 has reached the end of
 mainstream support. The final minor bug fix release (1.11.8) was
 issued today. As a long-term support release, Django 1.11 will receive
 security and data loss fixes until April 2020.

 Django 1.10 has reached the end of extended support. All Django 1.10
 users are encouraged to upgrade to Django 1.11 or later to continue
 receiving fixes for security issues.

 See the downloads page [1] for a table of supported versions and the
 future release schedule.

 [1] https://www.djangoproject.com/download/#supported-versions

>>> --
>> 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/ms
>> gid/django-users/9d01a490-ded0-4d22-8d3b-6734968eaaf5%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/CANfN%3DK8uW-kK5YSkh0VA10%2B3aySezEwBa8--%2BUSetjri-
> aVn5w%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/CALn3ei1rR%3D4FvVFwTi-RmMMtrOqj_e4vMdGwro8dtv-mnsAdOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Unresolved filter 'crispy'

2017-12-04 Thread Kubilay Yazoğlu
I'm trying to add crispy forms to my project. 
(http://django-crispy-forms.readthedocs.io/en/latest/)

I installed crispy forms by pip install django-crispy-forms

I added this in installed apps:

'crispy_forms',


And this at the end of settings.py:

CRISPY_TEMPLATE_PACK = 'bootstrap3'


And this at the top of my form.html

{% load crispy_forms_tags %}


Still, I'm getting unresolved filter 'crispy' error. What am I missing?

-- 
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/df75fb0d-c1c1-4cad-ae64-60c862a64011%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread Thiago Luiz Parolin
You can use
Let's Encrypt - Free SSL/TLS Certificates  (
https://letsencrypt.org)



2017-12-04 8:07 GMT-02:00 SHAILESH NEGI :

> Hey Bijal,
>
> You need to purchase the SSL.
> Follow the link.
> https://www.digitalocean.com/community/tutorials/how-to-
> install-an-ssl-certificate-from-a-commercial-certificate-authority
>
> On Mon, Dec 4, 2017 at 2:45 PM, BIJAL MANIAR  wrote:
>
>>
>> Hey Jani,
>> Do we need to purchase SSL certificate? Any links on that would be
>> helpful.
>>
>> Thanks,
>> Bijal
>>
>> On Monday, December 4, 2017 at 1:36:35 PM UTC+5:30, Jani Tiainen wrote:
>>>
>>> Hi,
>>>
>>> You just need to redirect (permanently) all traffic to port 80 to 443 in
>>> your Apache config.
>>>
>>> On 4.12.2017 10.03, BIJAL MANIAR wrote:
>>>
>>>
>>> Hello,
>>> We need to enforce an https connection for production django application
>>> running with apache and mod-wsgi. Can anyone please help me with what it
>>> will take to implement this.
>>>
>>> Thanks,
>>> Bijal
>>> --
>>> 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/ms
>>> gid/django-users/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>>> Jani Tiainen
>>>
>>> --
>> 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/ms
>> gid/django-users/f94fdd56-5a8c-4aa9-9f41-de3909b34a12%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Thanks & Regards,
> SHAILESH NEGI
>
>
> --
> 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/CAEFKsYPq2BGpg38LXC4kbXUTqfy6w
> S%2Btgusoce%2ByZxh56QLteQ%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/CACTnJ00ctJmf529AsfstxiSV0GkNq4yuDXYDjrc2-8zSRbdHBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread SHAILESH NEGI
Hey Bijal,

You need to purchase the SSL.
Follow the link.
https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certificate-from-a-commercial-certificate-authority

On Mon, Dec 4, 2017 at 2:45 PM, BIJAL MANIAR  wrote:

>
> Hey Jani,
> Do we need to purchase SSL certificate? Any links on that would be helpful.
>
> Thanks,
> Bijal
>
> On Monday, December 4, 2017 at 1:36:35 PM UTC+5:30, Jani Tiainen wrote:
>>
>> Hi,
>>
>> You just need to redirect (permanently) all traffic to port 80 to 443 in
>> your Apache config.
>>
>> On 4.12.2017 10.03, BIJAL MANIAR wrote:
>>
>>
>> Hello,
>> We need to enforce an https connection for production django application
>> running with apache and mod-wsgi. Can anyone please help me with what it
>> will take to implement this.
>>
>> Thanks,
>> Bijal
>> --
>> 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/ms
>> gid/django-users/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> Jani Tiainen
>>
>> --
> 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/f94fdd56-5a8c-4aa9-9f41-de3909b34a12%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks & Regards,
SHAILESH NEGI

-- 
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/CAEFKsYPq2BGpg38LXC4kbXUTqfy6wS%2Btgusoce%2ByZxh56QLteQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Password reset to Gmail addresses fails

2017-12-04 Thread Alastair Campbell
Hi everyone,

I have a very strange problem, I'm looking for ideas on where to debug.

Using the standard password reset in Django (v 1.10), it silently fails to
send to Gmail addresses.

There is no error generated by Django, and it works for non-Gmail addresses.

In /var/log/mail.log (a Debian VM on Linode), nothing gets passed to the
mail log (and I checked .err, .warn and .info as well), it is like it
didn't happen.

I can send email from that box to gmail addresses via my email client, that
works fine and shows up in the logs. (And the TLS cert is being used, and I
have done SPF.)

Is there somewhere between the mail log and django that I need to check?
Any clues or similar problems recently?

Thanks,

-Alastair

-- 
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/CAC5%2BKCFBuei5Cnue8yRwac%3Da92yr2e9AmUzuN_Q6OTf8mMV5vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread Jani Tiainen

Hi,

You need SSL sertificate, sure.

You can get one for free from Let's Encrypt [1] if your site is public.

For private testing you can create self-signed certificates.

[1] https://letsencrypt.org/

On 4.12.2017 11.15, BIJAL MANIAR wrote:


Hey Jani,
Do we need to purchase SSL certificate? Any links on that would be 
helpful.


Thanks,
Bijal

On Monday, December 4, 2017 at 1:36:35 PM UTC+5:30, Jani Tiainen wrote:

Hi,

You just need to redirect (permanently) all traffic to port 80 to
443 in your Apache config.


On 4.12.2017 10.03, BIJAL MANIAR wrote:


Hello,
We need to enforce an https connection for production django
application running with apache and mod-wsgi. Can anyone please
help me with what it will take to implement this.

Thanks,
Bijal
-- 
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/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout
.


-- 
Jani Tiainen


--
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/f94fdd56-5a8c-4aa9-9f41-de3909b34a12%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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/f7a71063-5025-27f5-26a0-55f0b05114ab%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread BIJAL MANIAR

Hey Jani,
Do we need to purchase SSL certificate? Any links on that would be helpful.

Thanks,
Bijal

On Monday, December 4, 2017 at 1:36:35 PM UTC+5:30, Jani Tiainen wrote:
>
> Hi,
>
> You just need to redirect (permanently) all traffic to port 80 to 443 in 
> your Apache config.
>
> On 4.12.2017 10.03, BIJAL MANIAR wrote:
>
>
> Hello,
> We need to enforce an https connection for production django application 
> running with apache and mod-wsgi. Can anyone please help me with what it 
> will take to implement this.
>
> Thanks,
> Bijal
> -- 
> 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/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Jani Tiainen
>
>

-- 
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/f94fdd56-5a8c-4aa9-9f41-de3909b34a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Enable https for a production django application

2017-12-04 Thread Jani Tiainen

Hi,

You just need to redirect (permanently) all traffic to port 80 to 443 in 
your Apache config.



On 4.12.2017 10.03, BIJAL MANIAR wrote:


Hello,
We need to enforce an https connection for production django 
application running with apache and mod-wsgi. Can anyone please help 
me with what it will take to implement this.


Thanks,
Bijal
--
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/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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/c7ed755f-fdb7-1837-c173-3298f23a7ce2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Enable https for a production django application

2017-12-04 Thread BIJAL MANIAR

Hello,
We need to enforce an https connection for production django application 
running with apache and mod-wsgi. Can anyone please help me with what it 
will take to implement this.

Thanks,
Bijal

-- 
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/16075809-a4f6-4174-b9a3-a545ade434ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.