Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Gerald Brown
I use pyvenvwrapper which I find is even better than pyenv.  Once a 
project is created just enter "workon proj-name" and it will take you to 
the project directory.  It can be found at: 
https://github.com/solovyevn/pyvenvwrapper



On Sunday, 22 July, 2018 10:30 AM, mottaz hejaze wrote:

thats why they invented virtualenv

On Sat, 21 Jul 2018, 19:36 Melvyn Sopacua, > wrote:


On zaterdag 21 juli 2018 19:08:03 CEST Asif Khan wrote:

> Oh dear I checked and found that Pillow was install in Python3.5
where as

> production setup is for Python3.6 so Pillow was installed by
pip3.5 but not

> with pip3.6 which I have installed now.

Have a look at pyenv . Relying on
"versioned commands" goes wrong too often.

-- 


Melvyn Sopacua

-- 
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/1932017.Pnh1MIuky5%40fritzbook

.
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/CAHV4E-eF%3D3XqH0gf-Y-V7FpsTgc3fN6FzaMkTh26OHuHm6Sy5A%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/edd2e894-b136-6834-1f7c-ff7d60dfc650%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread mottaz hejaze
thats why they invented virtualenv

On Sat, 21 Jul 2018, 19:36 Melvyn Sopacua,  wrote:

> On zaterdag 21 juli 2018 19:08:03 CEST Asif Khan wrote:
>
> > Oh dear I checked and found that Pillow was install in Python3.5 where as
>
> > production setup is for Python3.6 so Pillow was installed by pip3.5 but
> not
>
> > with pip3.6 which I have installed now.
>
>
>
> Have a look at pyenv . Relying on
> "versioned commands" goes wrong too often.
>
>
>
> --
>
> Melvyn Sopacua
>
> --
> 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/1932017.Pnh1MIuky5%40fritzbook
> 
> .
> 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/CAHV4E-eF%3D3XqH0gf-Y-V7FpsTgc3fN6FzaMkTh26OHuHm6Sy5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-21 Thread Jason
its COOKIES, not HTTP_COOKIE, as at 
https://docs.djangoproject.com/en/2.0/ref/request-response/#django.http.HttpRequest.COOKIES

-- 
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/9cf801ee-597b-4e9a-9f58-765dc58bf2f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-21 Thread need_some_help
Thank you Melvyn for your time and response. Regardless of what I call the 
first parameter, shouldn't HTTP_COOKIE be in it? But yes, I am having some 
confusion about wsgi and django and maybe I am mixing tutorials/information 
I have found at different sources.

I have had to reach out to other sources, perhaps the information I 
provided at the following link can help us figure out what I'm doing 
completely wrong:
https://groups.google.com/forum/#!topic/comp.lang.python/s47xpBs1714

-- 
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/85d9eb88-0bfd-44e7-8ff5-516d2d928a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-21 Thread need_some_help
Thank you Melvyn for your time and response. Regardless of what I call the 
first parameter, shouldn't HTTP_COOKIE be in it?

I have had to reach out to other sources, perhaps the information I 
provided at the following link can help us figure out what I'm doing 
completely wrong:
https://groups.google.com/forum/#!topic/comp.lang.python/s47xpBs1714

-- 
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/93dafaaa-66cc-4557-91b9-403435c825f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with FilteredSelectMultiple

2018-07-21 Thread Melvyn Sopacua
On zaterdag 21 juli 2018 14:38:11 CEST Ike wrote:
> Good day everyone, I've been stuck with a problem I am having and I can't
> find any help online.

Even though you've done much effort to make a good problem description, you're 
still making us do a lot of work before we can diagnose your issue:

- imports are missing from code
- used modules (requirements.txt) are missing (where is FilteredSelectWidget 
from)
- get_success_url isn't properly indented
- the entire save code is missing (form_valid is not implemented)

