Re: do i need a custom admin app or should i just use django admin?

2019-06-18 Thread Andréas Kühne
I have built a system using django admin for the main interface. It's
doable - however - I wouldn't do it again. The main reason is that getting
things working quickly is easy. You get a simple interface that can do
CRUD. You then add grappelli (or some other system) to get a nicer
interface. And then you start nesting things.

Now your problems start. The admin interface gives you a lot of
functionality out of the box, BUT the problem is that you need to follow
the exact guidelines for this to work. You start working with formsets and
specialcases and it takes a long time to write the code. So the initial
fast setup makes it hard do develop features in the long run.

At least that's my experience.

Regards,

Andréas


Den mån 17 juni 2019 kl 20:31 skrev Rajat Chopra :

> What are the reasons not to use Django Admin?
>
> Also with regards to creating views and giving those views permissions -
> are there any examples someone can point to help illustrate?
>
>
>
> On Monday, June 17, 2019 at 11:40:53 AM UTC-5, James Farris wrote:
>>
>> Think of the Django Admin as a tool for developers or Database Admins.
>> IMO, it should never be used by an end user.  Create views as Andreas
>> mentioned and give those views permissions.
>>
>> On Monday, June 17, 2019 at 4:12:53 AM UTC-7, Arya wrote:
>>>
>>> i'm planning to build a full ecommerce business to business website.
>>> there are several user types.
>>> *premium users need to create products and edit them. they need to
>>> communicate to each other. see statistics and access some premium content.*
>>> do you suggest to user the default django admin? or i'm better off
>>> creating a custom admin app ?
>>>
>> --
> 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/2b4f9ad1-2c29-42ca-b585-3b96e0a07118%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/CAK4qSCdgNuTnMvMU5FpxHD34nAHwgHXyWuYVGX8GkAFXh7VnTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: do i need a custom admin app or should i just use django admin?

2019-06-18 Thread Andréas Kühne
Regarding views and permissions, this is build into class based views. Look
here:
https://docs.djangoproject.com/en/2.2/topics/auth/default/#limiting-access-to-logged-in-users-that-pass-a-test

Regards,

Andréas


Den mån 17 juni 2019 kl 20:31 skrev Rajat Chopra :

> What are the reasons not to use Django Admin?
>
> Also with regards to creating views and giving those views permissions -
> are there any examples someone can point to help illustrate?
>
>
>
> On Monday, June 17, 2019 at 11:40:53 AM UTC-5, James Farris wrote:
>>
>> Think of the Django Admin as a tool for developers or Database Admins.
>> IMO, it should never be used by an end user.  Create views as Andreas
>> mentioned and give those views permissions.
>>
>> On Monday, June 17, 2019 at 4:12:53 AM UTC-7, Arya wrote:
>>>
>>> i'm planning to build a full ecommerce business to business website.
>>> there are several user types.
>>> *premium users need to create products and edit them. they need to
>>> communicate to each other. see statistics and access some premium content.*
>>> do you suggest to user the default django admin? or i'm better off
>>> creating a custom admin app ?
>>>
>> --
> 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/2b4f9ad1-2c29-42ca-b585-3b96e0a07118%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/CAK4qSCe199tRd9%2BUdabed2sHu8a1ewVpLAJnJt2uAyGD8gioXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: do i need a custom admin app or should i just use django admin?

2019-06-18 Thread Andréas Kühne
Sorry - wrong link - look here:

https://docs.djangoproject.com/en/2.2/topics/auth/default/#the-permissionrequiredmixin-mixin

Regards,

Andréas


Den tis 18 juni 2019 kl 10:21 skrev Andréas Kühne <
andreas.ku...@hypercode.se>:

