Re: Pagination breaks in ListView after migrating from Django 1.11 to 2.2 with SQLite

2019-04-24 Thread Szabolcs Hodossy
Thanks for the help, I have checked those release notes, but I was not able
to identify the related change (neither subquery nor __in lookup). I wanted
to give you a deeper look into the code, but during that I managed to
isolate the issue. It seems that the '__in' lookups previously accepted
objects and automatically extracted the referenced columns in case of
Foreign Key fields, but that is not valid now. I added `values('id')`
everywhere, and it solved the problem. I am not sure how to feel about this
change, as 'id' is automatically created.

Br,
Szabolcs

On Tue, Apr 23, 2019 at 4:39 PM Simon Charette  wrote:

> I assume you are either using a Subquery annotation that returns
> multiple results or an __in lookup against a query with multiple columns.
>
> I vaguely remember something changed in this area but it was documented
> in one of the 2.0, 2.1 or 2.2 release notes.
>
> Best,
> Simon
>
> Le mardi 23 avril 2019 10:31:43 UTC-4, hodossy...@gmail.com a écrit :
>>
>> Hello,
>>
>> I am facing the following issue after upgrading to 2.2 from 1.11. Here is
>> the stack trace:
>>
>> Traceback (most recent call last):
>>   File "(...)\.env\lib\site-packages\django\db\backends\utils.py", line
>> 84, in _execute
>> return self.cursor.execute(sql, params)
>>   File "(...)\.env\lib\site-packages\django\db\backends\sqlite3\base.py",
>> line 383, in execute
>> return Database.Cursor.execute(self, query, params)
>> sqlite3.OperationalError: only a single result allowed for a SELECT that
>> is part of an expression
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "(...)\dashboard\deployment\tests\test_view.py", line 53, in
>> test_display_list_view
>> response = self.client.get(self.url_my_list)
>>   File "(...)\.env\lib\site-packages\django\test\client.py", line 535, in
>> get
>> response = super().get(path, data=data, secure=secure, **extra)
>>   File "(...)\.env\lib\site-packages\django\test\client.py", line 347, in
>> get
>> **extra,
>>   File "(...)\.env\lib\site-packages\django\test\client.py", line 422, in
>> generic
>> return self.request(**r)
>>   File "(...)\.env\lib\site-packages\django\test\client.py", line 503, in
>> request
>> raise exc_value
>>   File "(...)\.env\lib\site-packages\django\core\handlers\exception.py",
>> line 34, in inner
>> response = get_response(request)
>>   File "(...)\.env\lib\site-packages\django\core\handlers\base.py", line
>> 115, in _get_response
>> response = self.process_exception_by_middleware(e, request)
>>   File "(...)\.env\lib\site-packages\django\core\handlers\base.py", line
>> 113, in _get_response
>> response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>>   File "(...)\.env\lib\site-packages\django\views\generic\base.py", line
>> 71, in view
>> return self.dispatch(request, *args, **kwargs)
>>   File "(...)\.env\lib\site-packages\django\contrib\auth\mixins.py", line
>> 52, in dispatch
>> return super().dispatch(request, *args, **kwargs)
>>   File "(...)\.env\lib\site-packages\django\views\generic\base.py", line
>> 97, in dispatch
>> return handler(request, *args, **kwargs)
>>   File "(...)\.env\lib\site-packages\django\views\generic\list.py", line
>> 157, in get
>> context = self.get_context_data()
>>   File "(...)\dashboard\deployment\views.py", line 53, in get_context_data
>> context = super().get_context_data(**kwargs)
>>   File "(...)\.env\lib\site-packages\django\views\generic\list.py", line
>> 119, in get_context_data
>> paginator, page, queryset, is_paginated =
>> self.paginate_queryset(queryset, page_size)
>>   File "(...)\.env\lib\site-packages\django\views\generic\list.py", line
>> 69, in paginate_queryset
>> page = paginator.page(page_number)
>>   File "(...)\.env\lib\site-packages\django\core\paginator.py", line 70,
>> in page
>> number = self.validate_number(number)
>>   File "(...)\.env\lib\site-packages\django\core\paginator.py", line 48,
>> in validate_number
>> if number > self.num_pages:
>>   File "(...)\.env\lib\site-packages\django\utils\functional.py", line
>> 80, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   File "(...)\.env\lib\site-packages\django\core\paginator.py", line 97,
>> in num_pages
>> if self.count == 0 and not self.allow_empty_first_page:
>>   File "(...)\.env\lib\site-packages\django\utils\functional.py", line
>> 80, in __get__
>> res = instance.__dict__[self.name] = self.func(instance)
>>   *File "(...)\.env\lib\site-packages\django\core\paginator.py", line
>> 91, in count*
>> *return c()*
>>   File "(...)\.env\lib\site-packages\django\db\models\query.py", line
>> 392, in count
>> return self.query.get_count(using=self.db)
>>   File "(...)\.env\lib\site-packages\django\db\models\sql\query.py", line
>> 504, in get_count
>> number = obj.get_aggregation(using, ['__count'])['__count']
>>   File "(...)\.env\li