It's much easier to either open source your project or setup an test project 
that actually works and has either a setup.py or requirements.txt, since this 
touches on several issues.

It's also completely unclear why you think you have to use function based 
views.

If what you really want is to have a save done as soon as a name enters or is 
removed from the box on the right, then the scope just increased tremendously 
and you need to grow frontend skills.

Otherwise, things just work out of the box (upon form submission, you can call 
form.save() in Formview.is_valid()) or the widget isn't worth it's salt.
-- 
Melvyn Sopacua

-- 
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/3656193.5LaPkouizu%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Melvyn Sopacua
On zaterdag 21 juli 2018 19:08:03 CEST Asif Khan wrote:
> Oh dear I checked and found that Pillow was install in Python3.5 where as
> production setup is for Python3.6 so Pillow was installed by pip3.5 but not
> with pip3.6 which I have installed now.

Have a look at pyenv[1]. Relying on "versioned commands" goes wrong too 
often.

-- 
Melvyn Sopacua


[1] https://github.com/pyenv/pyenv

-- 
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/1932017.Pnh1MIuky5%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Asif Khan
Oh dear I checked and found that Pillow was install in Python3.5 where as 
production setup is for Python3.6 so Pillow was installed by pip3.5 but not 
with pip3.6 which I have installed now. the problem is resolved. Thanks for 
make me focus on this.

On Saturday, July 21, 2018 at 9:58:55 PM UTC+5, Jason wrote:
>
> are you sure?
>
> open up a python shell on the server and do from *PIL import image*  If 
> it works, then the problem is somewhere else.  If you get an error, its a 
> missing dependency.
>

-- 
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/cfe2d4f2-e404-4e3c-b06c-9095d2450dd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Jason
are you sure?

open up a python shell on the server and do from *PIL import image*  If it 
works, then the problem is somewhere else.  If you get an error, its a 
missing dependency.

-- 
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/9e732e34-cb2c-4a1f-adef-800f62328247%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Asif Khan
Pillow is install in my production environment and the same Pillow 5.2.0 on 
both development and production. 