> Regarding views and permissions, this is build into class based views.
> Look here:
>
> https://docs.djangoproject.com/en/2.2/topics/auth/default/#limiting-access-to-logged-in-users-that-pass-a-test
>
> Regards,
>
> Andréas
>
>
> Den mån 17 juni 2019 kl 20:31 skrev Rajat Chopra :
>
>> What are the reasons not to use Django Admin?
>>
>> Also with regards to creating views and giving those views permissions -
>> are there any examples someone can point to help illustrate?
>>
>>
>>
>> On Monday, June 17, 2019 at 11:40:53 AM UTC-5, James Farris wrote:
>>>
>>> Think of the Django Admin as a tool for developers or Database Admins.
>>> IMO, it should never be used by an end user.  Create views as Andreas
>>> mentioned and give those views permissions.
>>>
>>> On Monday, June 17, 2019 at 4:12:53 AM UTC-7, Arya wrote:

 i'm planning to build a full ecommerce business to business website.
 there are several user types.
 *premium users need to create products and edit them. they need to
 communicate to each other. see statistics and access some premium content.*
 do you suggest to user the default django admin? or i'm better off
 creating a custom admin app ?

>>> --
>> 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/2b4f9ad1-2c29-42ca-b585-3b96e0a07118%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/CAK4qSCc_Uk_QGmKP8yAr%2BJF7XM%3D_QayhdmkX6msVfLt-VQhxVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Internal Server Error: /tinymce/compressor/

2019-06-18 Thread Mike Dewhirst

Can anyone point me in the right direction please?

I'm currently switching from ...

    tinymce_lite4 and filebrowser-no-grappelli
to
    django-tinymce, django-grappelli and django-filebrowser

It is running on Ubuntu 18.04, Python3.6 and Django 2.1.

Thanks

Mike

Internal Server Error: /tinymce/compressor/

UnicodeDecodeError at /tinymce/compressor/
'ascii' codec can't decode byte 0xc2 in position 3146: ordinal not in 
range(128)


Request Method: GET
Request URL: 
https://www.sharedtrain.com/tinymce/compressor/?js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en

Django Version: 2.1.9
Python Executable: /usr/bin/python3
Python Version: 3.6.8
Python Path: ['/var/www/train', '/usr/lib/python36.zip', 
'/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', 
'/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']

Server time: Tue, 18 Jun 2019 08:26:39 +
Installed Applications:
['filebrowser',
'grappelli',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'tinymce',
'billing',
'common',
'course',
'credit']
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',
'pwned_passwords_django.middleware.PwnedPasswordsMiddleware']


Traceback:

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py" 
in inner

34. response = get_response(request)

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in 
_get_response

126. response = self.process_exception_by_middleware(e, request)

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in 
_get_response

124. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/dist-packages/tinymce/views.py" in compressor
86. return gzip_compressor(request)

File "/usr/local/lib/python3.6/dist-packages/tinymce/compressor.py" in 
gzip_compressor

129. content.append(get_file_contents('{!s}.js'.format(f)))

File "/usr/local/lib/python3.6/dist-packages/tinymce/compressor.py" in 
get_file_contents

40. return f.read()

File "/usr/lib/python3.6/encodings/ascii.py" in decode
26. return codecs.ascii_decode(input, self.errors)[0]

Exception Type: UnicodeDecodeError at /tinymce/compressor/
Exception Value: 'ascii' codec can't decode byte 0xc2 in position 3146: 
ordinal not in range(128)

Request information:
USER: miked [Superuser]

GET:
js = 'true'
diskcache = 'true'
core = 'true'
suffix = ''
themes = 'advanced'
plugins = 'table,spellchecker,paste,searchreplace'
languages = 'en'

POST: No POST data

FILES: No FILES data

COOKIES:
csrftoken = 
'f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07'

sessionid = 'dgu3ev20h7auh8nec09rjp7sgbfesl0t'

META:
CONTEXT_DOCUMENT_ROOT = '/var/www/train/htdocs/'
CONTEXT_PREFIX = ''
CSRF_COOKIE = 
'f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07'

DOCUMENT_ROOT = '/var/www/train/htdocs/'
GATEWAY_INTERFACE = 'CGI/1.1'
HTTP_ACCEPT = '*/*'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.5'
HTTP_CACHE_CONTROL = 'max-age=0'
HTTP_CONNECTION = 'keep-alive'
HTTP_COOKIE = 
'csrftoken=f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07; 
sessionid=dgu3ev20h7auh8nec09rjp7sgbfesl0t'