Re: How to use wsgi when using external frame works

2019-04-24 Thread Kasper Laudrup
Hi Saeed,

Saeed Pooladzadeh – Tue, 23. April 2019 22:01
> Thanks for your reply.Can you please explain more and?
> What command should I add?I didn't find
> anything on the web?

I suggest you add all of them. Every possible command you can think of. I'm 
sure it'll solve your problem sooner or later.

If that doesn't help, you could consider trying to explain what you are trying 
to achieve, what you have done, what your problem is and any possible errors 
you are getting.

Until then, just keep adding commands and don't forgot to chang your file once 
in a while as well.

Kind regards,

Kasper Laudrup

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190424072852.Horde.c19r99j3vueELRmm0RrRUP7%40cloud.stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Fwd: Re: How to use wsgi when using external frame works

2019-04-24 Thread Kasper Laudrup




 Forwarded message 
I'm trying to achieve add the instabot to my project for making an Instagram
bot site.
On Wed, Apr 24, 2019 at 11:58 AM Kasper Laudrup  wrote:
> Hi Saeed,

Saeed Pooladzadeh – Tue, 23. April 2019 22:01
> Thanks for your reply.Can you please explain more and?
> What command should I add?I didn't find
> anything on the web?

I suggest you add all of them. Every possible command you can think of. I'm
sure it'll solve your problem sooner or later.

If that doesn't help, you could consider trying to explain what you are trying
to achieve, what you have done, what your problem is and any possible errors
you are getting.

Until then, just keep adding commands and don't forgot to chang your file once
in a while as well.

Kind regards,

Kasper Laudrup

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20190424081450.Horde.2A6q_aUMa4wGiQgZTfYGm1A%40cloud.stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: compute model field by related field

2019-04-24 Thread omar ahmed
ok Derek i used save() instead of return and it works now 
thank you very much 
@receiver(post_save, sender=Match)
def update_club_score(instance, sender, **kwargs):
# club local won
if instance.score_local > instance.score_visitor:
instance.club_local.won += 1
instance.club_local.save()
instance.club_visitor.lost += 1
instance.club_visitor.save()
# club local lost
if instance.score_local < instance.score_visitor:
instance.club_local.lost += 1
instance.club_local.save()
instance.club_visitor.won += 1
instance.club_visitor.save()
# draw
if instance.score_local == instance.score_visitor:
instance.club_local.draw += 1
instance.club_local.save()
instance.club_visitor.draw += 1
instance.club_visitor.save()