On Saturday, July 21, 2018 at 9:39:36 PM UTC+5, Jason wrote:
>
> sounds like pillow wasn't installed in your prod environment.  how did you 
> set that servcer up?
>
>
>
> On Saturday, July 21, 2018 at 11:56:12 AM UTC-4, Asif Khan wrote:
>>
>> I developed application that uses an ImageField in Django==2.0.7 with 
>> Pillow 5.2.0 there is no issue on development machine but facing problem on 
>> production server giving "Server Error 500" 
>> Exception Value: No module named 'PIL' which I have not used or called in 
>> my code. I new to Python and Django but seems to me is Django or Pillow 
>> problem. If I am not wrong.
>>
>> the following DEBUG=False production detail 
>> Internal Server Error: /admin/vv/institutes/add/
>>
>> ModuleNotFoundError at /admin/vv/institutes/add/
>> No module named 'PIL'
>>
>> Request Method: POST
>> Request URL: http://asifkhan69.webfactional.com/admin/vv/institutes/add/
>> Django Version: 2.0.7
>> Python Executable: /usr/local/bin/python3
>> Python Version: 3.6.6
>> Python Path: ['/home/asifkhan69/webapps/rmsapp', 
>> '/home/asifkhan69/webapps/rmsapp/src', 
>> '/home/asifkhan69/webapps/rmsapp/lib/python3.6', 
>> '/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg', 
>> '/home/asifkhan69/webapps/rmsapp/lib/python3.6/pytz-2018.5-py3.6.egg', 
>> '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', 
>> '/usr/local/lib/python3.6/lib-dynload', 
>> '/usr/local/lib/python3.6/site-packages']
>> Server time: Sat, 21 Jul 2018 13:16:26 +
>> Installed Applications:
>> ['django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'accounts',
>> 'vv']
>> Installed 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']
>>
>>
>> Traceback:
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/exception.py"
>>  
>> in inner
>>   35. response = get_response(request)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
>>  
>> in _get_response
>>   128. response = self.process_exception_by_middleware(e, 
>> request)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
>>  
>> in _get_response
>>   126. response = wrapped_callback(request, 
>> *callback_args, **callback_kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>>  
>> in wrapper
>>   575. return self.admin_site.admin_view(view)(*args, 
>> **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>>  
>> in _wrapped_view
>>   142. response = view_func(request, *args, **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/views/decorators/cache.py"
>>  
>> in _wrapped_view_func
>>   44. response = view_func(request, *args, **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/sites.py"
>>  
>> in inner
>>   223. return view(request, *args, **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>>  
>> in add_view
>>   1554. return self.changeform_view(request, None, form_url, 
>> extra_context)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>>  
>> in _wrapper
>>   62. return bound_func(*args, **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>>  
>> in _wrapped_view
>>   142. response = view_func(request, *args, **kwargs)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>>  
>> in bound_func
>>   58. return func.__get__(self, type(self))(*args2, 
>> **kwargs2)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>>  
>> in changeform_view
>>   1451. return self._changeform_view(request, object_id, 
>> form_url, extra_context)
>>
>> File 
>> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/adm

Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Jason
sounds like pillow wasn't installed in your prod environment.  how did you 
set that servcer up?



On Saturday, July 21, 2018 at 11:56:12 AM UTC-4, Asif Khan wrote:
>
> I developed application that uses an ImageField in Django==2.0.7 with 
> Pillow 5.2.0 there is no issue on development machine but facing problem on 
> production server giving "Server Error 500" 
> Exception Value: No module named 'PIL' which I have not used or called in 
> my code. I new to Python and Django but seems to me is Django or Pillow 
> problem. If I am not wrong.
>
> the following DEBUG=False production detail 
> Internal Server Error: /admin/vv/institutes/add/
>
> ModuleNotFoundError at /admin/vv/institutes/add/
> No module named 'PIL'
>
> Request Method: POST
> Request URL: http://asifkhan69.webfactional.com/admin/vv/institutes/add/
> Django Version: 2.0.7
> Python Executable: /usr/local/bin/python3
> Python Version: 3.6.6
> Python Path: ['/home/asifkhan69/webapps/rmsapp', 
> '/home/asifkhan69/webapps/rmsapp/src', 
> '/home/asifkhan69/webapps/rmsapp/lib/python3.6', 
> '/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg', 
> '/home/asifkhan69/webapps/rmsapp/lib/python3.6/pytz-2018.5-py3.6.egg', 
> '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', 
> '/usr/local/lib/python3.6/lib-dynload', 
> '/usr/local/lib/python3.6/site-packages']
> Server time: Sat, 21 Jul 2018 13:16:26 +
> Installed Applications:
> ['django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'accounts',
> 'vv']
> Installed 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']
>
>
> Traceback:
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/exception.py"
>  
> in inner
>   35. response = get_response(request)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
>  
> in _get_response
>   128. response = self.process_exception_by_middleware(e, 
> request)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
>  
> in _get_response
>   126. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>  
> in wrapper
>   575. return self.admin_site.admin_view(view)(*args, 
> **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>  
> in _wrapped_view
>   142. response = view_func(request, *args, **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/views/decorators/cache.py"
>  
> in _wrapped_view_func
>   44. response = view_func(request, *args, **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/sites.py"
>  
> in inner
>   223. return view(request, *args, **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>  
> in add_view
>   1554. return self.changeform_view(request, None, form_url, 
> extra_context)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>  
> in _wrapper
>   62. return bound_func(*args, **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>  
> in _wrapped_view
>   142. response = view_func(request, *args, **kwargs)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
>  
> in bound_func
>   58. return func.__get__(self, type(self))(*args2, 
> **kwargs2)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>  
> in changeform_view
>   1451. return self._changeform_view(request, object_id, 
> form_url, extra_context)
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
>  
> in _changeform_view
>   1483. if form.is_valid():
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/forms/forms.py"
>  
> in is_valid
>   179. return self.is_bound and not self.errors
>
> File 
> "/home/asifkhan69/webapps/rmsapp/lib/

Djando 2.0.7 image handling problem on production server

2018-07-21 Thread Asif Khan
I developed application that uses an ImageField in Django==2.0.7 with 
Pillow 5.2.0 there is no issue on development machine but facing problem on 
production server giving "Server Error 500" 
Exception Value: No module named 'PIL' which I have not used or called in 
my code. I new to Python and Django but seems to me is Django or Pillow 
problem. If I am not wrong.

the following DEBUG=False production detail 
Internal Server Error: /admin/vv/institutes/add/

ModuleNotFoundError at /admin/vv/institutes/add/
No module named 'PIL'

Request Method: POST
Request URL: http://asifkhan69.webfactional.com/admin/vv/institutes/add/
Django Version: 2.0.7
Python Executable: /usr/local/bin/python3
Python Version: 3.6.6
Python Path: ['/home/asifkhan69/webapps/rmsapp', 
'/home/asifkhan69/webapps/rmsapp/src', 
'/home/asifkhan69/webapps/rmsapp/lib/python3.6', 
'/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg', 
'/home/asifkhan69/webapps/rmsapp/lib/python3.6/pytz-2018.5-py3.6.egg', 
'/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', 
'/usr/local/lib/python3.6/lib-dynload', 
'/usr/local/lib/python3.6/site-packages']
Server time: Sat, 21 Jul 2018 13:16:26 +
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'accounts',
'vv']
Installed 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']


Traceback:

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/exception.py"
 
in inner
  35. response = get_response(request)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
 
in _get_response
  128. response = self.process_exception_by_middleware(e, 
request)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/core/handlers/base.py"
 
in _get_response
  126. response = wrapped_callback(request, *callback_args, 
**callback_kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
 
in wrapper
  575. return self.admin_site.admin_view(view)(*args, 
**kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
 
in _wrapped_view
  142. response = view_func(request, *args, **kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/views/decorators/cache.py"
 
in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/sites.py"
 
in inner
  223. return view(request, *args, **kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
 
in add_view
  1554. return self.changeform_view(request, None, form_url, 
extra_context)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
 
in _wrapper
  62. return bound_func(*args, **kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
 
in _wrapped_view
  142. response = view_func(request, *args, **kwargs)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/utils/decorators.py"
 
in bound_func
  58. return func.__get__(self, type(self))(*args2, 
**kwargs2)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
 
in changeform_view
  1451. return self._changeform_view(request, object_id, 
form_url, extra_context)

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/contrib/admin/options.py"
 
in _changeform_view
  1483. if form.is_valid():

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/forms/forms.py"
 
in is_valid
  179. return self.is_bound and not self.errors

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/forms/forms.py"
 
in errors
  174. self.full_clean()

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/forms/forms.py"
 
in full_clean
  376. self._clean_fields()

File 
"/home/asifkhan69/webapps/rmsapp/lib/python3.6/Django-2.0.7-py3.6.egg/django/forms/forms.py"
 
in _clean_fields
  392. value = field.clean(value

Re: Help with FilteredSelectMultiple

2018-07-21 Thread Ike
Update: forms.py and designations.html has been updated.
This was the only way I could think of for associating the roles to the 
widget
https://gist.github.com/Yggralith0/293c107bef58203a38a84ad4d5df0802

-- 
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/f096842a-220f-47aa-8315-69bbd5fdd6ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with FilteredSelectMultiple

2018-07-21 Thread Ike
Good day everyone, I've been stuck with a problem I am having and I can't 
find any help online. 

I am trying to assign staffs to a particular role (Moderator, 
Instructor,) using the FilteredSelectMultiple widget (Similar to Django 
Admin's assign permissions/groups). I have managed to display that widget 
on my site already (Each role has its own FSM widget where you select the 
staffs) but I'm not sure how to:

   - Associate the widget to a role
  - I've managed to display the FilteredSelectMultiple widgets on my 
  site, that part is true. However, I'm not sure how to associate that 
widget 
  to its own role. The items in the FSM widget are the staff's name, so 
role 
  is actually empty.
   - How to save into Database
  - When I assign an item to the Chosen box, I want that to be saved to 
  the database. If I remove, I want it to be deleted from the database
  - I'm currently using a FormView and I'm not sure how to do this (Not 
  good with Function based views and am more comfortable with CBVs)
   - How do I have the chosen elements be displayed on the Chosen box the 
   next time a user revisits the page?





Link to my 
code: https://gist.github.com/Yggralith0/1497cd9482e9b0cbd7d3d6a2ea8f977c

-- 
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/5266e48f-c4ba-4523-b5a0-7fff609d9d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


display my images available in one class using another class in webpage

2018-07-21 Thread aditya gupta
 my Code :


class Gallery(models.Model):
GameName=models.CharField(max_length=40)
D_text=models.CharField(max_length=50)
Gime=models.ImageField(upload_to='media/',null=True,blank=True)

class Assassin(models.Model):

Gimage=models.ImageField(upload_to='media/assassin',null=True,blank=True)
imagegallery=models.ForeignKey('Gallery',on_delete='CASCADE')

( In localhost Admin
 imagegallery = Gallery Object 1 )

class Batman(models.Model):
Gimage=models.ImageField(upload_to='media/batman',null=True,blank=True)
imagegallery=models.ForeignKey('Gallery',on_delete='CASCADE')


( In localhost Admin
 imagegallery = Gallery Object 2 )


 How can I link my class "Assassin"  to class "Gallery" object 1 and class
"Batman" to class "Gallery" object 2, so that when I call object 1 of
Gallery in my Html file the images of Assassin class can also be shown.

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


Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-21 Thread Melvyn Sopacua
On donderdag 19 juli 2018 10:34:35 CEST need_some_help wrote:

> I first need to make sure I am accessing them correctly. This is as simple
> as it gets I imagine:
> 
> view.py:
> 
> def index(environ, start_response, request):
> if not 'HTTP_COOKIE' in environ:
> response = HttpResponse("hello")
> response.set_cookie('user_agreement', 'cookie text',
> domain='.mysite.com')
> return response
> else:
> print environ['HTTP_COOKIE']
> 
> The webpage just prints 'hello' and never reaches the else not matter how
> many times I refresh the page. There are no cookies in the browser ever
> either.
> 
> Am I missing some middleware?

No, you have the wrong assumption about a view method's signature. The first 
argument 
is always the request, as in django.http.HttpRequest or more specifically, it's 
subclass 
django.core.handlers.WSGIRequest in the case of WSGI.
You're not writing a WSGI handler (who has environ as first argument). A view 
is two stops 
down and to give you the complete onion:
WSGI Handler -> Middleware -> view -> Middleware -> WSGI Handler

Anyway, the cookies are at request.COOKIES as per docs[1].
-- 
Melvyn Sopacua


[1] https://docs.djangoproject.com/en/2.0/ref/request-response/

-- 
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/2658575.uAxzzMfALO%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Django "pub_date" error

2018-07-21 Thread Melvyn Sopacua
On maandag 16 juli 2018 04:52:51 CEST Daniel Tobi Onipe wrote:
> I wrote it exactly as it is in the tutorial...

Maybe that part. But you didn't define the pub_date field on the Question model 
or made a typo in the field name. Go back into models.py and check.

-- 
Melvyn Sopacua

-- 
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/7013073.8a7Clp303q%40fritzbook.
For more options, visit https://groups.google.com/d/optout.