HTTP_DNT = '1'
HTTP_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) 
Gecko/20100101 Firefox/67.0'

PATH_INFO = '/tinymce/compressor/'
PATH_TRANSLATED = '/var/www/train/train/wsgii.py/tinymce/compressor/'
QUERY_STRING = 
'js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en'

REQUEST_METHOD = 'GET'
REQUEST_SCHEME = 'https'
REQUEST_URI = 
'/tinymce/compressor/?js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en'

SCRIPT_FILENAME = '/var/www/train/train/wsgii.py'
SCRIPT_NAME = ''
SERVER_PORT = '443'
SERVER_PROTOCOL = 'HTTP/1.1'
SERVER_SIGNATURE = 'Apache/2.4.29 (Ubuntu) Server at 
www.sharedtrain.com Port 443\n'

SERVER_SOFTWARE = 'Apache/2.4.29 (Ubuntu)'
apache.version = '(2, 4, 27)'
mod_wsgi.application_group = '|'
mod_wsgi.callable_object = 'application'
mod_wsgi.enable_sendfile = '0'
mod_wsgi.handler_script = ''
mod_wsgi.ignore_activity = '0'
mod_wsgi.listener_host = ''
mod_wsgi.listener_port = '443'
mod_wsgi.path_info = '/tinymce/compressor/'
mod_wsgi.process_group = ''
mod_wsgi.request_handler = 'wsgi-script'
mod_wsgi.request_id = 'fyk13xxSuY0'
mod_ws

Typical Django Error

2019-06-18 Thread Soumen Khatua
Hi Folks,

After I turnded debug into False and Alowed host=['providedip','*']. It's
showing like this:
mod = import_module(mod_name)
  File "C:\Users\sou\AppData\Local\Programs\Python\Python36\lib\importlib\__
__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'views'

Please help me guys it's urgent.

Thank You


regards,
Soumen

-- 
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/CAPUw6WbAroJcmBD57Vs-Bpw7Q_fRu9FmpAArehC-pkn%2BxJFDrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to create choices/options on the web page

2019-06-18 Thread mollyx09
I've been trying to create a list of options/choices for the user to choose 
from to display different types of graphs(bar/line etc) on the web page 
based on the same data that has been previously entered by me. I couldn't 
find very useful information online to go about this. Could you please help 
me out?

-- 
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/12fdb1a3-2a35-486f-b130-44323e78d14a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Typical Django Error

2019-06-18 Thread bharat pamnani
Its basically a file importing error from model thats why your view is
showing error and saying No module name views check your importing file and
make sure that file which you are importing is using in your program. I am
sure it will fix the problem.



On Tue, Jun 18, 2019 at 3:46 PM Soumen Khatua 
wrote:

> Hi Folks,
>
> After I turnded debug into False and Alowed host=['providedip','*']. It's
> showing like this:
> mod = import_module(mod_name)
>   File
> "C:\Users\sou\AppData\Local\Programs\Python\Python36\lib\importlib\__
> __.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 953, in
> _find_and_load_unlocked
> ModuleNotFoundError: No module named 'views'
>
> Please help me guys it's urgent.
>
> Thank You
>
>
> regards,
> Soumen
>
> --
> 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/CAPUw6WbAroJcmBD57Vs-Bpw7Q_fRu9FmpAArehC-pkn%2BxJFDrw%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/CAP-0Xy2ACT3B_SjpcvGmOft2G3q5_-9D%2Be7gmX02Jyru4kFquA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Saving OnetoOne Field

2019-06-18 Thread 'Shreejith Unnikrishnan Nair' via Django users
I'm beginner , so i need help
Please suggest me the best practice to save the OnetoOneField in django.

-- 
Thanks & Regards,
Shreejith

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


Django Project Using Azure App Services Not Connecting to Azure SQL Server Through Active Directory