On Wednesday, April 24, 2019 at 8:13:05 AM UTC+2, Derek wrote:
>
> Did you add the required decorator before this function?  (The function is 
> not part of the class; its a standalone appearing in the same module.)
>
> Also, you generally don't put returns in the post_save function: but you 
> do need to call save() on the model instance.
>
> Another example here:
>
> https://stackoverflow.com/questions/13014411/django-post-save-signal-implementation
>
> On Tuesday, 23 April 2019 16:31:43 UTC+2, omar ahmed wrote:
>>
>> yes i studied this tutorial before and i added this function to "Club" 
>> class (( Receiver function class )) but it does not affect fields 
>> def teampoints( sender, instance, **kwargs):
>> if instance.score_local > instance.score_visitor:
>> return instance.club_local.won +1 and instance.club_visitor.lost + 1
>> elif instance.score_local < instance.score_visitor:
>> return instance.club_local.lost + 1 and instance.club_visitor.won + 1
>> else:
>> return instance.club_local.draw + 1 and instance.club_visitor.draw + 1
>>
>>
>> On Tuesday, April 23, 2019 at 3:27:28 PM UTC+2, Derek wrote:
>>>
>>> You need to use Django signals to provide a custom "post_save".  There 
>>> is a good tutorial here:
>>>
>>> https://simpleisbetterthancomplex.com/tutorial/2016/07/28/how-to-create-django-signals.html
>>>
>>>
>>> On Monday, 22 April 2019 16:22:19 UTC+2, omar ahmed wrote:

 i put this function in "Match" class :
 def points(self):
 if self.score_local > self.score_visitor:
 return (self.club_local.won)+1 and (self.club_visitor.lost)+1
 elif self.score_local < self.score_visitor:
 return (self.club_local.lost)+1 and (self.club_visitor.won)+1
 else:
 return (self.club_local.draw)+1 and (self.club_visitor.draw)+1
 and i want it to update fields and 'CalcPoints' function in "Club" 
 class 
 class Club(models.Model):
 ...
 def CalcPoints(self):
 return self.won*3 + self.draw

 but until now it does not update objects (( how can i use post_save 
 here )) 

 On Saturday, April 20, 2019 at 9:09:01 AM UTC+2, Derek wrote:
>
> That should just require a basic if/then logic test; "get" the correct 
> Club object, update the win/loss field and save the Club. Repeat for both 
> Clubs.
>
> On Thursday, 18 April 2019 14:09:41 UTC+2, omar ahmed wrote:
>>
>> thank you for response , derek
>> but how can i increment 'win' 'lost' or 'draw' Club fields by 
>> 'winner' Match field
>>
>> On Wednesday, April 17, 2019 at 3:26:22 PM UTC+2, Derek wrote:
>>>
>>> 1. Add a "winner" field to your Match
>>> 2. Implement a post_save  signal for the Match model that updates 
>>> the "won" or "lost" fields for each Club in the match (simple if/then 
>>> logic 
>>> based on winner).
>>>
>>> PS I think the default values for "won" and "lost" for a Club should 
>>> be "0" and not "1".
>>>
>>> On Tuesday, 16 April 2019 20:19:34 UTC+2, omar ahmed wrote:

 hello ... i have two models "Club" class and "Match" class and it 
 has foreign key to Club
 now i want to increment "won" field (or draw or lost) in "Club" 
 class by "score_local" and "score_visitor" in "Match" class ..
 how can i do this
 class Club(models.Model):
 name = models.CharField(max_length=100)
 won = models.IntegerField(default=1)
 draw = models.IntegerField(default=1)
 lost = models.IntegerField()
 goal_for = models.IntegerField()
 goal_against = models.IntegerField()


 class Match(models.Model):
 play_date = models.DateTimeField('play date')
 club_visitor = models.ForeignKey(Club, on_delete=models.CASCADE, 
 related_name='match_club_visitor')
 club_local = models.ForeignKey(Club, on_delete=models.CASCADE, 
 related_name='match_club_local')
 score_visitor = models.IntegerField()
 score_local = models.IntegerField()

>>>

-- 
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-us

