From 2a26da5c95e22eb5aa596802a5ff6321e52e746e Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 14 Jun 2016 22:02:41 -0400 Subject: [PATCH 01/21] Fixes importing urls fixes django.db.utils.ProgrammingError: relation "auth_group" does not exist --- django_facebook/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_facebook/urls.py b/django_facebook/urls.py index 835f0385..8cf664a5 100644 --- a/django_facebook/urls.py +++ b/django_facebook/urls.py @@ -30,7 +30,7 @@ image_upload, name='facebook_image_upload'), url(r'^canvas/$', canvas, name='facebook_canvas'), url(r'^page_tab/$', - 'page_tab', name=facebook_page_tab), + page_tab, name='facebook_page_tab'), url(r'^open_graph_beta/$', open_graph_beta, name='facebook_open_graph_beta'), url(r'^remove_og_share/$', remove_og_share, From 9a137d57952854111cc1c9c976ecc5dc7d77d1ee Mon Sep 17 00:00:00 2001 From: jrabbit Date: Wed, 15 Jun 2016 00:33:02 -0400 Subject: [PATCH 02/21] the goal: no more weird table naming settings Remove BaseModelMetaclass, excise it from BaseModel even less magic the quest is completed. it seems to run just fine now. --- django_facebook/models.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/django_facebook/models.py b/django_facebook/models.py index e8b4db7e..7c6eff8c 100644 --- a/django_facebook/models.py +++ b/django_facebook/models.py @@ -366,36 +366,12 @@ class FacebookCustomUser(AbstractUser, FacebookModel): logger.info('Couldnt setup FacebookUser, got error %s', e) -class BaseModelMetaclass(ModelBase): - - ''' - Cleaning up the table naming conventions - ''' - - def __new__(cls, name, bases, attrs): - super_new = ModelBase.__new__(cls, name, bases, attrs) - module_name = camel_to_underscore(name) - - app_label = super_new.__module__.split('.')[-2] - db_table = '%s_%s' % (app_label, module_name) - - django_default = '%s_%s' % (app_label, name.lower()) - if not getattr(super_new._meta, 'proxy', False): - db_table_is_default = django_default == super_new._meta.db_table - # Don't overwrite when people customize the db_table - if db_table_is_default: - super_new._meta.db_table = db_table - - return super_new - - @python_2_unicode_compatible class BaseModel(models.Model): ''' Stores the fields common to all incentive models ''' - __metaclass__ = BaseModelMetaclass def __str__(self): ''' @@ -527,8 +503,6 @@ class OpenGraphShare(BaseModel): updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True, db_index=True) - class Meta: - db_table = facebook_settings.FACEBOOK_OG_SHARE_DB_TABLE def save(self, *args, **kwargs): if self.user and not self.facebook_user_id: From b5ed625bfeade44050b88fdf0b5a4d25a3c577f4 Mon Sep 17 00:00:00 2001 From: jrabbit Date: Wed, 15 Jun 2016 22:36:04 -0400 Subject: [PATCH 03/21] begin work on #539 --- django_facebook/models.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/django_facebook/models.py b/django_facebook/models.py index 7c6eff8c..7f49762e 100644 --- a/django_facebook/models.py +++ b/django_facebook/models.py @@ -54,11 +54,18 @@ def validate_settings(): # make sure the context processors are present required = ['django_facebook.context_processors.facebook', 'django.core.context_processors.request'] - context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS - for context_processor in required: - if context_processor not in context_processors: - logger.warn( - 'Required context processor %s wasnt found', context_processor) + try: + if settings.TEMPLATES: + # I don't know if this check makes sense with complex TEMPLATES settings. + pass + except AttributeError,e: + # we are on django <1.10 and user is using deprecated settings. + context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS + for context_processor in required: + if context_processor not in context_processors: + logger.warn( + 'Required context processor %s wasnt found', context_processor) + backends = settings.AUTHENTICATION_BACKENDS required = 'django_facebook.auth_backends.FacebookBackend' From 643f28758d54ea04e12b5084e38045469d495ec8 Mon Sep 17 00:00:00 2001 From: jrabbit Date: Tue, 21 Jun 2016 01:43:18 -0400 Subject: [PATCH 04/21] migrations don't want to generate on 1.10 so we might as well commit them --- django_facebook/migrations/0001_initial.py | 138 +++++++++++++++++++++ django_facebook/migrations/__init__.py | 0 2 files changed, 138 insertions(+) create mode 100644 django_facebook/migrations/0001_initial.py create mode 100644 django_facebook/migrations/__init__.py diff --git a/django_facebook/migrations/0001_initial.py b/django_facebook/migrations/0001_initial.py new file mode 100644 index 00000000..eaf8078f --- /dev/null +++ b/django_facebook/migrations/0001_initial.py @@ -0,0 +1,138 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-06-21 05:40 +from __future__ import unicode_literals + +from django.conf import settings +import django.contrib.auth.models +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('contenttypes', '0002_remove_content_type_name'), + ('auth', '0007_alter_validators_add_error_messages'), + ] + + operations = [ + migrations.CreateModel( + name='FacebookCustomUser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=30, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')), + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('about_me', models.TextField(blank=True, null=True)), + ('facebook_id', models.BigIntegerField(blank=True, null=True, unique=True)), + ('access_token', models.TextField(blank=True, help_text='Facebook token for offline access', null=True)), + ('facebook_name', models.CharField(blank=True, max_length=255, null=True)), + ('facebook_profile_url', models.TextField(blank=True, null=True)), + ('website_url', models.TextField(blank=True, null=True)), + ('blog_url', models.TextField(blank=True, null=True)), + ('date_of_birth', models.DateField(blank=True, null=True)), + ('gender', models.CharField(blank=True, choices=[('m', 'Male'), ('f', 'Female')], max_length=1, null=True)), + ('raw_data', models.TextField(blank=True, null=True)), + ('facebook_open_graph', models.NullBooleanField(help_text='Determines if this user want to share via open graph')), + ('new_token_required', models.BooleanField(default=False, help_text='Set to true if the access token is outdated or lacks permissions')), + ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to='images/facebook_profiles/%Y/%m/%d')), + ('state', models.CharField(blank=True, max_length=255, null=True)), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), + ], + options={ + 'abstract': False, + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.CreateModel( + name='FacebookLike', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user_id', models.IntegerField()), + ('facebook_id', models.BigIntegerField()), + ('name', models.TextField(blank=True, null=True)), + ('category', models.TextField(blank=True, null=True)), + ('created_time', models.DateTimeField(blank=True, null=True)), + ], + ), + migrations.CreateModel( + name='FacebookProfile', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('about_me', models.TextField(blank=True, null=True)), + ('facebook_id', models.BigIntegerField(blank=True, null=True, unique=True)), + ('access_token', models.TextField(blank=True, help_text='Facebook token for offline access', null=True)), + ('facebook_name', models.CharField(blank=True, max_length=255, null=True)), + ('facebook_profile_url', models.TextField(blank=True, null=True)), + ('website_url', models.TextField(blank=True, null=True)), + ('blog_url', models.TextField(blank=True, null=True)), + ('date_of_birth', models.DateField(blank=True, null=True)), + ('gender', models.CharField(blank=True, choices=[('m', 'Male'), ('f', 'Female')], max_length=1, null=True)), + ('raw_data', models.TextField(blank=True, null=True)), + ('facebook_open_graph', models.NullBooleanField(help_text='Determines if this user want to share via open graph')), + ('new_token_required', models.BooleanField(default=False, help_text='Set to true if the access token is outdated or lacks permissions')), + ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to='images/facebook_profiles/%Y/%m/%d')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='FacebookUser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user_id', models.IntegerField()), + ('facebook_id', models.BigIntegerField()), + ('name', models.TextField(blank=True, null=True)), + ('gender', models.CharField(blank=True, choices=[('F', 'female'), ('M', 'male')], max_length=1, null=True)), + ], + ), + migrations.CreateModel( + name='OpenGraphShare', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('action_domain', models.CharField(max_length=255)), + ('facebook_user_id', models.BigIntegerField()), + ('share_dict', models.TextField(blank=True, null=True)), + ('object_id', models.PositiveIntegerField(blank=True, null=True)), + ('error_message', models.TextField(blank=True, null=True)), + ('last_attempt', models.DateTimeField(auto_now_add=True, null=True)), + ('retry_count', models.IntegerField(blank=True, null=True)), + ('share_id', models.CharField(blank=True, max_length=255, null=True)), + ('completed_at', models.DateTimeField(blank=True, null=True)), + ('removed_at', models.DateTimeField(blank=True, null=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'abstract': False, + }, + ), + migrations.AlterUniqueTogether( + name='facebookuser', + unique_together=set([('user_id', 'facebook_id')]), + ), + migrations.AlterUniqueTogether( + name='facebooklike', + unique_together=set([('user_id', 'facebook_id')]), + ), + ] diff --git a/django_facebook/migrations/__init__.py b/django_facebook/migrations/__init__.py new file mode 100644 index 00000000..e69de29b From 6e3348db70f883ee12d3287b46c4feb68a279d2a Mon Sep 17 00:00:00 2001 From: jrabbit Date: Sat, 6 Aug 2016 03:59:34 -0400 Subject: [PATCH 05/21] fix my code for python 3 --- django_facebook/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_facebook/models.py b/django_facebook/models.py index 7f49762e..96310219 100644 --- a/django_facebook/models.py +++ b/django_facebook/models.py @@ -58,7 +58,7 @@ def validate_settings(): if settings.TEMPLATES: # I don't know if this check makes sense with complex TEMPLATES settings. pass - except AttributeError,e: + except AttributeError as e: # we are on django <1.10 and user is using deprecated settings. context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS for context_processor in required: From c9aae020684d7443e38c87fa53a4d0d35f5a2144 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:14:23 -0400 Subject: [PATCH 06/21] update to pipenv, add a bunch of cascades for 2.0 --- .gitignore | 1 + .travis.yml | 35 ++--- Pipfile | 16 +++ Pipfile.lock | 151 ++++++++++++++++++++++ django_facebook/admin.py | 2 +- django_facebook/models.py | 6 +- facebook_example/facebook_example/urls.py | 21 +-- facebook_example/member/models.py | 2 +- 8 files changed, 186 insertions(+), 48 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/.gitignore b/.gitignore index 73136995..f1c49f22 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ bulkloader-* #app specific facebook_example/django_fb_test +facebook_example/facebook_example_db facebook_example/media/* # ignore uploaded test images diff --git a/.travis.yml b/.travis.yml index bfd8d546..7c6f0405 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,27 @@ language: python python: - 2.7 - - 3.4 - 3.5 + - 3.6 notifications: email: - thierryschellenbach@gmail.com env: # test the standalone functionality (skipping django 1.10 to minimize the number of machines used on Travis) - - DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.9,<1.10" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.9,<1.10" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.11,<1.12" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.11,<1.12" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook -matrix: - exclude: - - python: 3.5 - env: DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - python: 3.5 - env: DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook -postgres: - adapter: sqlite3 - database: django_fb_test + - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + install: - # faster than installing PIL manually - - pip install pep8 - - pip install coverage - - pip install python-coveralls - - pip install https://github.com/dcramer/pyflakes/tarball/master + - pip install coverage python-coveralls - python setup.py install - pip install -r facebook_example/requirements/$REQUIREMENTS.txt -I --allow-all-external - pip install Django$DJANGO -before_script: - - "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook" -# - pyflakes -x W src +# before_script: +# - "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook" +# # - pyflakes -x W src script: - - pip uninstall -y django-facebook && pip install -e . - cd facebook_example - coverage run manage.py test $TESTS --settings=$SETTINGS -v2 after_success: diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..8fa6c65e --- /dev/null +++ b/Pipfile @@ -0,0 +1,16 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +Django = ">=1.8" +Unidecode = "*" + +[dev-packages] +pytest = "==3.5.0" +"e1839a8" = {path = ".", editable = true} +pillow = "*" + +[requires] +python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 00000000..49f8ea3a --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,151 @@ +{ + "_meta": { + "hash": { + "sha256": "11d2a94c5f0479983012dfb70209fead94a1384600b9cb7481c28341d60c2963" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.6" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "django": { + "hashes": [ + "sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8", + "sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c" + ], + "index": "pypi", + "version": "==2.0.6" + }, + "pytz": { + "hashes": [ + "sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555", + "sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749" + ], + "version": "==2018.4" + }, + "unidecode": { + "hashes": [ + "sha256:72f49d3729f3d8f5799f710b97c1451c5163102e76d64d20e170aedbbd923582", + "sha256:8c33dd588e0c9bc22a76eaa0c715a5434851f726131bd44a6c26471746efabf5" + ], + "index": "pypi", + "version": "==1.0.22" + } + }, + "develop": { + "attrs": { + "hashes": [ + "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", + "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + ], + "version": "==18.1.0" + }, + "e1839a8": { + "editable": true, + "path": "." + }, + "more-itertools": { + "hashes": [ + "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", + "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", + "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" + ], + "version": "==4.2.0" + }, + "pillow": { + "hashes": [ + "sha256:00633bc2ec40313f4daf351855e506d296ec3c553f21b66720d0f1225ca84c6f", + "sha256:03514478db61b034fc5d38b9bf060f994e5916776e93f02e59732a8270069c61", + "sha256:040144ba422216aecf7577484865ade90e1a475f867301c48bf9fbd7579efd76", + "sha256:16246261ff22368e5e32ad74d5ef40403ab6895171a7fc6d34f6c17cfc0f1943", + "sha256:1cb38df69362af35c14d4a50123b63c7ff18ec9a6d4d5da629a6f19d05e16ba8", + "sha256:2400e122f7b21d9801798207e424cbe1f716cee7314cd0c8963fdb6fc564b5fb", + "sha256:2ee6364b270b56a49e8b8a51488e847ab130adc1220c171bed6818c0d4742455", + "sha256:3b4560c3891b05022c464b09121bd507c477505a4e19d703e1027a3a7c68d896", + "sha256:41374a6afb3f44794410dab54a0d7175e6209a5a02d407119c81083f1a4c1841", + "sha256:438a3faf5f702c8d0f80b9f9f9b8382cfa048ca6a0d64ef71b86b563b0ee0359", + "sha256:472a124c640bde4d5468f6991c9fa7e30b723d84ac4195a77c6ab6aea30f2b9c", + "sha256:4d32c8e3623a61d6e29ccd024066cd1ba556555abfb4cd714155020e00107e3f", + "sha256:4d8077fd649ac40a5c4165f2c22fa2a4ad18c668e271ecb2f9d849d1017a9313", + "sha256:62ec7ae98357fcd46002c110bb7cad15fce532776f0cbe7ca1d44c49b837d49d", + "sha256:6c7cab6a05351cf61e469937c49dbf3cdf5ffb3eeac71f8d22dc9be3507598d8", + "sha256:6eca36905444c4b91fe61f1b9933a47a30480738a1dd26501ff67d94fc2bc112", + "sha256:74e2ebfd19c16c28ad43b8a28ff73b904ed382ea4875188838541751986e8c9a", + "sha256:7673e7473a13107059377c96c563aa36f73184c29d2926882e0a0210b779a1e7", + "sha256:81762cf5fca9a82b53b7b2d0e6b420e0f3b06167b97678c81d00470daa622d58", + "sha256:8554bbeb4218d9cfb1917c69e6f2d2ad0be9b18a775d2162547edf992e1f5f1f", + "sha256:9b66e968da9c4393f5795285528bc862c7b97b91251f31a08004a3c626d18114", + "sha256:a00edb2dec0035e98ac3ec768086f0b06dfabb4ad308592ede364ef573692f55", + "sha256:b48401752496757e95304a46213c3155bc911ac884bed2e9b275ce1c1df3e293", + "sha256:b6cf18f9e653a8077522bb3aa753a776b117e3e0cc872c25811cfdf1459491c2", + "sha256:bb8adab1877e9213385cbb1adc297ed8337e01872c42a30cfaa66ff8c422779c", + "sha256:c8a4b39ba380b57a31a4b5449a9d257b1302d8bc4799767e645dcee25725efe1", + "sha256:cee9bc75bff455d317b6947081df0824a8f118de2786dc3d74a3503fd631f4ef", + "sha256:d0dc1313dff48af64517cbbd85e046d6b477fbe5e9d69712801f024dcb08c62b", + "sha256:d5bf527ed83617edd1855a5c923eeeaf68bcb9ac0ceb28e3f19b575b3a424984", + "sha256:df5863a21f91de5ecdf7d32a32f406dd9867ebb35d41033b8bd9607a21887599", + "sha256:e39142332541ed2884c257495504858b22c078a5d781059b07aba4c3a80d7551", + "sha256:e52e8f675ba0b2b417fa98579e7286a41a8e23871f17f4793772f5aa884fea79", + "sha256:e6dd55d5d94b9e36929325dd0c9ab85bfde84a5fc35947c334c32af1af668944", + "sha256:e87cc1acbebf263f308a8494272c2d42016aa33c32bf14d209c81e1f65e11868", + "sha256:ea0091cd4100519cedfeea2c659f52291f535ac6725e2368bcf59e874f270efa", + "sha256:eeb247f4f4d962942b3b555530b0c63b77473c7bfe475e51c6b75b7344b49ce3", + "sha256:f0d4433adce6075efd24fc0285135248b0b50f5a58129c7e552030e04fe45c7f", + "sha256:f1f3bd92f8e12dc22884935a73c9f94c4d9bd0d34410c456540713d6b7832b8c", + "sha256:f42a87cbf50e905f49f053c0b1fb86c911c730624022bf44c8857244fc4cdaca", + "sha256:f5f302db65e2e0ae96e26670818157640d3ca83a3054c290eff3631598dcf819", + "sha256:f7634d534662bbb08976db801ba27a112aee23e597eeaf09267b4575341e45bf", + "sha256:fdd374c02e8bb2d6468a85be50ea66e1c4ef9e809974c30d8576728473a6ed03", + "sha256:fe6931db24716a0845bd8c8915bd096b77c2a7043e6fc59ae9ca364fe816f08b" + ], + "index": "pypi", + "version": "==5.1.0" + }, + "pluggy": { + "hashes": [ + "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff", + "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", + "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" + ], + "version": "==0.6.0" + }, + "py": { + "hashes": [ + "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881", + "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" + ], + "version": "==1.5.3" + }, + "pytest": { + "hashes": [ + "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c", + "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1" + ], + "index": "pypi", + "version": "==3.5.0" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + }, + "unidecode": { + "hashes": [ + "sha256:72f49d3729f3d8f5799f710b97c1451c5163102e76d64d20e170aedbbd923582", + "sha256:8c33dd588e0c9bc22a76eaa0c715a5434851f726131bd44a6c26471746efabf5" + ], + "index": "pypi", + "version": "==1.0.22" + } + } +} diff --git a/django_facebook/admin.py b/django_facebook/admin.py index c468e993..ba64ff1c 100644 --- a/django_facebook/admin.py +++ b/django_facebook/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django_facebook import admin_actions from django_facebook import models from django_facebook import settings as facebook_settings diff --git a/django_facebook/models.py b/django_facebook/models.py index 53e6e5c6..41b62c6a 100644 --- a/django_facebook/models.py +++ b/django_facebook/models.py @@ -373,7 +373,7 @@ class FacebookProfile(FacebookProfileModel): Use this by setting AUTH_PROFILE_MODULE = 'django_facebook.FacebookProfile' ''' - user = models.OneToOneField(get_user_model_setting()) + user = models.OneToOneField(get_user_model_setting(), models.CASCADE) if getattr(settings, 'AUTH_USER_MODEL', None) == 'django_facebook.FacebookCustomUser': try: @@ -500,7 +500,7 @@ class OpenGraphShare(BaseModel): ''' objects = model_managers.OpenGraphShareManager() - user = models.ForeignKey(get_user_model_setting()) + user = models.ForeignKey(get_user_model_setting(), models.CASCADE) # domain stores action_domain = models.CharField(max_length=255) @@ -509,7 +509,7 @@ class OpenGraphShare(BaseModel): # what we are sharing, dict and object share_dict = models.TextField(blank=True, null=True) - content_type = models.ForeignKey(ContentType, blank=True, null=True) + content_type = models.ForeignKey(ContentType, models.CASCADE, blank=True, null=True) object_id = models.PositiveIntegerField(blank=True, null=True) content_object = GenericForeignKey('content_type', 'object_id') diff --git a/facebook_example/facebook_example/urls.py b/facebook_example/facebook_example/urls.py index 4894fda0..0d659963 100644 --- a/facebook_example/facebook_example/urls.py +++ b/facebook_example/facebook_example/urls.py @@ -1,7 +1,5 @@ -try: - from django.conf.urls import include, url -except ImportError: - from django.conf.urls.defaults import include, url +from django.conf.urls import include, url +from django.urls import path from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin @@ -11,12 +9,7 @@ # facebook and registration urls url(r'^facebook/', include('django_facebook.urls')), url(r'^accounts/', include('django_facebook.auth_urls')), - - # Uncomment the admin/doc line below to enable admin documentation: - # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - - # Uncomment the next line to enable the admin: - url(r'^admin/', include(admin.site.urls)), + path('admin/', admin.site.urls), ] if settings.MODE == 'userena': @@ -27,11 +20,3 @@ urlpatterns += [ url(r'^accounts/', include('registration.backends.default.urls')), ] - - -if settings.DEBUG: - urlpatterns += [ - url(r'^media/(?P.*)$', 'django.views.static.serve', { - 'document_root': settings.MEDIA_ROOT, - }), - ] diff --git a/facebook_example/member/models.py b/facebook_example/member/models.py index c412fd45..e7ac6b26 100644 --- a/facebook_example/member/models.py +++ b/facebook_example/member/models.py @@ -29,7 +29,7 @@ class UserProfile(FacebookModel): ''' Inherit the properties from django facebook ''' - user = models.OneToOneField(settings.AUTH_USER_MODEL) + user = models.OneToOneField(settings.AUTH_USER_MODEL, models.CASCADE) @receiver(post_save) From 832b0cec5ee5c19b2d3d558e0292f3371b68a503 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:21:15 -0400 Subject: [PATCH 07/21] additional migration? --- .../migrations/0002_auto_20180619_0916.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 django_facebook/migrations/0002_auto_20180619_0916.py diff --git a/django_facebook/migrations/0002_auto_20180619_0916.py b/django_facebook/migrations/0002_auto_20180619_0916.py new file mode 100644 index 00000000..a2ee3bc1 --- /dev/null +++ b/django_facebook/migrations/0002_auto_20180619_0916.py @@ -0,0 +1,24 @@ +# Generated by Django 2.0.6 on 2018-06-19 14:16 + +import django.contrib.auth.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_facebook', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='facebookcustomuser', + name='last_name', + field=models.CharField(blank=True, max_length=150, verbose_name='last name'), + ), + migrations.AlterField( + model_name='facebookcustomuser', + name='username', + field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username'), + ), + ] From 63d9daa991bfd70fa47f1c1eeb776104162b8b39 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:31:34 -0400 Subject: [PATCH 08/21] exclude django 2+ on 2.7, clean up settings --- .travis.yml | 16 +++-- facebook_example/facebook_example/settings.py | 58 +++++-------------- 2 files changed, 27 insertions(+), 47 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c6f0405..b6b6ca9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python python: - 2.7 + - 3.4 - 3.5 - - 3.6 notifications: email: - thierryschellenbach@gmail.com @@ -12,16 +12,22 @@ env: - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - +matrix: + exclude: + - python: 2.7 + env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + - python: 2.7 + env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook install: - pip install coverage python-coveralls - python setup.py install - pip install -r facebook_example/requirements/$REQUIREMENTS.txt -I --allow-all-external - pip install Django$DJANGO -# before_script: -# - "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook" -# # - pyflakes -x W src +before_script: + - "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook" +# - pyflakes -x W src script: + - pip uninstall -y django-facebook && pip install -e . - cd facebook_example - coverage run manage.py test $TESTS --settings=$SETTINGS -v2 after_success: diff --git a/facebook_example/facebook_example/settings.py b/facebook_example/facebook_example/settings.py index 9e3d4738..0a8b9e90 100644 --- a/facebook_example/facebook_example/settings.py +++ b/facebook_example/facebook_example/settings.py @@ -4,48 +4,31 @@ import sys django_version = django.VERSION # some complications related to our travis testing setup -DJANGO = os.environ.get('DJANGO', '1.5.1') MODE = os.environ.get('MODE', 'standalone') CUSTOM_USER_MODEL = bool(int(os.environ.get('CUSTOM_USER_MODEL', '1'))) -if DJANGO != '1.5.1': - CUSTOM_USER_MODEL = False TESTING = 'test' in sys.argv FACEBOOK_APP_ID = '215464901804004' FACEBOOK_APP_SECRET = '0aceba27823a9dfefa955f76949fa4b4' -if django_version < (1, 10, 0): - TEMPLATE_CONTEXT_PROCESSORS = [ - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.static', - 'django.core.context_processors.request', - 'django.contrib.messages.context_processors.messages', - 'django_facebook.context_processors.facebook', - ] - - if django_version >= (1, 4, 0): - TEMPLATE_CONTEXT_PROCESSORS.append('django.core.context_processors.tz') -else: - TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - 'django_facebook.context_processors.facebook', - ], - }, + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django_facebook.context_processors.facebook', + ], }, - ] + }, +] AUTHENTICATION_BACKENDS = ( 'django_facebook.auth_backends.FacebookBackend', @@ -174,21 +157,12 @@ 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', - # Uncomment the next line to enable the admin: - # 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - # 'django.contrib.admindocs', 'django_facebook', 'member', 'open_facebook', 'django.contrib.admin', ) -if django_version < (1, 7, 0): - # south isn't needed by django >= 1.7 since migrations were added. See: - # - https://docs.djangoproject.com/en/dev/topics/migrations/#libraries-third-party-apps - # - https://south.readthedocs.io/en/latest/releasenotes/1.0.html#library-migration-path - INSTALLED_APPS += ('south',) # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to From 26e9222833e4438d0f701804bf94332046c01ac7 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:35:04 -0400 Subject: [PATCH 09/21] more changes in CI --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6b6ca9c..60258e9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,9 @@ install: - python setup.py install - pip install -r facebook_example/requirements/$REQUIREMENTS.txt -I --allow-all-external - pip install Django$DJANGO -before_script: - - "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook" -# - pyflakes -x W src + script: - - pip uninstall -y django-facebook && pip install -e . + - pip install -e . - cd facebook_example - coverage run manage.py test $TESTS --settings=$SETTINGS -v2 after_success: From 9d249b41477efb0794fd359154f80c4b97fd94d3 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:37:42 -0400 Subject: [PATCH 10/21] pep8 is now pycodestyle, fix weird travis python versions --- .travis.yml | 2 +- Pipfile | 1 + Pipfile.lock | 11 ++++++++++- fabfile.py | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60258e9f..b87047ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python python: - 2.7 - - 3.4 - 3.5 + - 3.6 notifications: email: - thierryschellenbach@gmail.com diff --git a/Pipfile b/Pipfile index 8fa6c65e..cca1d3ba 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,7 @@ Unidecode = "*" pytest = "==3.5.0" "e1839a8" = {path = ".", editable = true} pillow = "*" +pycodestyle = "*" [requires] python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock index 49f8ea3a..8763b9b4 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "11d2a94c5f0479983012dfb70209fead94a1384600b9cb7481c28341d60c2963" + "sha256": "a70de7ccba0830333d6389a5b09000b187ffcee30ef71b17e1dbe4ec6027f6a5" }, "pipfile-spec": 6, "requires": { @@ -124,6 +124,15 @@ ], "version": "==1.5.3" }, + "pycodestyle": { + "hashes": [ + "sha256:74abc4e221d393ea5ce1f129ea6903209940c1ecd29e002e8c6933c2b21026e0", + "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", + "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" + ], + "index": "pypi", + "version": "==2.4.0" + }, "pytest": { "hashes": [ "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c", diff --git a/fabfile.py b/fabfile.py index e2b0358e..b7b995c4 100644 --- a/fabfile.py +++ b/fabfile.py @@ -24,7 +24,7 @@ def publish(test='yes'): def validate(): with cd(PROJECT_ROOT): local( - 'pep8 --exclude=migrations --ignore=E501,E225 django_facebook open_facebook') + 'pycodestyle --exclude=migrations --ignore=E501,E225 django_facebook open_facebook') local('python %s test open_facebook django_facebook' % manage_py) From 39845389d2c716efeed4e808fd4b292ccd994619 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:39:42 -0400 Subject: [PATCH 11/21] fix import on 2.0 --- django_facebook/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_facebook/tests.py b/django_facebook/tests.py index a005d5c4..9468e135 100644 --- a/django_facebook/tests.py +++ b/django_facebook/tests.py @@ -1,7 +1,7 @@ from __future__ import with_statement from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.middleware import SessionMiddleware -from django.core.urlresolvers import reverse +from django.urls import reverse from django.http import QueryDict from django.test.client import Client, RequestFactory from django_facebook import exceptions as facebook_exceptions, \ From c082df57fa855586d9e15654b3347cff1598190e Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:43:50 -0400 Subject: [PATCH 12/21] admin not required and its giving me issues --- facebook_example/facebook_example/urls.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/facebook_example/facebook_example/urls.py b/facebook_example/facebook_example/urls.py index 0d659963..c0460cb3 100644 --- a/facebook_example/facebook_example/urls.py +++ b/facebook_example/facebook_example/urls.py @@ -1,5 +1,4 @@ from django.conf.urls import include, url -from django.urls import path from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin @@ -9,7 +8,6 @@ # facebook and registration urls url(r'^facebook/', include('django_facebook.urls')), url(r'^accounts/', include('django_facebook.auth_urls')), - path('admin/', admin.site.urls), ] if settings.MODE == 'userena': From aa562defbc27ee0f8d22005dedcf7ecfe9be713b Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:45:23 -0400 Subject: [PATCH 13/21] more ancient cruft --- facebook_example/facebook_example/settings.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/facebook_example/facebook_example/settings.py b/facebook_example/facebook_example/settings.py index 0a8b9e90..b666547a 100644 --- a/facebook_example/facebook_example/settings.py +++ b/facebook_example/facebook_example/settings.py @@ -129,14 +129,12 @@ # 'django.template.loaders.eggs.Loader', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - # Uncomment the next line for simple clickjacking protection: - # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) ROOT_URLCONF = 'facebook_example.urls' From 8fe466faf8c4bb50c896d09d6a81b3e65ce566a4 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Tue, 19 Jun 2018 10:46:07 -0400 Subject: [PATCH 14/21] bump up middlewares to 2.0 defaults --- facebook_example/facebook_example/settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/facebook_example/facebook_example/settings.py b/facebook_example/facebook_example/settings.py index b666547a..f0412847 100644 --- a/facebook_example/facebook_example/settings.py +++ b/facebook_example/facebook_example/settings.py @@ -129,13 +129,15 @@ # 'django.template.loaders.eggs.Loader', ) -MIDDLEWARE = ( - 'django.middleware.common.CommonMiddleware', +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', -) + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] ROOT_URLCONF = 'facebook_example.urls' From 1bdd778dab9d999eb1d6ed2ea3aed8991ad13597 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 15 Aug 2018 02:57:39 -0400 Subject: [PATCH 15/21] fix weird issue in production and dev --- django_facebook/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_facebook/api.py b/django_facebook/api.py index ec49b609..d84077e3 100644 --- a/django_facebook/api.py +++ b/django_facebook/api.py @@ -216,7 +216,7 @@ def get_facebook_graph(request=None, access_token=None, redirect_uri=None, raise raise else: return None - elif request.user.is_authenticated(): + elif request.user.is_authenticated: # support for offline access tokens stored in the users profile profile = try_get_profile(request.user) access_token = get_user_attribute( From 1483a7a71da446983956024e81c2d89bb41b7e88 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 15 Aug 2018 03:16:42 -0400 Subject: [PATCH 16/21] didn't get all the uses of it --- django_facebook/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_facebook/api.py b/django_facebook/api.py index d84077e3..eec1188b 100644 --- a/django_facebook/api.py +++ b/django_facebook/api.py @@ -250,7 +250,7 @@ def _add_current_user_id(graph, user): if graph: graph.current_user_id = None - if user.is_authenticated(): + if user.is_authenticated: profile = try_get_profile(user) facebook_id = get_user_attribute(user, profile, 'facebook_id') if facebook_id: @@ -275,7 +275,7 @@ def __init__(self, open_facebook): self._profile = None def is_authenticated(self): - return self.open_facebook.is_authenticated() + return self.open_facebook.is_authenticated def facebook_registration_data(self, username=True): ''' From 60cb838eed180eec9e202d3a6ee2cd149353378d Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 22 Aug 2018 12:04:04 -0400 Subject: [PATCH 17/21] I think this should fix up travis by using the pipenv stuff we already wrote --- .travis.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b87047ae..bd202151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,25 +8,23 @@ notifications: - thierryschellenbach@gmail.com env: # test the standalone functionality (skipping django 1.10 to minimize the number of machines used on Travis) - - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook - - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" + - DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" + - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" + - DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" matrix: exclude: - python: 2.7 - env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" - python: 2.7 - env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook + env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" install: - pip install coverage python-coveralls - - python setup.py install - - pip install -r facebook_example/requirements/$REQUIREMENTS.txt -I --allow-all-external - pip install Django$DJANGO + - pipenv sync -d script: - - pip install -e . - cd facebook_example - - coverage run manage.py test $TESTS --settings=$SETTINGS -v2 + - pipenv run coverage run manage.py test $TESTS --settings=$SETTINGS -v2 after_success: - coveralls From e2ff70d4c465afe8f900d613429e042abdf3d9a8 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 22 Aug 2018 12:11:32 -0400 Subject: [PATCH 18/21] oh we need to install pipenv before we do bad things to it --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd202151..fdbe6a78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ matrix: - python: 2.7 env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook" install: - - pip install coverage python-coveralls - - pip install Django$DJANGO + - pip install coverage python-coveralls pipenv + - pipenv run pip install Django$DJANGO - pipenv sync -d script: From 37448e578d5d31750699994773427652fbca93e6 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 22 Aug 2018 12:17:08 -0400 Subject: [PATCH 19/21] aaaaaaa --- Pipfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Pipfile b/Pipfile index cca1d3ba..75caecb1 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,6 @@ verify_ssl = true name = "pypi" [packages] -Django = ">=1.8" Unidecode = "*" [dev-packages] From d1e06dede9a233544c5cffe805663be16c5ff952 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 22 Aug 2018 12:18:34 -0400 Subject: [PATCH 20/21] did you run pipenv lock before committing your pipfile genius? --- Pipfile.lock | 109 +++++++++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 68 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 8763b9b4..684f8a43 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a70de7ccba0830333d6389a5b09000b187ffcee30ef71b17e1dbe4ec6027f6a5" + "sha256": "c17d25376e863d4d6ed749dc887e9fe9a2e67a82ab34ebf6f4e3ef0011d3a5d6" }, "pipfile-spec": 6, "requires": { @@ -16,21 +16,6 @@ ] }, "default": { - "django": { - "hashes": [ - "sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8", - "sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c" - ], - "index": "pypi", - "version": "==2.0.6" - }, - "pytz": { - "hashes": [ - "sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555", - "sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749" - ], - "version": "==2018.4" - }, "unidecode": { "hashes": [ "sha256:72f49d3729f3d8f5799f710b97c1451c5163102e76d64d20e170aedbbd923582", @@ -54,60 +39,47 @@ }, "more-itertools": { "hashes": [ - "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", - "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", - "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" + "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", + "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e", + "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d" ], - "version": "==4.2.0" + "version": "==4.3.0" }, "pillow": { "hashes": [ - "sha256:00633bc2ec40313f4daf351855e506d296ec3c553f21b66720d0f1225ca84c6f", - "sha256:03514478db61b034fc5d38b9bf060f994e5916776e93f02e59732a8270069c61", - "sha256:040144ba422216aecf7577484865ade90e1a475f867301c48bf9fbd7579efd76", - "sha256:16246261ff22368e5e32ad74d5ef40403ab6895171a7fc6d34f6c17cfc0f1943", - "sha256:1cb38df69362af35c14d4a50123b63c7ff18ec9a6d4d5da629a6f19d05e16ba8", - "sha256:2400e122f7b21d9801798207e424cbe1f716cee7314cd0c8963fdb6fc564b5fb", - "sha256:2ee6364b270b56a49e8b8a51488e847ab130adc1220c171bed6818c0d4742455", - "sha256:3b4560c3891b05022c464b09121bd507c477505a4e19d703e1027a3a7c68d896", - "sha256:41374a6afb3f44794410dab54a0d7175e6209a5a02d407119c81083f1a4c1841", - "sha256:438a3faf5f702c8d0f80b9f9f9b8382cfa048ca6a0d64ef71b86b563b0ee0359", - "sha256:472a124c640bde4d5468f6991c9fa7e30b723d84ac4195a77c6ab6aea30f2b9c", - "sha256:4d32c8e3623a61d6e29ccd024066cd1ba556555abfb4cd714155020e00107e3f", - "sha256:4d8077fd649ac40a5c4165f2c22fa2a4ad18c668e271ecb2f9d849d1017a9313", - "sha256:62ec7ae98357fcd46002c110bb7cad15fce532776f0cbe7ca1d44c49b837d49d", - "sha256:6c7cab6a05351cf61e469937c49dbf3cdf5ffb3eeac71f8d22dc9be3507598d8", - "sha256:6eca36905444c4b91fe61f1b9933a47a30480738a1dd26501ff67d94fc2bc112", - "sha256:74e2ebfd19c16c28ad43b8a28ff73b904ed382ea4875188838541751986e8c9a", - "sha256:7673e7473a13107059377c96c563aa36f73184c29d2926882e0a0210b779a1e7", - "sha256:81762cf5fca9a82b53b7b2d0e6b420e0f3b06167b97678c81d00470daa622d58", - "sha256:8554bbeb4218d9cfb1917c69e6f2d2ad0be9b18a775d2162547edf992e1f5f1f", - "sha256:9b66e968da9c4393f5795285528bc862c7b97b91251f31a08004a3c626d18114", - "sha256:a00edb2dec0035e98ac3ec768086f0b06dfabb4ad308592ede364ef573692f55", - "sha256:b48401752496757e95304a46213c3155bc911ac884bed2e9b275ce1c1df3e293", - "sha256:b6cf18f9e653a8077522bb3aa753a776b117e3e0cc872c25811cfdf1459491c2", - "sha256:bb8adab1877e9213385cbb1adc297ed8337e01872c42a30cfaa66ff8c422779c", - "sha256:c8a4b39ba380b57a31a4b5449a9d257b1302d8bc4799767e645dcee25725efe1", - "sha256:cee9bc75bff455d317b6947081df0824a8f118de2786dc3d74a3503fd631f4ef", - "sha256:d0dc1313dff48af64517cbbd85e046d6b477fbe5e9d69712801f024dcb08c62b", - "sha256:d5bf527ed83617edd1855a5c923eeeaf68bcb9ac0ceb28e3f19b575b3a424984", - "sha256:df5863a21f91de5ecdf7d32a32f406dd9867ebb35d41033b8bd9607a21887599", - "sha256:e39142332541ed2884c257495504858b22c078a5d781059b07aba4c3a80d7551", - "sha256:e52e8f675ba0b2b417fa98579e7286a41a8e23871f17f4793772f5aa884fea79", - "sha256:e6dd55d5d94b9e36929325dd0c9ab85bfde84a5fc35947c334c32af1af668944", - "sha256:e87cc1acbebf263f308a8494272c2d42016aa33c32bf14d209c81e1f65e11868", - "sha256:ea0091cd4100519cedfeea2c659f52291f535ac6725e2368bcf59e874f270efa", - "sha256:eeb247f4f4d962942b3b555530b0c63b77473c7bfe475e51c6b75b7344b49ce3", - "sha256:f0d4433adce6075efd24fc0285135248b0b50f5a58129c7e552030e04fe45c7f", - "sha256:f1f3bd92f8e12dc22884935a73c9f94c4d9bd0d34410c456540713d6b7832b8c", - "sha256:f42a87cbf50e905f49f053c0b1fb86c911c730624022bf44c8857244fc4cdaca", - "sha256:f5f302db65e2e0ae96e26670818157640d3ca83a3054c290eff3631598dcf819", - "sha256:f7634d534662bbb08976db801ba27a112aee23e597eeaf09267b4575341e45bf", - "sha256:fdd374c02e8bb2d6468a85be50ea66e1c4ef9e809974c30d8576728473a6ed03", - "sha256:fe6931db24716a0845bd8c8915bd096b77c2a7043e6fc59ae9ca364fe816f08b" + "sha256:00def5b638994f888d1058e4d17c86dec8e1113c3741a0a8a659039aec59a83a", + "sha256:026449b64e559226cdb8e6d8c931b5965d8fc90ec18ebbb0baa04c5b36503c72", + "sha256:03dbb224ee196ef30ed2156d41b579143e1efeb422974719a5392fc035e4f574", + "sha256:03eb0e04f929c102ae24bc436bf1c0c60a4e63b07ebd388e84d8b219df3e6acd", + "sha256:1be66b9a89e367e7d20d6cae419794997921fe105090fafd86ef39e20a3baab2", + "sha256:1e977a3ed998a599bda5021fb2c2889060617627d3ae228297a529a082a3cd5c", + "sha256:22cf3406d135cfcc13ec6228ade774c8461e125c940e80455f500638429be273", + "sha256:24adccf1e834f82718c7fc8e3ec1093738da95144b8b1e44c99d5fc7d3e9c554", + "sha256:2a3e362c97a5e6a259ee9cd66553292a1f8928a5bdfa3622fdb1501570834612", + "sha256:3832e26ecbc9d8a500821e3a1d3765bda99d04ae29ffbb2efba49f5f788dc934", + "sha256:4fd1f0c2dc02aaec729d91c92cd85a2df0289d88e9f68d1e8faba750bb9c4786", + "sha256:4fda62030f2c515b6e2e673c57caa55cb04026a81968f3128aae10fc28e5cc27", + "sha256:5044d75a68b49ce36a813c82d8201384207112d5d81643937fc758c05302f05b", + "sha256:522184556921512ec484cb93bd84e0bab915d0ac5a372d49571c241a7f73db62", + "sha256:5914cff11f3e920626da48e564be6818831713a3087586302444b9c70e8552d9", + "sha256:6661a7908d68c4a133e03dac8178287aa20a99f841ea90beeb98a233ae3fd710", + "sha256:79258a8df3e309a54c7ef2ef4a59bb8e28f7e4a8992a3ad17c24b1889ced44f3", + "sha256:7d74c20b8f1c3e99d3f781d3b8ff5abfefdd7363d61e23bdeba9992ff32cc4b4", + "sha256:81918afeafc16ba5d9d0d4e9445905f21aac969a4ebb6f2bff4b9886da100f4b", + "sha256:8194d913ca1f459377c8a4ed8f9b7ad750068b8e0e3f3f9c6963fcc87a84515f", + "sha256:84d5d31200b11b3c76fab853b89ac898bf2d05c8b3da07c1fcc23feb06359d6e", + "sha256:989981db57abffb52026b114c9a1f114c7142860a6d30a352d28f8cbf186500b", + "sha256:a3d7511d3fad1618a82299aab71a5fceee5c015653a77ffea75ced9ef917e71a", + "sha256:b3ef168d4d6fd4fa6685aef7c91400f59f7ab1c0da734541f7031699741fb23f", + "sha256:c1c5792b6e74bbf2af0f8e892272c2a6c48efa895903211f11b8342e03129fea", + "sha256:c5dcb5a56aebb8a8f2585042b2f5c496d7624f0bcfe248f0cc33ceb2fd8d39e7", + "sha256:e2bed4a04e2ca1050bb5f00865cf2f83c0b92fd62454d9244f690fcd842e27a4", + "sha256:e87a527c06319428007e8c30511e1f0ce035cb7f14bb4793b003ed532c3b9333", + "sha256:f63e420180cbe22ff6e32558b612e75f50616fc111c5e095a4631946c782e109", + "sha256:f8b3d413c5a8f84b12cd4c5df1d8e211777c9852c6be3ee9c094b626644d3eab" ], "index": "pypi", - "version": "==5.1.0" + "version": "==5.2.0" }, "pluggy": { "hashes": [ @@ -115,18 +87,19 @@ "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" ], + "markers": "python_version != '3.0.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*'", "version": "==0.6.0" }, "py": { "hashes": [ - "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881", - "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" + "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", + "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" ], - "version": "==1.5.3" + "markers": "python_version != '3.0.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*'", + "version": "==1.5.4" }, "pycodestyle": { "hashes": [ - "sha256:74abc4e221d393ea5ce1f129ea6903209940c1ecd29e002e8c6933c2b21026e0", "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" ], From 9f8b61f4db6cf3624bd0b340b2839160cded8592 Mon Sep 17 00:00:00 2001 From: Jack Laxson Date: Wed, 22 Aug 2018 12:26:31 -0400 Subject: [PATCH 21/21] add mock to dev deps --- Pipfile | 1 + Pipfile.lock | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 75caecb1..669440ba 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,7 @@ pytest = "==3.5.0" "e1839a8" = {path = ".", editable = true} pillow = "*" pycodestyle = "*" +mock = "*" [requires] python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock index 684f8a43..fd514263 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c17d25376e863d4d6ed749dc887e9fe9a2e67a82ab34ebf6f4e3ef0011d3a5d6" + "sha256": "2e559fdeb474730e9e2c453419cba21ced6b2ef43d344a1e113c670020329e26" }, "pipfile-spec": 6, "requires": { @@ -37,6 +37,14 @@ "editable": true, "path": "." }, + "mock": { + "hashes": [ + "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", + "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" + ], + "index": "pypi", + "version": "==2.0.0" + }, "more-itertools": { "hashes": [ "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", @@ -45,6 +53,13 @@ ], "version": "==4.3.0" }, + "pbr": { + "hashes": [ + "sha256:1b8be50d938c9bb75d0eaf7eda111eec1bf6dc88a62a6412e33bf077457e0f45", + "sha256:b486975c0cafb6beeb50ca0e17ba047647f229087bd74e37f4a7e2cac17d2caa" + ], + "version": "==4.2.0" + }, "pillow": { "hashes": [ "sha256:00def5b638994f888d1058e4d17c86dec8e1113c3741a0a8a659039aec59a83a",