2019-06-18 Thread Jorge William Pava Hernández
We are experiencing a problem with the Python connection to an Azure SQL 
Server, when trying to use the Active Directory as method for 
authentication. The error says that the user is blank and the domain name 
is malformed. Anyone having the same issue? 

-- 
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/72dcd20b-5ede-42ce-9d62-22306c90e7d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ImageField attributes

2019-06-18 Thread Luka Nik
[image: gesk1.png]

Can someone help me with this?
I am trying to resize profile photo for my web app, but the function is not
working.
It tried with both self.image.url and self.image.path - I guess that is why
it is not working(unresolved attribute reference), but in the django
documentation for ImageField both attributes exist.

-- 
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/CAMqindtLG6W%3D-9TzaRx8ofDq%2B2LpPJO%3DtegQG1qBpFCL60fJrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


call a view several times in another view

2019-06-18 Thread Sebastian Jung
Hello,

I have a view like this:

def secondmethod(request,entry):

if request.method='POST':

  return request.POST.get('selection')

   render(request,'eintrag.html','entry':entry)


def test(request):

if request.method='POST':

  queryresult = model.objects.all()
  for entry in queryresult:
 eintrag = secondmethod(request,entry)

   render(request,'homepage.html')


This is a easy example. I call the view test, in for loop i want to call 
the view secondmethod several times. In function secondmethod eintrag.html 
render and the selection return back to test. Then next row from 
queryresult is submit to secondmethod. Is this possible?





-- 
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/ac58ef01-2e91-4aa1-8149-bc3b2e14e404%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Package that helps update only changed fields

2019-06-18 Thread Dan Davis
So, I recently observed that a Django ModelForm updates all columns when it 
is updating a model instance. This is appropriate for a typical situation 
where Django is also in control of the schema.
I also see that you can control this behavior by passing update_fields 
 
to the save method, in a particular form:

self.instance.save(update_fields=self.changed_data)

I have some complicated forms that have non-model fields and many-to-many 
fields mixed in there.   I'm wondering whether there is a module for Django 
out there that gives me some base ModelForms that do not update all fields, 
but only changed fields.  I am asking because I don't want to work hard to 
handle corner cases if there's something already out there.   What I 
already have is hard-coded to the form where I've made this change to do 
only a limited update.

Thanks,

-Dan

-- 
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/3c267866-3b46-4c20-a7a2-03cf581a5e98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving OnetoOne Field

2019-06-18 Thread Lutalo Bbosa joseph
A foreignKey with aunique attribute is same as using a OnetoOneField so
either can suit your needs
 and please be clear about saving

On Tue, Jun 18, 2019 at 1:56 PM 'Shreejith Unnikrishnan Nair' via Django
users  wrote:

> I'm beginner , so i need help
> Please suggest me the best practice to save the OnetoOneField in django.
>
> --
> Thanks & Regards,
> Shreejith
>
> --
> 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/CADGnmLwY8wQmZ%2BOh40rG_%3DRiENRK84JWQ1v2hy2y3Wk3OnHsUA%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/CAMz%3Dh%3DRSkmDGB3j5rCoRptPrv9DW6XBoGcExsruay%3DpkAgBO2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving OnetoOne Field

2019-06-18 Thread Dan Davis

Shreejith Unnikrishnan Nair,

Is this in a ModelForm or the intsance itself?   That would help to give 
guidance...


On Tuesday, June 18, 2019 at 11:40:53 AM UTC-4, Lutalo Bbosa joseph wrote:
>
> A foreignKey with aunique attribute is same as using a OnetoOneField so 
> either can suit your needs
>  and please be clear about saving 
>
> On Tue, Jun 18, 2019 at 1:56 PM 'Shreejith Unnikrishnan Nair' via Django 
> users > wrote:
>
>> I'm beginner , so i need help 
>> Please suggest me the best practice to save the OnetoOneField in django.
>>
>> -- 
>> Thanks & Regards,
>> Shreejith
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CADGnmLwY8wQmZ%2BOh40rG_%3DRiENRK84JWQ1v2hy2y3Wk3OnHsUA%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/7091497b-8944-4f28-8806-c4c71a1f509d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: call a view several times in another view