Re: Don`t start server

2019-04-24 Thread Suresh Kannan
Hi,

Hope this helps.

>>>*django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is
required (found 3.7.17).*

https://stackoverflow.com/questions/55512244/no-installed-app-with-label-admin-in-empty-django-2-2-project

On Tue, Apr 23, 2019 at 3:10 PM TAIT_MIZO  wrote:

> (steam_trader) -bash-4.2$ python manage.py runserver
> Watching for file changes with StatReloader
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/opt/komtet/python35/lib/python3.5/threading.py", line 914, in
> _bootstrap_inner
> self.run()
>   File "/opt/komtet/python35/lib/python3.5/threading.py", line 862, in run
> self._target(*self._args, **self._kwargs)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/utils/autoreload.py",
> line 54, in wrapper
> fn(*args, **kwargs)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/core/management/commands/runserver.py",
> line 109, in inner_run
> autoreload.raise_last_exception()
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/utils/autoreload.py",
> line 77, in raise_last_exception
> raise _exception[0](_exception[1]).with_traceback(_exception[2])
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/utils/autoreload.py",
> line 54, in wrapper
> fn(*args, **kwargs)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/__init__.py",
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/apps/registry.py",
> line 114, in populate
> app_config.import_models()
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/apps/config.py",
> line 211, in import_models
> self.models_module = import_module(models_module_name)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in
> _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 673, in exec_module
>   File "", line 222, in
> _call_with_frames_removed
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/contrib/auth/models.py",
> line 2, in 
> from django.contrib.auth.base_user import AbstractBaseUser,
> BaseUserManager
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/contrib/auth/base_user.py",
> line 47, in 
> class AbstractBaseUser(models.Model):
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/models/base.py",
> line 117, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/models/base.py",
> line 321, in add_to_class
> value.contribute_to_class(cls, name)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/models/options.py",
> line 204, in contribute_to_class
> self.db_table = truncate_name(self.db_table,
> connection.ops.max_name_length())
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/__init__.py",
> line 28, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/utils.py",
> line 201, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/utils.py",
> line 110, in load_backend
> return import_module('%s.base' % backend_name)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py",
> line 66, in 
> check_sqlite_version()
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py",
> line 63, in check_sqlite_version
> raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found
> %s).' % Database.sqlite_version)
> *django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is
> required (found 3.7.17).*
>
> Traceback (most recent call last):
>   File
> "/var/www/coulinw8/data/steam_trader/lib/python3.5/site-packages/django/apps/registry.py",
> line 155, in get_app_config
> return self.app_configs[app_label]
> KeyError: 'admin'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> main()
>   File "manage.py", line 17, in main
> execute_from_command_

Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Joel Mathew
Just do it. The API has python sample code.
Sincerely yours,

 Joel G Mathew



On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:

> Hello friends.
>
> I am going to integrate google calendar API in to my TODO List.
> can anyone suggest how to integrate so that when I will add any event in
> my TODO List app it will directly show in my google calendar.
>
> 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/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Django TidyFields

2019-04-24 Thread chris
Hi folks, 

This is a short message to announce the first release of Django TidyFields: [ 
https://pypi.org/project/django-tidyfields/ | 
https://pypi.org/project/django-tidyfields/ ] 

Django TidyFields is a set of text input fields, (currently CharField and 
TextField are subclassed) which sanitize user input on model save. This allows 
them to work with Django views or apis, including Django Rest Framework. 

The fields leverage lxml's Cleaner under the hood, so they are quite 
configurable for your needs. The fields are also tested against the OWASP XSS 
filter evasion cheat sheet methods. In the initial release 30 different attacks 
are tested, and the rest will be added in the next version. 

Future plans include adding form fields with integration support for WYSIWYG 
libraries like django-summernote. 

I hope you find the module useful, 

Chris Routh 
Github: Routhinator 

-- 
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/380841987.20542.1556119040704.JavaMail.zimbra%40routh.io.
For more options, visit https://groups.google.com/d/optout.


Re: Which app for minio (s3) storage server?

2019-04-24 Thread guettli
just for the records. I took minio and it works fine since some weeks now 
the first weeks.

Am Freitag, 22. März 2019 15:49:36 UTC+1 schrieb guettli:
>
> Up to now all my projects worked with the basic file storage.
>
> Now I want use a s3 like storage server for the first time.
>
> The server implementation will be minio (not aws)
>
> I see three apps:
>
>   https://github.com/py-pa/django-minio-storage
>
>   https://github.com/etianen/django-s3-storage
>
>   https://github.com/jschneier/django-storages
>
> Do you have an advice which one could fit?
>
> Binary data with size of up to 100MBytes will get uploaded.
>
> Regards,
>   Thomas Güttler
>

-- 
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/071022f3-c474-41ed-b694-7d0845473caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 error when posting a multipart/form-data form

2019-04-24 Thread Manlio Perillo
On Thursday, March 21, 2019 at 10:28:30 AM UTC+1, Manlio Perillo wrote:
>
> I have a Django application that works perfectly fine both on my PC and on 
> a hosting system with CloudLinux and Passenger.
> However when I added a form with a file field, I started to get 404 errors 
> on POST.
>
> I tried to remove all the middleware, but the problem is still here.
> The error message says that the 404 error was raised by my view, but 
> that's not true; my view is not called at all during a POST request.
>
> What's strange is that I have another Django application on a different 
> hosting account with the same environment and it works fine.
> The problem is probably in my application, but I'm unable to find it.
>
> Where should I search to find the cause of the problem?
>
>
The problem was caused by Passenger.
https://stackoverflow.com/questions/49594955/django-1-11-on-passenger-wsgi-not-routing-post-request?rq=1

Unlike the case from the stackoverflow question, in my case PATH_INFO was 
incorrectly set only for POST requests containing files.
The fix suggested solved the problem.


Regards
Manlio Perillo

-- 
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/6ce75e7b-6f3c-4c3a-a636-186d4de52d75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.11.X - csrf hints when using requests to make direct view requests over https

2019-04-24 Thread Michael McDaniels
When using the requests module to construct Django view requests over 
https, insure you use lower case in your ALLOWED_HOSTS and/or 
CSRF_TRUSTED_ORIGINS in settings.py. The module 'django.middleware.csrf' 
calls 'is_same_domain()' from 'django.utils.http' which does a 'lower()' on 
the host portion only, but the 'netloc' field of the referer object is 
extracted from the full domain name and remains upper case. In the host 
naming convention, case is irrelevant. However, this simple mistake in your 
configuration since 'is_same_domain()' does not correct both strings before 
comparison, may result in the REASON_BAD_REFERER error.

-- 
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/f4f4ec1f-ffb4-4ed8-9d49-a8f82c264488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Sipum Mishra
Joel, i know there is python code for yhat API but how to integrate it.. I
want to know that.. I tried to do but failed.

On Wed, 24 Apr, 2019, 6:55 PM Joel Mathew,  wrote:

> Just do it. The API has python sample code.
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:
>
>> Hello friends.
>>
>> I am going to integrate google calendar API in to my TODO List.
>> can anyone suggest how to integrate so that when I will add any event in
>> my TODO List app it will directly show in my google calendar.
>>
>> 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/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%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/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Google calendar API in TODO list

2019-04-24 Thread Joel Mathew
I fail to see what's your difficulty in integrating this. You just insert
the code in your views, and display your processed result in your template.
Try writing code and post your error. There's no specific code needed just
for django.

If it failed, post your code with the error stream.

On Wed, 24 Apr, 2019, 10:59 PM Sipum Mishra,  wrote:

> Joel, i know there is python code for yhat API but how to integrate it.. I
> want to know that.. I tried to do but failed.
>
> On Wed, 24 Apr, 2019, 6:55 PM Joel Mathew,  wrote:
>
>> Just do it. The API has python sample code.
>> Sincerely yours,
>>
>>  Joel G Mathew
>>
>>
>>
>> On Tue, 23 Apr 2019 at 09:58, Sipum  wrote:
>>
>>> Hello friends.
>>>
>>> I am going to integrate google calendar API in to my TODO List.
>>> can anyone suggest how to integrate so that when I will add any event in
>>> my TODO List app it will directly show in my google calendar.
>>>
>>> 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/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%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/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%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/CAA%3Diw_8adPwu6_OoeCieERW9eNzcvzbP6D_2B7ntvghE7TxQLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Integrating Google calendar API in TODO list

2019-04-24 Thread Matthew Pava
Dr. Joel, I think Sipum doesn’t even know how to begin.
So Sipum, take a look at this document:
https://developers.google.com/calendar/quickstart/python


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Joel Mathew
Sent: Wednesday, April 24, 2019 2:07 PM
To: django-users@googlegroups.com
Subject: Re: Integrating Google calendar API in TODO list

I fail to see what's your difficulty in integrating this. You just insert the 
code in your views, and display your processed result in your template. Try 
writing code and post your error. There's no specific code needed just for 
django.

If it failed, post your code with the error stream.
On Wed, 24 Apr, 2019, 10:59 PM Sipum Mishra, 
mailto:sipu...@gmail.com>> wrote:
Joel, i know there is python code for yhat API but how to integrate it.. I want 
to know that.. I tried to do but failed.

On Wed, 24 Apr, 2019, 6:55 PM Joel Mathew, mailto:j...@joel.su>> 
wrote:
Just do it. The API has python sample code.
Sincerely yours,
 Joel G Mathew



On Tue, 23 Apr 2019 at 09:58, Sipum 
mailto:sipu...@gmail.com>> wrote:
Hello friends.

I am going to integrate google calendar API in to my TODO List.
can anyone suggest how to integrate so that when I will add any event in my 
TODO List app it will directly show in my google calendar.

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/ebbfbf68-4445-4146-9e49-c18041796343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_9UTM0izFDbwcGMDxGPZaUHSy9r9L90cEkYA0Vc0JDAmQ%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/CAGHZBzxv28c%3Db8MQEnXiGVY9pM6rj-u%3DwEr1VOVYMNYcZSbCVw%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/CAA%3Diw_8adPwu6_OoeCieERW9eNzcvzbP6D_2B7ntvghE7TxQLA%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 o

Blog sharing

2019-04-24 Thread Soumen Khatua
Hi folks,

I want to make on blogger website and I want to share them with social
media's timeline like Facebook, instragam, twitter etc. But for each post
generate the embed code is little bit time consuming. So how I can write a
script where for each post can be redirect to Facebook or twitter Web site.
If anyone have this type of code please share with me.

Thank you guys.

Soumen
Regards,

-- 
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/CAPUw6WbjhfjZ6bY8xU4u%3DEBs1AnbDxHJZ-nwPn7m37KZEJX3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog sharing

2019-04-24 Thread Makori Breens
Easy, there are several automatic sharing services out there...some free

On Wed, Apr 24, 2019, 10:41 PM Soumen Khatua 
wrote:

> Hi folks,
>
> I want to make on blogger website and I want to share them with social
> media's timeline like Facebook, instragam, twitter etc. But for each post
> generate the embed code is little bit time consuming. So how I can write a
> script where for each post can be redirect to Facebook or twitter Web site.
> If anyone have this type of code please share with me.
>
> Thank you guys.
>
> Soumen
> Regards,
>
> --
> 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/CAPUw6WbjhfjZ6bY8xU4u%3DEBs1AnbDxHJZ-nwPn7m37KZEJX3HQ%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/CAOz9w2FN%2BrSg_tDNLF2HMZDOaxdgbWUR%2BK%2BvY0tt0aurBmyAmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog sharing

2019-04-24 Thread Nitesh Saini
By using http request you can store content of your blog and create a bot
which will use Instagram api, Twitter api etc and can upload your blog.

On Thu, 25 Apr 2019, 1:42 am Makori Breens  Easy, there are several automatic sharing services out there...some free
>
> On Wed, Apr 24, 2019, 10:41 PM Soumen Khatua 
> wrote:
>
>> Hi folks,
>>
>> I want to make on blogger website and I want to share them with social
>> media's timeline like Facebook, instragam, twitter etc. But for each post
>> generate the embed code is little bit time consuming. So how I can write a
>> script where for each post can be redirect to Facebook or twitter Web site.
>> If anyone have this type of code please share with me.
>>
>> Thank you guys.
>>
>> Soumen
>> Regards,
>>
>> --
>> 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/CAPUw6WbjhfjZ6bY8xU4u%3DEBs1AnbDxHJZ-nwPn7m37KZEJX3HQ%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/CAOz9w2FN%2BrSg_tDNLF2HMZDOaxdgbWUR%2BK%2BvY0tt0aurBmyAmw%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/CAGP%2BSDMyL8aLHK8aAvK3EyeMatedvje_TudX5OrapRmHeJrRwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advanced permissions and role creation

2019-04-24 Thread Mike Dewhirst

On 23/04/2019 9:22 pm, Balaji Shetty wrote:

Hi

Did you get any particular solution. I am also facing the same 
problem. My project also have same requirement.


I think this problem must have been faced by every dveloper.

Can you please share the solution or any useful internet resource .


class UserProfile(models.Model):

    user = models.OneToOneField(User, related_name='userprofile',

    on_delete=models.CASCADE)

    company = models.ForeignKey('Company', null=True, blank=True,

    on_delete=models.CASCADE,

    help_text='Each user may only be associated with '

    'one company.')

*...*

    def __str__(self):

    grps = u''

    superuser = u''

    if self.user.is_staff:

    superuser = u' [Staff]'

    if self.user.is_superuser:

    superuser = u' [Superuser]'

    if not self.user.is_active:

    superuser += u' [Inactive]'

    groups = Group.objects.filter(user=self.user).order_by('name')

    if groups:

    grps = u', '.join(x.name for x in groups)

    if grps:

    grps = u' (%s)' % grps

    grps += superuser

    return u'%s%s' % (self.user, grps)

And in company admin.py

class CompanyAdmin(admin.ModelAdmin):

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #
    def get_queryset(self, request):
    qs = super(CompanyAdmin, self).get_queryset(request)
    if request.user.is_superuser:
    return qs
    coy = get_user_company(request)
    if coy:
    return qs.filter(
    Q(id=coy.id)
    ).distinct()
    #
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

And imported from common utils ...

def get_user_company(request): """Return the company of which the user 
is a member. Company is kept in the UserProfile fk company. Typically 
used in get_queryset.filter() calls made in various places to restrict a 
user's view to things owned by that user's company. """ profile = 
get_userprofile(request) if profile: try: return profile.company except 
Exception: # happens on deleting the company pass  def 
get_userprofile(request): """Return the userprofile from a user or 
request""" from company.models import UserProfile # avoid circular 
imports if isinstance(request, User): usr = request else: usr = 
request.user if usr: try: return UserProfile.objects.get(user=usr) 
except Exception: # happens on deleting the user pass


And determining which fields are readonly depending on group membership 
is a matter of writing a callable which replaces 
ModelAdmin.get_readonly_fields and for which you need ...


def is_member(user, name): return user.groups.filter(name=name).exists() 
# or user.is_superuser


hth





On Sun, Apr 21, 2019 at 4:37 PM Joel Mathew > wrote:


Thanks a lot, guys.

On Sun, 21 Apr, 2019, 3:58 PM Jani Tiainen, mailto:rede...@gmail.com>> wrote:

Hi,

We do in our applications pretty much same approach as Mike
proposed in his post. It's relatively efficient and works for
both, UI and application side pretty well and doesn't require
building anything complex and pretty much everything you need
is already built-in in Django.



On Sun, Apr 21, 2019 at 5:12 AM Joel Mathew mailto:j...@joel.su>> wrote:

I have an application for a hospital. There, I should be
able to assign different roles like Doctor, Nurse,
Attender, Auxillary Nurse, Pharmacist, Store Manager etc,
each of would be having specific access to seperate areas
(views), with some having restricted access. In addition,
there are other hospitals who would be having no access to
another hospital's records. All of these permissions
should be customisable, and I should be able to create
additional roles and permission groups for specific areas
later (from within the application itself, in production).
What would be the best solution to use? Is there a
middleware which works well. I don't want to roll my own
if I will be reinventing the wheel.

Currently my application has no use permissions. But
access to specific hospitals is being restricted by a
model whoch stores hospital name, and user name.
Sincerely yours,

 Joel G Mathew

-- 
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
.
  

Re: Blog sharing

2019-04-24 Thread Soumen Khatua
Can you share any link related to these concept???

On Thu, 25 Apr 2019, 01:42 Makori Breens,  wrote:

> Easy, there are several automatic sharing services out there...some free
>
> On Wed, Apr 24, 2019, 10:41 PM Soumen Khatua 
> wrote:
>
>> Hi folks,
>>
>> I want to make on blogger website and I want to share them with social
>> media's timeline like Facebook, instragam, twitter etc. But for each post
>> generate the embed code is little bit time consuming. So how I can write a
>> script where for each post can be redirect to Facebook or twitter Web site.
>> If anyone have this type of code please share with me.
>>
>> Thank you guys.
>>
>> Soumen
>> Regards,
>>
>> --
>> 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/CAPUw6WbjhfjZ6bY8xU4u%3DEBs1AnbDxHJZ-nwPn7m37KZEJX3HQ%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/CAOz9w2FN%2BrSg_tDNLF2HMZDOaxdgbWUR%2BK%2BvY0tt0aurBmyAmw%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/CAPUw6WaxNuUVcb8c9u7516HhzcdKKnWDAvEhKyRHmgbXRTDEHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog sharing

2019-04-24 Thread Soumen Khatua
I know I can do that by using api. Do you have any source code for that?

On Thu, 25 Apr 2019, 05:20 Nitesh Saini,  wrote:

> By using http request you can store content of your blog and create a bot
> which will use Instagram api, Twitter api etc and can upload your blog.
>
> On Thu, 25 Apr 2019, 1:42 am Makori Breens 
>> Easy, there are several automatic sharing services out there...some free
>>
>> On Wed, Apr 24, 2019, 10:41 PM Soumen Khatua 
>> wrote:
>>
>>> Hi folks,
>>>
>>> I want to make on blogger website and I want to share them with social
>>> media's timeline like Facebook, instragam, twitter etc. But for each post
>>> generate the embed code is little bit time consuming. So how I can write a
>>> script where for each post can be redirect to Facebook or twitter Web site.
>>> If anyone have this type of code please share with me.
>>>
>>> Thank you guys.
>>>
>>> Soumen
>>> Regards,
>>>
>>> --
>>> 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/CAPUw6WbjhfjZ6bY8xU4u%3DEBs1AnbDxHJZ-nwPn7m37KZEJX3HQ%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/CAOz9w2FN%2BrSg_tDNLF2HMZDOaxdgbWUR%2BK%2BvY0tt0aurBmyAmw%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/CAGP%2BSDMyL8aLHK8aAvK3EyeMatedvje_TudX5OrapRmHeJrRwA%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/CAPUw6WYwLvbbny6JROHU%3D-c4kJkSOyvjFNhvKimW%3DY8jkP_wkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


CSRF Verification fails in production for Cross Domain POST request

2019-04-24 Thread suresh
The HTTP_X_CSRFTOKEN header does not match what is inside the csrftoken 
cookie.


How can I examine the cookie? Set-Cookie is not displayed in the 
Response header for Cross Domain requests.


I have already followed instructions found in:

https://stackoverflow.com/questions/39254562/csrf-with-django-reactredux-using-axios

Interestingly I found "X-CSRFTOKEN" translates to "HTTP_X_CSRFTOKEN" on 
the server request header.


Thanks for any help.

Suresh

--
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/q9rj8u%24nlf%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.