2019-06-18 Thread Dan Davis
I don't think it is a a good idea to call a view from another view, but if 
you have an underlying function that used to be a view, and you want to 
call it to do the secondmethod, then that's a good way to begin to do more 
with Django.   Another good way is to practice using the generic 
class-based views until they begin to make sense.

One of my developers used to "assume" the request.method was 'POST' in one 
function, called search_result, and she also had a search_request method 
which was also a view:

 def search_request(request):
 assumes GET ...

 def search_result(request):
 assumes POST ...

I created a new function search_view(), and made that the view, the other 
two are just functions:

 def search_view(request):
 if request.method == 'GET':
  return search_request(request)
 elif request.method == 'POST':
  return search_result(request)
 else:
  return HttpResponseNotAllowed();


On Tuesday, June 18, 2019 at 9:29:44 AM UTC-4, Sebastian Jung wrote:
>
> Hello,
>
> I have a view like this:
>
> def secondmethod(request,entry):
>
> if request.method='POST':
>
>   return request.POST.get('selection')
>
>render(request,'eintrag.html','entry':entry)
>
>
> def test(request):
>
> if request.method='POST':
>
>   queryresult = model.objects.all()
>   for entry in queryresult:
>  eintrag = secondmethod(request,entry)
>
>render(request,'homepage.html')
>
>
> This is a easy example. I call the view test, in for loop i want to call 
> the view secondmethod several times. In function secondmethod eintrag.html 
> render and the selection return back to test. Then next row from 
> queryresult is submit to secondmethod. Is this possible?
>
>
>
>
>
>

-- 
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/d6784c0d-28b4-4b34-8b5c-2ace163199e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Package that helps update only changed fields

2019-06-18 Thread Simon Charette
Hello Dan,

I'm not aware of any third party library handling this but a simple way to 
achieve
what you're after would be to subclass ModelForm in order to override save()
and pass commit=False in your super() call.

e.g. (untested)

class UpdateFieldsModelForm(ModelForm):
update_fields = None

def save(self, commit=True):
instance = super().save(commit=False)
if commit:
update_fields = None if instance._state.adding else 
self.update_fields
instance.save(update_fields=self.update_fields)
return instance

Cheers,
Simon

Le mardi 18 juin 2019 11:38:53 UTC-4, Dan Davis a écrit :
>
> So, I recently observed that a Django ModelForm updates all columns when 
> it is updating a model instance. This is appropriate for a typical 
> situation where Django is also in control of the schema.
> I also see that you can control this behavior by passing update_fields 
>  
> to the save method, in a particular form:
>
> self.instance.save(update_fields=self.changed_data)
>
> I have some complicated forms that have non-model fields and many-to-many 
> fields mixed in there.   I'm wondering whether there is a module for Django 
> out there that gives me some base ModelForms that do not update all fields, 
> but only changed fields.  I am asking because I don't want to work hard to 
> handle corner cases if there's something already out there.   What I 
> already have is hard-coded to the form where I've made this change to do 
> only a limited update.
>
> Thanks,
>
> -Dan
>

-- 
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/8dd0ebb7-3686-4477-b7ee-0b482312d65c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Serving staticfiles

2019-06-18 Thread Soumen Khatua
 Hi Folks,
After run python manage.py collrctststic all the static files copied into
project_root specified folder. But after doing debug = false,the images and
Css files link is not working and showing 404 error message in console. But
when I did debug = True it's url and everything working properly. I'm using
django 1.11 so I also added {% load staticfiles %}

 
I'm using loacal machine server(python manage.py runserver) yjen what is
problem in this case???


Please help guys.

Thank You.

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


Re: Serving staticfiles

2019-06-18 Thread Andréas Kühne
Hi,

The default way to do staticfile deployment in production is first of all
to run collectstatic. Then change debug to false. But in doing so, django
no longer serves the staticfiles, so you need to setup a http server
infront of django (nginx or apache). Read here about the settings:
https://docs.djangoproject.com/en/2.2/howto/static-files/

And then you can get a guide how to setup nginx and django here:
https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04

Regards,

Andréas


Den tis 18 juni 2019 kl 21:38 skrev Soumen Khatua :

>  Hi Folks,
> After run python manage.py collrctststic all the static files copied into
> project_root specified folder. But after doing debug = false,the images and
> Css files link is not working and showing 404 error message in console. But
> when I did debug = True it's url and everything working properly. I'm using
> django 1.11 so I also added {% load staticfiles %}
>
>  
> I'm using loacal machine server(python manage.py runserver) yjen what is
> problem in this case???
>
>
> Please help guys.
>
> Thank You.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZZLnWc3K%3DinjD1j4v0Bp56iGOkama9Yy4w28qeqtuA4Q%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/CAK4qSCeA%2B-uU%2BkRTsaPKwsRAPf9ctbsa6reOH6g%2Bvsi%3DqpptoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Suggestions for Models to achieve queryset with multi table joins

2019-06-18 Thread Rupin Chheda
Hello,

I have been searching since the last couple of days and dont see a clear 
answer, hence posting here. Here is what my application is 

1) There are Users ( CustomUser)
2) There are Forms (PDFForm)
3) There are Fields(Field)
4) Each Form has multiple Fields with attributes(PDFFormField)
5) Each User has multiple fields associated with them(UserProfile)
6) Users can request PDFs (GeneratedPDF)

Imagine a User requesting a PDF. A row is created in GeneratedPDF model

This PDF has multiple fields, which need to be populated by values coming 
from the User Profile Fields (Both UserProfile and PDFFormField has the 
fields as a FK)



Here is how my Models look 

from django.contrib.auth.models import AbstractUser
from django.db import models
from django.conf import settings


class CustomUser(AbstractUser):
pass
# add additional fields in here


#Class has reference to all PDFForms
class PDFForm(models.Model):
 #pass 
 pdf_type=models.IntegerField(default=0)
 pdf_name=models.CharField(max_length=100,default='')
 file_path=models.FileField(default='') 


#Class has reference to every form Field created
class Field(models.Model):
 #pass 
 field_type=models.IntegerField(default=0)
 
 
#class relates form field id with PDF ID, a pdf can have multiple fields of 
same kind. 
class PDFFormField(models.Model):
 #pass 
 pdf=models.ForeignKey('PDFForm', on_delete=models.CASCADE,default=0)
 field=models.ForeignKey(Field, on_delete=models.CASCADE,default=0) 
 field_page_number=models.IntegerField(default=0)
 field_x=models.DecimalField(max_digits=6,decimal_places=2,default=0)
 field_y=models.DecimalField(max_digits=6,decimal_places=2,default=0)
 field_x_increment=models.DecimalField(max_digits=6,decimal_places=2,default
=0)
 class Meta:
 ordering= ("field_page_number",)





#class stores extra user data, which is treated as a form field. 
class UserProfile(models.Model):
 #pass 
 user=models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,
default=0)
 field=models.ForeignKey(Field, on_delete=models.CASCADE,default=0)
 field_text=models.CharField(max_length=200,default='')
 field_date=models.DateField()
 
#class has reference to all pdfs users have generated/requested
class GeneratedPDF(models.Model):
 user=models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,
default=0)
 pdf=models.ForeignKey('PDFForm', on_delete=models.CASCADE,default=0)
 date_created=models.DateTimeField(auto_now=True)
 class Meta:
 ordering= ("date_created",)


A typical query would look like this

select * from PDFFormField A, UserProfile B where B.pdf= and A.user
= and A.field=B.field

The above query will match the Fields by ID in both the tables UserProfile 
and PDFformField for The specific user  who has request a specific 
pdf 


I cannot find a documented example which can help me achieve the above 
query using ORM.   I am thinking that I have to resort to using cursors to 
execute a custom SQL. 

Please advise if I should use the cursors route or modify my Models in 
someway. 

Thank you
Rupin




-- 
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/83dc7c27-8734-4a38-bed7-b009e47d28e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


unable to import django packages

2019-06-18 Thread KUMBHAGIRI SIVAKRISHNA
hi,
I just django started ,when I run my application ,it gives errors as shown 
in figure

-- 
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/3b8538ef-0167-4e3b-a42b-8e4047da322e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Editing the User model registration form, multiple user types on one form

2019-06-18 Thread Taha Arif
I have a user model registration form, I want to modify it to include a 
radio button that when triggered opens up a few more fields. 

from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm


class UserCreateForm(UserCreationForm):
class Meta:
fields = ("username", "email", "password1", "password2")
model = get_user_model()

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["username"].label = "Display name"
self.fields["email"].label = "Email address"



It is very basic, but i want to offer the option on the form to have a 
Public Artist Profile (PAP) or a Private Consumer Profile (PCP) ON THE SAME 
FORM. If they select PAP, then I want to get some more information from 
them and approve their application to enable them to create postings in the 
store. 

I need help with the following. 

1. *How should I set up User types*. I want PAPs to have access to the same 
methods as PCP's, with their own additional custom methods to post items to 
the store. Should they be in separate Databases? Should PCP inherit from 
the *User* model, and PAP inherit from the PCP model?

2. *How can I create one user registration from to handle this issue?*











-- 
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/5689c2dd-f9a5-4ea8-982f-abe896900667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unable to import django packages

2019-06-18 Thread Ing.Daniel Bojorge
What happen with your server?  This error may be only in VSCode.


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Crea un sistema de compras completo con Django *

*Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes*

*WebService RestFul API con Python usando Django RestFrameWork*

*Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*

*Programación en Capas (Web y Escritorio)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El mar., 18 jun. 2019 a las 16:42, KUMBHAGIRI SIVAKRISHNA (<
kumbhagirish...@gmail.com>) escribió:

> hi,
> I just django started ,when I run my application ,it gives errors as shown
> in figure
>
> --
> 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/3b8538ef-0167-4e3b-a42b-8e4047da322e%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/CAMQeQjaEU53nJpk9q-s_JnvvbjTGSmd06XJ59t-%3DrQYvygqR6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unable to import django packages

2019-06-18 Thread Aldian Fazrihady
Has the IDE used the same python environment with the one having Django
module installed?

Aldian Fazrihady


On Wed, 19 Jun 2019, 05:42 KUMBHAGIRI SIVAKRISHNA, <
kumbhagirish...@gmail.com> wrote:

> hi,
> I just django started ,when I run my application ,it gives errors as shown
> in figure
>
> --
> 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/3b8538ef-0167-4e3b-a42b-8e4047da322e%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/CAN7EoAbRPj7LmQYDib9VxE%3DfejEGnr3OYeOBfygC3cCTgp51MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Internal Server Error: /tinymce/compressor/

2019-06-18 Thread Mike Dewhirst
Sorry to bother you. I uninstalled all the old packages and reinstalled 
the new ones again and the problem has gone away.


On 18/06/2019 7:03 pm, Mike Dewhirst wrote:

Can anyone point me in the right direction please?

I'm currently switching from ...

    tinymce_lite4 and filebrowser-no-grappelli
to
    django-tinymce, django-grappelli and django-filebrowser

It is running on Ubuntu 18.04, Python3.6 and Django 2.1.

Thanks

Mike

Internal Server Error: /tinymce/compressor/

UnicodeDecodeError at /tinymce/compressor/
'ascii' codec can't decode byte 0xc2 in position 3146: ordinal not in 
range(128)


Request Method: GET
Request URL: 
https://tinymce/compressor/?js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en

Django Version: 2.1.9
Python Executable: /usr/bin/python3
Python Version: 3.6.8
Python Path: ['/var/www/train', '/usr/lib/python36.zip', 
'/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', 
'/usr/local/lib/python3.6/dist-packages', 
'/usr/lib/python3/dist-packages']

Server time: Tue, 18 Jun 2019 08:26:39 +
Installed Applications:
['filebrowser',
'grappelli',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'tinymce',
'billing',
'common',
'course',
'credit']
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',
'pwned_passwords_django.middleware.PwnedPasswordsMiddleware']


Traceback:

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py" 
in inner

34. response = get_response(request)

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" 
in _get_response

126. response = self.process_exception_by_middleware(e, request)

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" 
in _get_response
124. response = wrapped_callback(request, *callback_args, 
**callback_kwargs)


File "/usr/local/lib/python3.6/dist-packages/tinymce/views.py" in 
compressor

86. return gzip_compressor(request)

File "/usr/local/lib/python3.6/dist-packages/tinymce/compressor.py" in 
gzip_compressor

129. content.append(get_file_contents('{!s}.js'.format(f)))

File "/usr/local/lib/python3.6/dist-packages/tinymce/compressor.py" in 
get_file_contents

40. return f.read()

File "/usr/lib/python3.6/encodings/ascii.py" in decode
26. return codecs.ascii_decode(input, self.errors)[0]

Exception Type: UnicodeDecodeError at /tinymce/compressor/
Exception Value: 'ascii' codec can't decode byte 0xc2 in position 
3146: ordinal not in range(128)

Request information:
USER: miked [Superuser]

GET:
js = 'true'
diskcache = 'true'
core = 'true'
suffix = ''
themes = 'advanced'
plugins = 'table,spellchecker,paste,searchreplace'
languages = 'en'

POST: No POST data

FILES: No FILES data

COOKIES:
csrftoken = 
'f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07'

sessionid = 'dgu3ev20h7auh8nec09rjp7sgbfesl0t'

META:
CONTEXT_DOCUMENT_ROOT = '/var/www/train/htdocs/'
CONTEXT_PREFIX = ''
CSRF_COOKIE = 
'f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07'

DOCUMENT_ROOT = '/var/www/train/htdocs/'
GATEWAY_INTERFACE = 'CGI/1.1'
HTTP_ACCEPT = '*/*'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.5'
HTTP_CACHE_CONTROL = 'max-age=0'
HTTP_CONNECTION = 'keep-alive'
HTTP_COOKIE = 
'csrftoken=f5UTaS6WtWvhqImrqCh5E3JxTsMJ0hC1EH0Bd1ssGSFVa1JRRALs3DdJGH5UPh07; 
sessionid=dgu3ev20h7auh8nec09rjp7sgbfesl0t'

HTTP_DNT = '1'
HTTP_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) 
Gecko/20100101 Firefox/67.0'

PATH_INFO = '/tinymce/compressor/'
PATH_TRANSLATED = '/var/www/train/train/wsgii.py/tinymce/compressor/'
QUERY_STRING = 
'js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en'

REQUEST_METHOD = 'GET'
REQUEST_SCHEME = 'https'
REQUEST_URI = 
'/tinymce/compressor/?js=true&diskcache=true&core=true&suffix=&themes=advanced&plugins=table%2Cspellchecker%2Cpaste%2Csearchreplace&languages=en'

SCRIPT_FILENAME = '/var/www/train/train/wsgii.py'
SCRIPT_NAME = ''
SERVER_PORT = '443'
SERVER_PROTOCOL = 'HTTP/1.1'
SERVER_SIGNATURE = 'Apache/2.4.29 (Ubuntu) Server at 
www.sharedtrain.com Port 443\n'

SERVER_SOFTWARE = 'Apache/2.4.29 (Ubuntu)'
apache.version = '(2, 4, 27)'
mod_wsgi.application_group = '|'
mod_wsgi.callable_object = 'application'
mod_wsgi.enable_sendfile = '0'
mod_wsgi.handler_script = ''
mod_wsgi.ignore_activity = '0'
mod_wsgi.listener_host = ''
mod_wsgi.listener_port = '443'
mo