Re: Apache and mod_wsgi with django

2023-01-01 Thread Mike Dewhirst

On 2/01/2023 1:44 pm, pankaj palmate wrote:


Hi i am using Apache with mod_wsgi.i want to serve 5000 users at a 
time.how many processes and threads should I use in order to serve 
5000 connections concurrently...in wsgi daemon process ?


I can't answer the question because it is above my pay-grade. However, I 
have recently (successfully) adjusted my own mpm-event settings based on 
advice from the Apache support list ... us...@httpd.apache.org


They are very friendly but will probably ask you for more information 
including which mpm module you are using. If you enable apache-status 
you will be able to gather most of that info before asking for help.


Cheers

Mike


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPyMU1LG_JWo_4st5mjZ5Ps%2BMdJoBnHQHCya1CK-Qm7AZjGYnw%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAPyMU1LG_JWo_4st5mjZ5Ps%2BMdJoBnHQHCya1CK-Qm7AZjGYnw%40mail.gmail.com?utm_medium=email&utm_source=footer>.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/325ed00e-7fc6-c65c-7c7f-ca9c6b6b328b%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


Apache and mod_wsgi with django

2023-01-01 Thread pankaj palmate
Hi i am using Apache with mod_wsgi.i want to serve 5000 users at a time.how
many processes and threads should I use in order to serve 5000 connections
concurrently...in wsgi daemon process ?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPyMU1LG_JWo_4st5mjZ5Ps%2BMdJoBnHQHCya1CK-Qm7AZjGYnw%40mail.gmail.com.


Re: Django deploy Apache

2022-05-18 Thread Kasper Laudrup

On 13/05/2022 13.56, Nicolas Passarini wrote:
Hello, i ve deployed a django app in apache. the problem is that i works 
for 5 minutes and then it stops responding.




That sucks. Sounds like you have some issues you need to look into.

Good luck.

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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84858a53-2256-4bee-889a-ff365127f86en%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/84858a53-2256-4bee-889a-ff365127f86en%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21b9a5fd-873e-503b-5f87-d67e60ce2faf%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Django deploy Apache

2022-05-13 Thread Nicolas Passarini
Hello, i ve deployed a django app in apache. the problem is that i works 
for 5 minutes and then it stops responding. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84858a53-2256-4bee-889a-ff365127f86en%40googlegroups.com.


Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Antonis Christofides
Technically the correct way here is to include 'permanent'. This may help search 
engines do the correct thing.


But there is a problem. At least until a few years ago, the RFC mandated that 
permanent redirects be cachable forever, and browsers were doing this. Assuming 
this continues today, if for any reason you ever decide to undo this permanent 
redirect or point it elsewhere, or simply if you make an error while configuring 
apache, you are out of luck. In my opinion, this is an error in the RFC, and as 
someone had commented, it is silly to have a provision that lets you so easily 
give up control of a resource for ever.


Because of this, I always include this in my apache configuration (not in the 
host configuration but in the general configuration which applies to all hosts):


Header always set Cache-Control "no-store, no-cache, must-revalidate" 
"expr=%{REQUEST_STATUS} == 301"
Header always set Expires "Thu, 01 Jan 1970 00:00:00 GMT" 
"expr=%{REQUEST_STATUS} == 301"


Antonis Christofides
+30-6979924665 (mobile)


On 07/02/2022 23.27, Mike Dewhirst wrote:
Yes ... that's almost what I went with after reading up on the topic. I left 
the 'permanent' off.


Thanks Bob and everyone.

Cheers

Mike

--
(Unsigned mail from my phone)



 Original message 
From: Bob Kline 
Date: 8/2/22 06:30 (GMT+10:00)
To: Django users 
Subject: Re: Off topic slightly - Apache https redirect

On Sunday, February 6, 2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:

There seems to be a multitude of ways to redirect from http to https.
Any pointers to the absolutely correct way?


How about something like this?


  ServerName example.com
  ServerAlias www.example.com
  Redirect permanent / https://example.com/


  ...


--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c8177d-49c0-45f7-b382-31855ccb6b0an%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/c8c8177d-49c0-45f7-b382-31855ccb6b0an%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62018eb3.1c69fb81.e0fe.0b9fSMTPIN_ADDED_MISSING%40gmr-mx.google.com 
<https://groups.google.com/d/msgid/django-users/62018eb3.1c69fb81.e0fe.0b9fSMTPIN_ADDED_MISSING%40gmr-mx.google.com?utm_medium=email&utm_source=footer>.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/90a16663-f1e5-183c-ae22-5d1491b2c08d%40antonischristofides.com.


Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Mike Dewhirst
Yes ... that's almost what I went with after reading up on the topic. I left 
the 'permanent' off.Thanks Bob and everyone.CheersMike--(Unsigned mail from my 
phone)
 Original message From: Bob Kline  Date: 
8/2/22  06:30  (GMT+10:00) To: Django users  
Subject: Re: Off topic slightly - Apache https redirect On Sunday, February 6, 
2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:There seems to be a multitude of 
ways to redirect from http to https.Any pointers to the absolutely correct 
way?How about something like this?   ServerName example.com  
ServerAlias www.example.com  Redirect permanent / 
https://example.com/  ... 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c8177d-49c0-45f7-b382-31855ccb6b0an%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62018eb3.1c69fb81.e0fe.0b9fSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: Off topic slightly - Apache https redirect

2022-02-07 Thread Bob Kline
On Sunday, February 6, 2022 at 9:12:38 PM UTC-5 Mike Dewhirst wrote:

> There seems to be a multitude of ways to redirect from http to https.
> Any pointers to the absolutely correct way?
>
>
How about something like this?

 
  ServerName example.com
  ServerAlias www.example.com
  Redirect permanent / https://example.com/


  ...


 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c8177d-49c0-45f7-b382-31855ccb6b0an%40googlegroups.com.


Off topic slightly - Apache https redirect

2022-02-06 Thread Mike Dewhirst
There seems to be a multitude of ways to redirect from http to 
https.Letsencrypt rewrote my conf for port 80 traffic to https but when a 
customer used http://mysite.com it brought up the Apache "this is working" 
page.Any pointers to the absolutely correct way?ThanksMike--(Unsigned mail from 
my phone)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62007f89.1c69fb81.6f671.d033SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-15 Thread Kyle Paterson
Used libapache2-mod-wsgi-py3 instead of python 2 version

On Wednesday, 15 December 2021 at 10:03:27 UTC Kyle Paterson wrote:

> I am not using either of those, I think. The only place I explicitly load 
> settings is in wsgi.py, with the line:
> os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘travel data.settings'
>
> On Thu, 9 Dec 2021 at 12:52, Jason  wrote:
>
>>
>> with your settings usage, are you defining a property in settings and 
>> trying to use it anywhere?
>>
>> furthermore, are you using settings via 
>>
>> from traveldata.traveldata import settings (example)
>>
>> or via
>>
>> from django.conf import settings
>>
>> The latter is the recommended means because settings are lazy loaded.
>> On Wednesday, December 8, 2021 at 10:07:11 AM UTC-5 sencer...@gmail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> I think this is not related with apache
>>>
>>> It seems like class object property is called as a method somehow.
>>> Unfortunately the error does not reveal the property name.
>>>
>>> Regards,
>>> Sencer HAMARAT
>>>
>>>
>>>
>>> On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson  
>>> wrote:
>>>
>>>> Started a new project after not using Django for roughly two years, 
>>>> works fine when running as a development server but throws TypeError: 
>>>> SimpleLazyObject class: property object not callable.
>>>>
>>>> From apache error log:
>>>> [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call 
>>>> last):
>>>> [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946]   File 
>>>> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in 
>>>> 
>>>> [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi 
>>>> import get_wsgi_application
>>>> [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946]   File 
>>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
>>>>  
>>>> line 1, in 
>>>> [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] from 
>>>> django.utils.version import get_version
>>>> [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946]   File 
>>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
>>>>  
>>>> line 7, in 
>>>> [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] from 
>>>> django.utils.regex_helper import _lazy_re_compile
>>>> [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946]   File 
>>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
>>>>  
>>>> line 10, in 
>>>> [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] from 
>>>> django.utils.functional import SimpleLazyObject
>>>> [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946]   File 
>>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
>>>>  
>>>> line 364, in 
>>>> [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] class 
>>>> SimpleLazyObject(LazyObject):
>>>> [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when 
>>>> calling the metaclass bases
>>>> [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid 
>>>> 140343150348032] [remote 127.0.0.1:44946] 'property' object is not 
>>>> callable
>>>>
>>>> Apache site config file:
>>>> 
>>>> # The ServerName directive sets the request scheme, hostname 
>>>> and port that
>&g

Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-15 Thread Kyle Paterson
I am not using either of those, I think. The only place I explicitly load
settings is in wsgi.py, with the line:
os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘travel data.settings'

On Thu, 9 Dec 2021 at 12:52, Jason  wrote:

>
> with your settings usage, are you defining a property in settings and
> trying to use it anywhere?
>
> furthermore, are you using settings via
>
> from traveldata.traveldata import settings (example)
>
> or via
>
> from django.conf import settings
>
> The latter is the recommended means because settings are lazy loaded.
> On Wednesday, December 8, 2021 at 10:07:11 AM UTC-5 sencer...@gmail.com
> wrote:
>
>> Hi,
>>
>> I think this is not related with apache
>>
>> It seems like class object property is called as a method somehow.
>> Unfortunately the error does not reveal the property name.
>>
>> Regards,
>> Sencer HAMARAT
>>
>>
>>
>> On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson 
>> wrote:
>>
>>> Started a new project after not using Django for roughly two years,
>>> works fine when running as a development server but throws TypeError:
>>> SimpleLazyObject class: property object not callable.
>>>
>>> From apache error log:
>>> [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call
>>> last):
>>> [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in
>>> 
>>> [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi
>>> import get_wsgi_application
>>> [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
>>> line 1, in 
>>> [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from django.utils.version
>>> import get_version
>>> [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
>>> line 7, in 
>>> [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from
>>> django.utils.regex_helper import _lazy_re_compile
>>> [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
>>> line 10, in 
>>> [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] from
>>> django.utils.functional import SimpleLazyObject
>>> [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946]   File
>>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
>>> line 364, in 
>>> [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] class
>>> SimpleLazyObject(LazyObject):
>>> [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when calling
>>> the metaclass bases
>>> [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid
>>> 140343150348032] [remote 127.0.0.1:44946] 'property' object is not
>>> callable
>>>
>>> Apache site config file:
>>> 
>>> # The ServerName directive sets the request scheme, hostname and
>>> port that
>>> # the server uses to identify itself. This is used when creating
>>> # redirection URLs. In the context of virtual hosts, the
>>> ServerName
>>> # specifies what hostname must appear in the request's Host:
>>> header to
>>> # match this virtual host. For the default virtual host (this
>>> file) this
>>> # value is not decisive as it is used as a last resort host
>>> regardless.
>>> # However, you must set it for any further virtual host
>>> explicitly.

Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-09 Thread Jason

with your settings usage, are you defining a property in settings and 
trying to use it anywhere?

furthermore, are you using settings via 

from traveldata.traveldata import settings (example)

or via

from django.conf import settings

The latter is the recommended means because settings are lazy loaded.
On Wednesday, December 8, 2021 at 10:07:11 AM UTC-5 sencer...@gmail.com 
wrote:

> Hi,
>
> I think this is not related with apache
>
> It seems like class object property is called as a method somehow.
> Unfortunately the error does not reveal the property name.
>
> Regards,
> Sencer HAMARAT
>
>
>
> On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson  wrote:
>
>> Started a new project after not using Django for roughly two years, works 
>> fine when running as a development server but throws TypeError: 
>> SimpleLazyObject class: property object not callable.
>>
>> From apache error log:
>> [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call 
>> last):
>> [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946]   File 
>> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in 
>> 
>> [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi 
>> import get_wsgi_application
>> [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946]   File 
>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
>>  
>> line 1, in 
>> [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] from django.utils.version 
>> import get_version
>> [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946]   File 
>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
>>  
>> line 7, in 
>> [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] from 
>> django.utils.regex_helper import _lazy_re_compile
>> [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946]   File 
>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
>>  
>> line 10, in 
>> [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] from 
>> django.utils.functional import SimpleLazyObject
>> [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946]   File 
>> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
>>  
>> line 364, in 
>> [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] class 
>> SimpleLazyObject(LazyObject):
>> [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when calling 
>> the metaclass bases
>> [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid 
>> 140343150348032] [remote 127.0.0.1:44946] 'property' object is not 
>> callable
>>
>> Apache site config file:
>> 
>> # The ServerName directive sets the request scheme, hostname and 
>> port that
>> # the server uses to identify itself. This is used when creating
>> # redirection URLs. In the context of virtual hosts, the 
>> ServerName
>> # specifies what hostname must appear in the request's Host: 
>> header to
>> # match this virtual host. For the default virtual host (this 
>> file) this
>> # value is not decisive as it is used as a last resort host 
>> regardless.
>> # However, you must set it for any further virtual host 
>> explicitly.
>> #ServerName www.example.com
>>
>> ServerAdmin webmaster@localhost
>> 
>> Alias /static /home/kyle/active-travel/traveldata/static
>> 
>> Require all granted
>> 
>>
>> 
>> 
>> Require all granted
>> 
>> 
>>
>> WSGIScriptAlias / 
>> /home/kyle/active-travel/traveldata/tra

Re: Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-08 Thread Sencer Hamarat
Hi,

I think this is not related with apache

It seems like class object property is called as a method somehow.
Unfortunately the error does not reveal the property name.

Regards,
Sencer HAMARAT



On Wed, Dec 8, 2021 at 4:59 PM Kyle Paterson 
wrote:

> Started a new project after not using Django for roughly two years, works
> fine when running as a development server but throws TypeError:
> SimpleLazyObject class: property object not callable.
>
> From apache error log:
> [Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call
> last):
> [Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946]   File
> "/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in
> 
> [Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi
> import get_wsgi_application
> [Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946]   File
> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py",
> line 1, in 
> [Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] from django.utils.version
> import get_version
> [Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946]   File
> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
> line 7, in 
> [Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] from
> django.utils.regex_helper import _lazy_re_compile
> [Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946]   File
> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
> line 10, in 
> [Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] from
> django.utils.functional import SimpleLazyObject
> [Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946]   File
> "home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
> line 364, in 
> [Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] class
> SimpleLazyObject(LazyObject):
> [Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] TypeError: Error when calling
> the metaclass bases
> [Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid
> 140343150348032] [remote 127.0.0.1:44946] 'property' object is not
> callable
>
> Apache site config file:
> 
> # The ServerName directive sets the request scheme, hostname and
> port that
> # the server uses to identify itself. This is used when creating
> # redirection URLs. In the context of virtual hosts, the ServerName
> # specifies what hostname must appear in the request's Host:
> header to
> # match this virtual host. For the default virtual host (this
> file) this
> # value is not decisive as it is used as a last resort host
> regardless.
> # However, you must set it for any further virtual host explicitly.
> #ServerName www.example.com
>
> ServerAdmin webmaster@localhost
>
> Alias /static /home/kyle/active-travel/traveldata/static
> 
> Require all granted
> 
>
> 
> 
> Require all granted
> 
> 
>
> WSGIScriptAlias /
> /home/kyle/active-travel/traveldata/traveldata/wsgi.py
> process-group=traveldata
> WSGIDaemonProcess traveldata
> python-home=/home/kyle/active-travel/venv
> python-path=/home/kyle/active-travel/traveldata/traveldata
> WSGIProcessGroup traveldata
>
> # Available loglevels: trace8, ..., trace1, debug, info, notice,
> warn,
> # error, crit, alert, emerg.
> # It is also possible to configure the loglevel for particular
> # modules, e.g.
> #LogLevel info ssl:warn
> LogLevel info
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
> # For most configuration files from conf-available/, which are
> # enabled or disabled at a global level, it is possible to
> # include a line for only one particul

Why does django throw TypeError when sending requests through Apache WSGI?

2021-12-08 Thread Kyle Paterson
Started a new project after not using Django for roughly two years, works 
fine when running as a development server but throws TypeError: 
SimpleLazyObject class: property object not callable.

>From apache error log:
[Wed Dec 08 10:11:53.023239 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] Traceback (most recent call last):
[Wed Dec 08 10:11:53.023283 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946]   File 
"/home/kyle/active-travel/traveldata/traveldata/wsgi.py", line 14, in 

[Wed Dec 08 10:11:53.023327 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] from django.core.wsgi import 
get_wsgi_application
[Wed Dec 08 10:11:53.023351 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946]   File 
"home/kyle/active-travel/venv/lib/python3.8/site-packages/django/__init__.py", 
line 1, in 
[Wed Dec 08 10:11:53.023371 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] from django.utils.version 
import get_version
[Wed Dec 08 10:11:53.023377 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946]   File 
"home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/version.py",
 
line 7, in 
[Wed Dec 08 10:11:53.023430 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] from 
django.utils.regex_helper import _lazy_re_compile
[Wed Dec 08 10:11:53.023435 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946]   File 
"home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/regex_helper.py",
 
line 10, in 
[Wed Dec 08 10:11:53.023524 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] from django.utils.functional 
import SimpleLazyObject
[Wed Dec 08 10:11:53.023529 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946]   File 
"home/kyle/active-travel/venv/lib/python3.8/site-packages/django/utils/functional.py",
 
line 364, in 
[Wed Dec 08 10:11:53.023578 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] class 
SimpleLazyObject(LazyObject):
[Wed Dec 08 10:11:53.023611 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] TypeError: Error when calling the 
metaclass bases
[Wed Dec 08 10:11:53.023613 2021] [wsgi:error] [pid 10704:tid 
140343150348032] [remote 127.0.0.1:44946] 'property' object is not 
callable

Apache site config file:

# The ServerName directive sets the request scheme, hostname and 
port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header 
to
# match this virtual host. For the default virtual host (this file) 
this
# value is not decisive as it is used as a last resort host 
regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost

Alias /static /home/kyle/active-travel/traveldata/static

Require all granted




Require all granted



WSGIScriptAlias / 
/home/kyle/active-travel/traveldata/traveldata/wsgi.py 
process-group=traveldata
WSGIDaemonProcess traveldata 
python-home=/home/kyle/active-travel/venv 
python-path=/home/kyle/active-travel/traveldata/traveldata
WSGIProcessGroup traveldata

# Available loglevels: trace8, ..., trace1, debug, info, notice, 
warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
LogLevel info

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example 
the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf


Django project wsgi.py:
import os, sys
sys.path.append('home/kyle/active-travel/venv/lib/python3.8/site-packages')
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'traveldata.settings')
application = get_wsgi_application()

As you can see, all fairly standard, Debug set to true, no changes to 
standard content of site, followed the documentation instructions to run 
requests throug

Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-13 Thread yashwanth .k
Hello Ognjen Bjelica,
I think we can check for line by line using manage.py -> shell. Where we
have to individually import and check for consistency.

On Fri, Feb 12, 2021 at 11:24 PM Ognjen Bjelica 
wrote:

> Hi Rob,
> Thanks for the quick reply, but I was looking for a way to run code line
> by line. Because DEBUG=True is useful only in some situations.
>
>
> On Fri, Feb 12, 2021, 17:19 Rob Wilkinson 
> wrote:
>
>> Sorry meant DEBUG=True   :)
>>
>> On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson <
>> wilkyconsulta...@gmail.com> wrote:
>>
>>>
>>> DEBUG=Yes in settings.py shows what you need even in Apache
>>>
>>> Don’t run like that in prod!
>>>
>>>
>>> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
>>> wrote:
>>>
>>>> Hi everyone,
>>>> I was wondering can anyone point me to a document describing how to
>>>> setup debugging using any IDE (VS Code, PyCharm, etc) or at least from
>>>> console when using Django with Apache and mod_wsgi? Or if it's not possible
>>>> please let me know so I don't waste any more time.
>>>>
>>>> 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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/XXq-_CJwSh4/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOW%2BycFVYZw0uCwPNrLz93sUCMthP-2cp1CrtPe7YqhiYAomMA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOW%2BycFVYZw0uCwPNrLz93sUCMthP-2cp1CrtPe7YqhiYAomMA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALgTQAKhJYai0tLjZ3PtgJA%2BgB%3DfMcnLu2DMiERqMJLAqtguXA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Ognjen Bjelica
Hi Rob,
Thanks for the quick reply, but I was looking for a way to run code line by
line. Because DEBUG=True is useful only in some situations.


On Fri, Feb 12, 2021, 17:19 Rob Wilkinson 
wrote:

> Sorry meant DEBUG=True   :)
>
> On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson 
> wrote:
>
>>
>> DEBUG=Yes in settings.py shows what you need even in Apache
>>
>> Don’t run like that in prod!
>>
>>
>> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
>> wrote:
>>
>>> Hi everyone,
>>> I was wondering can anyone point me to a document describing how to
>>> setup debugging using any IDE (VS Code, PyCharm, etc) or at least from
>>> console when using Django with Apache and mod_wsgi? Or if it's not possible
>>> please let me know so I don't waste any more time.
>>>
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/XXq-_CJwSh4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOW%2BycFVYZw0uCwPNrLz93sUCMthP-2cp1CrtPe7YqhiYAomMA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
DEBUG=Yes in settings.py shows what you need even in Apache

Don’t run like that in prod!


On Fri, Feb 12, 2021 at 10:36 AM Ognjen B.  wrote:

> Hi everyone,
> I was wondering can anyone point me to a document describing how to setup
> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
> when using Django with Apache and mod_wsgi? Or if it's not possible please
> let me know so I don't waste any more time.
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAdSEeYk4R9xSRuMfnB%2B1PfY46gmJoyeGgG8CNz6WvL-skKo%2BA%40mail.gmail.com.


Re: IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Rob Wilkinson
Sorry meant DEBUG=True   :)

On Fri, Feb 12, 2021 at 10:39 AM Rob Wilkinson 
wrote:

>
> DEBUG=Yes in settings.py shows what you need even in Apache
>
> Don’t run like that in prod!
>
>
> On Fri, Feb 12, 2021 at 10:36 AM Ognjen B. 
> wrote:
>
>> Hi everyone,
>> I was wondering can anyone point me to a document describing how to setup
>> debugging using any IDE (VS Code, PyCharm, etc) or at least from console
>> when using Django with Apache and mod_wsgi? Or if it's not possible please
>> let me know so I don't waste any more time.
>>
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAdSEeZLJLMSUBHAgNaBG4CZYF%2B%3D1tcqTPDYAr06-jJvBRSOmA%40mail.gmail.com.


IS it possible to debug Django with Apache and mod_wsgi

2021-02-12 Thread Ognjen B.
Hi everyone,
I was wondering can anyone point me to a document describing how to setup 
debugging using any IDE (VS Code, PyCharm, etc) or at least from console 
when using Django with Apache and mod_wsgi? Or if it's not possible please 
let me know so I don't waste any more time.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ccfa917-06b4-4182-a76d-7b1a4c41eff5n%40googlegroups.com.


Re: Premission Denied - Apache

2020-08-31 Thread Kasper Laudrup

Hi Giovanni,

On 31/08/2020 19.12, Giovanni Silva wrote:

Dear Kasper,

this is part of my code...



So you probably just need to ensure that the user running your Django 
code has write access to BASE_DIR / media.


Now it's up to you to figure out who that user is, what that path is and 
ensure the that path has the proper owner and permissions.


I personally wouldn't be afraid to add some print statements to the 
deployed code for "dirty debugging" in cases like this, but that 
definitely depends on you and your usecase.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a23563c-9632-f50f-c5d6-a38a5e51d436%40stacktrace.dk.


Re: Premission Denied - Apache

2020-08-31 Thread Giovanni Silva
Dear Kasper,

this is part of my code...

[image: image.png]

Best Regards

Giovanni

Em seg., 31 de ago. de 2020 às 13:33, Kasper Laudrup 
escreveu:

> Hi Giovanni,
>
> On 31/08/2020 18.11, Giovanni Silva wrote:
> > Hi Kasper,
> >
> > When I was running with the django local server, I have permission and
> > works good. The error occurs when I publish the site with apache2
> > I gave 777 permission because I was trying to do it (give permission).
> >
>
> I understand that. My point was that not not only didn't it solve your
> problem, you opened up for a lot of other potential issues later on.
>
> As long as you don't share your code it's hard to help you much more,
> but have a look at the path you specify to pdformfill in line 441 of
> your views.py file and see if my suggestions might be of any help.
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5846cfc6-bb53-10c2-734e-7d016b6bc72b%40stacktrace.dk
> .
>


-- 
*Giovanni Silva*
(31) 9 9532-1877

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABO2r9dS-9AChQcBV2Q%3DoFq1TE%3DW_p4XB36acXHCtLdOo7SUNg%40mail.gmail.com.


Re: Premission Denied - Apache

2020-08-31 Thread Kasper Laudrup

Hi Giovanni,

On 31/08/2020 18.11, Giovanni Silva wrote:

Hi Kasper,

When I was running with the django local server, I have permission and 
works good. The error occurs when I publish the site with apache2

I gave 777 permission because I was trying to do it (give permission).



I understand that. My point was that not not only didn't it solve your 
problem, you opened up for a lot of other potential issues later on.


As long as you don't share your code it's hard to help you much more, 
but have a look at the path you specify to pdformfill in line 441 of 
your views.py file and see if my suggestions might be of any help.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5846cfc6-bb53-10c2-734e-7d016b6bc72b%40stacktrace.dk.


Re: Premission Denied - Apache

2020-08-31 Thread Giovanni Silva
Hi Kasper,

When I was running with the django local server, I have permission and
works good. The error occurs when I publish the site with apache2
I gave 777 permission because I was trying to do it (give permission).



Em seg., 31 de ago. de 2020 às 12:11, Kasper Laudrup 
escreveu:

> Hi Giovanni,
>
> On 31/08/2020 06.00, Giovanni Silva wrote:
> > Can anyone help me please?
> >
> > All my project folder is 777 permissions with www-data user owner and
> group
> >
>
> Please don't do that. That's a huge security risk and can cause all
> kinds of other problems.
>
> It is hard to know how to solve your issue since you haven't shared any
> of your code, but I'd suggest you specify a base path for where you save
> your PDF files in your settings.py, ensure that the user running your
> django code has write access to that directory (and only that directory)
> and then ensure you use that path when saving your PDF files (ie. no
> relative paths).
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8e0a8790-f947-15bb-8cf4-c9c0cc59c8d8%40stacktrace.dk
> .
>


-- 
*Giovanni Silva*
(31) 9 9532-1877

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABO2r9fmsYWNu0n2VjYVxoD9fH8SrMNJ-KiAgp9m_CwYBb3VYg%40mail.gmail.com.


Re: Premission Denied - Apache

2020-08-31 Thread Kasper Laudrup

Hi Giovanni,

On 31/08/2020 06.00, Giovanni Silva wrote:

Can anyone help me please?

All my project folder is 777 permissions with www-data user owner and group



Please don't do that. That's a huge security risk and can cause all 
kinds of other problems.


It is hard to know how to solve your issue since you haven't shared any 
of your code, but I'd suggest you specify a base path for where you save 
your PDF files in your settings.py, ensure that the user running your 
django code has write access to that directory (and only that directory) 
and then ensure you use that path when saving your PDF files (ie. no 
relative paths).


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8e0a8790-f947-15bb-8cf4-c9c0cc59c8d8%40stacktrace.dk.


Re: deploying django project with mod_wsgi and apache

2020-05-17 Thread みやうち`
I found out part of my code has problem, althogh I don't know why it didn't 
output an error.

Anyway, thank you for reply.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/106caf50-87ae-4961-acf8-cae0ba85b728%40googlegroups.com.


Re: deploying django project with mod_wsgi and apache

2020-05-16 Thread みやうち`
AWS EC2 with Linux.
Since deployment of "polls" app works fine, I think there is no problem 
with server...
But django and apache give no error about my 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f0547ea-1cc6-4ad1-a4e1-fb1ef3aa972c%40googlegroups.com.


Re: deploying django project with mod_wsgi and apache

2020-05-16 Thread Kurosh Sol
what is your server
as you are Japanese might be use server or sakura?


On Sun, May 17, 2020 at 10:07 AM みやうち`  wrote:

> I got completely stuck deploying django to production.
>
> I deployed my project using apache and mod_wsgi, and then it hangs I
> access it with browser.
> Neither django nor apache gives me any errors at all, so I can't guess the
> cause of problem.
> Since it can be accessed by starting with "runserver",
> I think there's nothing wrong with the project.
> Also, I can access it successfully when I deployed a simple test app with
> apache and mod_wsgi,
> I think there is no problem with the configuration of apache, mod_wsgi and
> my server.
>
> It would be very helpful if you give me any idea of the cause or way of
> investigate it.
>
> My environment
> django : 2.1.15
> mod_wsgi : 4.7.1
> apache : 2.4.6
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8d332ddf-ae69-4716-8107-daf69eff1497%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8d332ddf-ae69-4716-8107-daf69eff1497%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJq35RmbMx4DTT%2BvFWuP_UquN4N-3Kw0LawhfgRzXXQ2aURd%2Bg%40mail.gmail.com.


deploying django project with mod_wsgi and apache

2020-05-16 Thread みやうち`
I got completely stuck deploying django to production.

I deployed my project using apache and mod_wsgi, and then it hangs I access 
it with browser.
Neither django nor apache gives me any errors at all, so I can't guess the 
cause of problem.
Since it can be accessed by starting with "runserver",
I think there's nothing wrong with the project.
Also, I can access it successfully when I deployed a simple test app with 
apache and mod_wsgi,
I think there is no problem with the configuration of apache, mod_wsgi and 
my server. 

It would be very helpful if you give me any idea of the cause or way of 
investigate it.

My environment
django : 2.1.15
mod_wsgi : 4.7.1
apache : 2.4.6

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8d332ddf-ae69-4716-8107-daf69eff1497%40googlegroups.com.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-26 Thread Fateh Budwal
Yes i did recreate my virtualenv.  

On Thursday, March 26, 2020 at 6:58:15 AM UTC-7, Stephen J. Butler wrote:
>
> Did you recreate the virtualenv on the server, or did you copy it from 
> your development machine? You should recreate virtualenv's when deploying 
> to a different server.
>
> On Thu, Mar 26, 2020 at 8:53 AM Fateh Budwal  > wrote:
>
>> Yes python 3.8.2 is installed 
>>
>> On Wednesday, March 25, 2020 at 8:30:35 PM UTC-7, Hella Nick wrote:
>>>
>>> 你的服务器是安装的python3.8.2的版本吗?
>>>
>>> Fateh Budwal  于2020年3月26日周四 上午6:03写道:
>>>
>>>> Hello Everyone 
>>>>  I have complied python 3.8.2 with django 2.2. it run locally fine but 
>>>> when i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the 
>>>> below error. Any suggestions ?  
>>>>
>>>> Current thread 0x7f5aa48af880 (most recent call first):
>>>> no Python framePython path configuration:
>>>>   PYTHONHOME = (not set)
>>>>   PYTHONPATH = (not set)
>>>>   program name = /var/www/project/venu/bin/python
>>>>   isolated = 0
>>>>   environment = 1
>>>>   user site = 1
>>>>   import site = 1
>>>>   sys._base_executable = /var/www/project/venu/bin/python
>>>>   sys.base_prefix = '/opt/python3.8.2'
>>>>   sys.base_exec_prefix = '/opt/python3.8.2'
>>>>   sys.executable = '/var/www/project/venu/bin/python
>>>>   sys.prefix = '/opt/python3.8.2'
>>>>   sys.exec_prefix = '/opt/python3.8.2'
>>>>   sys.path = [
>>>> '/opt/python3.8.2/lib/python38.zip',
>>>> '/opt/python3.8.2/lib/python3.8',
>>>> '/opt/python3.8.2/lib/lib-dynload',
>>>>   ]
>>>> Fatal Python error: init_fs_encoding: failed to get the Python codec of 
>>>> the filesystem encoding
>>>> Python runtime state: core initialized
>>>> ModuleNotFoundError: No module named encodings
>>>>
>>>> Current thread (most recent call first)
>>>>
>>>> -- 
>>>> 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 view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5f39f719-94f3-4f30-a7d3-2a65749af0cf%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/5f39f719-94f3-4f30-a7d3-2a65749af0cf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5d28b14-12d5-41cd-a878-97e6d6157afd%40googlegroups.com.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-26 Thread Stephen J. Butler
Did you recreate the virtualenv on the server, or did you copy it from your
development machine? You should recreate virtualenv's when deploying to a
different server.

On Thu, Mar 26, 2020 at 8:53 AM Fateh Budwal  wrote:

> Yes python 3.8.2 is installed
>
> On Wednesday, March 25, 2020 at 8:30:35 PM UTC-7, Hella Nick wrote:
>>
>> 你的服务器是安装的python3.8.2的版本吗?
>>
>> Fateh Budwal  于2020年3月26日周四 上午6:03写道:
>>
>>> Hello Everyone
>>>  I have complied python 3.8.2 with django 2.2. it run locally fine but
>>> when i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the
>>> below error. Any suggestions ?
>>>
>>> Current thread 0x7f5aa48af880 (most recent call first):
>>> no Python framePython path configuration:
>>>   PYTHONHOME = (not set)
>>>   PYTHONPATH = (not set)
>>>   program name = /var/www/project/venu/bin/python
>>>   isolated = 0
>>>   environment = 1
>>>   user site = 1
>>>   import site = 1
>>>   sys._base_executable = /var/www/project/venu/bin/python
>>>   sys.base_prefix = '/opt/python3.8.2'
>>>   sys.base_exec_prefix = '/opt/python3.8.2'
>>>   sys.executable = '/var/www/project/venu/bin/python
>>>   sys.prefix = '/opt/python3.8.2'
>>>   sys.exec_prefix = '/opt/python3.8.2'
>>>   sys.path = [
>>> '/opt/python3.8.2/lib/python38.zip',
>>> '/opt/python3.8.2/lib/python3.8',
>>> '/opt/python3.8.2/lib/lib-dynload',
>>>   ]
>>> Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
>>> filesystem encoding
>>> Python runtime state: core initialized
>>> ModuleNotFoundError: No module named encodings
>>>
>>> Current thread (most recent call first)
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5f39f719-94f3-4f30-a7d3-2a65749af0cf%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5f39f719-94f3-4f30-a7d3-2a65749af0cf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxXn7oxc-5UOHV7FQd84O5H71GegMgPL1hgca_4mEPgqzA%40mail.gmail.com.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-26 Thread Fateh Budwal
i do have django 2.2.8 installed in production.

On Wednesday, March 25, 2020 at 9:36:58 PM UTC-7, Mike Dewhirst wrote:
>
> On 26/03/2020 2:29 pm, Hella Nick wrote: 
> > 你的服务器是安装的python3.8.2的版本吗? 
> > 
> > Fateh Budwal  <mailto:fbu...@gmail.com 
> >> 
> > 于2020年3月26日周四 上午6:03写道: 
> > 
> > Hello Everyone 
> >  I have complied python 3.8.2 with django 2.2. 
> > 
>
>
> https://docs.djangoproject.com/en/3.0/faq/install/#faq-python-version-support 
>
> That page says Python 3.8 support was added in Django 2.2.8 but you 
> don't mention which Django is installed in production. 
>
> > it run locally fine but when i try to deploy it with Apache and 
> > mod_wsgi 4.7.1 and getting the below error. Any suggestions ? 
> > 
> > |Currentthread 0x7f5aa48af880(most recent call first):no 
> > Pythonframe Pythonpath configuration:PYTHONHOME 
> > =(notset)PYTHONPATH =(notset)program name 
> > =/var/www/project/venu/bin/python isolated =0environment =1user 
> > site =1importsite =1sys._base_executable 
> > =/var/www/project/venu/bin/python sys.base_prefix 
> > ='/opt/python3.8.2'sys.base_exec_prefix 
> > ='/opt/python3.8.2'sys.executable 
> > ='/var/www/project/venu/bin/python sys.prefix = '/opt/python3.8.2' 
> > sys.exec_prefix = '/opt/python3.8.2' sys.path = [ 
> > '/opt/python3.8.2/lib/python38.zip', 
> > '/opt/python3.8.2/lib/python3.8', 
> > '/opt/python3.8.2/lib/lib-dynload', ] Fatal Python error: 
> > init_fs_encoding: failed to get the Python codec of the filesystem 
> > encoding Python runtime state: core initialized 
> > ModuleNotFoundError: No module named encodings Current thread 
> > (most recent call first)| 
> > 
> > -- 
> > 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  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>  
>
> > 
> > -- 
> > 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  
> > <mailto:django-users+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/CAHfGPEeGWB6kdVc65d6s53M-M0KnGS0Er_PFE-pz3tSZco_cGg%40mail.gmail.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/CAHfGPEeGWB6kdVc65d6s53M-M0KnGS0Er_PFE-pz3tSZco_cGg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>  
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84e39ab6-1618-447e-b373-49cf1e7903c3%40googlegroups.com.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-26 Thread Fateh Budwal
Yes python 3.8.2 is installed 

On Wednesday, March 25, 2020 at 8:30:35 PM UTC-7, Hella Nick wrote:
>
> 你的服务器是安装的python3.8.2的版本吗?
>
> Fateh Budwal > 于2020年3月26日周四 上午6:03写道:
>
>> Hello Everyone 
>>  I have complied python 3.8.2 with django 2.2. it run locally fine but 
>> when i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the 
>> below error. Any suggestions ?  
>>
>> Current thread 0x7f5aa48af880 (most recent call first):
>> no Python framePython path configuration:
>>   PYTHONHOME = (not set)
>>   PYTHONPATH = (not set)
>>   program name = /var/www/project/venu/bin/python
>>   isolated = 0
>>   environment = 1
>>   user site = 1
>>   import site = 1
>>   sys._base_executable = /var/www/project/venu/bin/python
>>   sys.base_prefix = '/opt/python3.8.2'
>>   sys.base_exec_prefix = '/opt/python3.8.2'
>>   sys.executable = '/var/www/project/venu/bin/python
>>   sys.prefix = '/opt/python3.8.2'
>>   sys.exec_prefix = '/opt/python3.8.2'
>>   sys.path = [
>> '/opt/python3.8.2/lib/python38.zip',
>> '/opt/python3.8.2/lib/python3.8',
>> '/opt/python3.8.2/lib/lib-dynload',
>>   ]
>> Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
>> filesystem encoding
>> Python runtime state: core initialized
>> ModuleNotFoundError: No module named encodings
>>
>> Current thread (most recent call first)
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f39f719-94f3-4f30-a7d3-2a65749af0cf%40googlegroups.com.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-25 Thread Mike Dewhirst

On 26/03/2020 2:29 pm, Hella Nick wrote:

你的服务器是安装的python3.8.2的版本吗?

Fateh Budwal mailto:fbud...@gmail.com>> 
于2020年3月26日周四 上午6:03写道:


Hello Everyone
 I have complied python 3.8.2 with django 2.2.



https://docs.djangoproject.com/en/3.0/faq/install/#faq-python-version-support

That page says Python 3.8 support was added in Django 2.2.8 but you 
don't mention which Django is installed in production.



it run locally fine but when i try to deploy it with Apache and
mod_wsgi 4.7.1 and getting the below error. Any suggestions ?

|Currentthread 0x7f5aa48af880(most recent call first):no
Pythonframe Pythonpath configuration:PYTHONHOME
=(notset)PYTHONPATH =(notset)program name
=/var/www/project/venu/bin/python isolated =0environment =1user
site =1importsite =1sys._base_executable
=/var/www/project/venu/bin/python sys.base_prefix
='/opt/python3.8.2'sys.base_exec_prefix
='/opt/python3.8.2'sys.executable
='/var/www/project/venu/bin/python sys.prefix = '/opt/python3.8.2'
sys.exec_prefix = '/opt/python3.8.2' sys.path = [
'/opt/python3.8.2/lib/python38.zip',
'/opt/python3.8.2/lib/python3.8',
'/opt/python3.8.2/lib/lib-dynload', ] Fatal Python error:
init_fs_encoding: failed to get the Python codec of the filesystem
encoding Python runtime state: core initialized
ModuleNotFoundError: No module named encodings Current thread
(most recent call first)|

-- 
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com

<https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHfGPEeGWB6kdVc65d6s53M-M0KnGS0Er_PFE-pz3tSZco_cGg%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAHfGPEeGWB6kdVc65d6s53M-M0KnGS0Er_PFE-pz3tSZco_cGg%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3e83ae41-7da3-d986-65a0-a4b9f90478e6%40dewhirst.com.au.


Re: keep getting the Fatal Python error with mod_wsgi and apache

2020-03-25 Thread Hella Nick
你的服务器是安装的python3.8.2的版本吗?

Fateh Budwal  于2020年3月26日周四 上午6:03写道:

> Hello Everyone
>  I have complied python 3.8.2 with django 2.2. it run locally fine but
> when i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the
> below error. Any suggestions ?
>
> Current thread 0x7f5aa48af880 (most recent call first):
> no Python framePython path configuration:
>   PYTHONHOME = (not set)
>   PYTHONPATH = (not set)
>   program name = /var/www/project/venu/bin/python
>   isolated = 0
>   environment = 1
>   user site = 1
>   import site = 1
>   sys._base_executable = /var/www/project/venu/bin/python
>   sys.base_prefix = '/opt/python3.8.2'
>   sys.base_exec_prefix = '/opt/python3.8.2'
>   sys.executable = '/var/www/project/venu/bin/python
>   sys.prefix = '/opt/python3.8.2'
>   sys.exec_prefix = '/opt/python3.8.2'
>   sys.path = [
> '/opt/python3.8.2/lib/python38.zip',
> '/opt/python3.8.2/lib/python3.8',
> '/opt/python3.8.2/lib/lib-dynload',
>   ]
> Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
> filesystem encoding
> Python runtime state: core initialized
> ModuleNotFoundError: No module named encodings
>
> Current thread (most recent call first)
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHfGPEeGWB6kdVc65d6s53M-M0KnGS0Er_PFE-pz3tSZco_cGg%40mail.gmail.com.


keep getting the Fatal Python error with mod_wsgi and apache

2020-03-25 Thread Fateh Budwal
Hello Everyone
 I have complied python 3.8.2 with django 2.2. it run locally fine but when
i try to deploy it with Apache and mod_wsgi 4.7.1 and getting the below
error. Any suggestions ?

Current thread 0x7f5aa48af880 (most recent call first):
no Python framePython path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = /var/www/project/venu/bin/python
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = /var/www/project/venu/bin/python
  sys.base_prefix = '/opt/python3.8.2'
  sys.base_exec_prefix = '/opt/python3.8.2'
  sys.executable = '/var/www/project/venu/bin/python
  sys.prefix = '/opt/python3.8.2'
  sys.exec_prefix = '/opt/python3.8.2'
  sys.path = [
'/opt/python3.8.2/lib/python38.zip',
'/opt/python3.8.2/lib/python3.8',
'/opt/python3.8.2/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec
of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named encodings

Current thread (most recent call first)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOts0r0qLZLyaFczsQvdKNm45uhhRFYZPwo3uTfMK9Jmy%2B1oNQ%40mail.gmail.com.


Basic Django Website Hangs on Apache 2.4.41 due to Pandas 1.0.1

2020-02-24 Thread Siddharth Agarwal
Hello Everyone,

I have build a basic Website using Python 3.7 + Django 3.0.0 + MySQL 8.0.18 
+ Pandas 1.0.1. This site works very well using py manage.py runserver on 
my local environment.

However, as soon as I deploy it on Apache 2.4.41 configured on Windows 10 
Server. The site starts giving 408 error. 

On further debugging I have observed that imports from pandas are the root 
cause of the issue. Please code from model.py for your reference - 

from django.db import models, connection

*# from pandas import DataFrame*
*# from pandas import concat, to_datetime, to_numeric*
*# Un-commenting above two lines cause the issue*

# Create your models here.
class ISMADates(models.Manager):
def date_list(self):
with connection.cursor() as cursor:
cursor.execute("select date_id, date from master_date order by 
date_id desc LIMIT 10;")
result_list = cursor.fetchall()
# print(result_list)
return result_list

However as per my understanding pandas should work seamlessly with Django. 
And this combination is quite widely used.

Please let me know how to proceed further.

Thanks and Regards,
Siddharth Agarwal

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bbeba4dc-d364-4e6b-a2fc-421afb4d942f%40googlegroups.com.


Geodjango deplyoment with Apache on Windows Server

2020-01-21 Thread 'nicola frosi' via Django users

I would like to know if anyone has ever managed to publish web pages 
created with geodjango using the OSGEO, mod_wsgi, Python36 libraries and 
drivers in PyCharm with APACHE. I would be interested in starting a 
discussion on which compilers in windows is better to use, or if to compile 
the Python modules it is better to use the classic Microsoft Visual C ++ 
14.0 compiler or you can opt for gcc or others. As for the configuration of 
Apache for the use of leaflet maps there is not much material on the net 
does anyone use the proxy module?
thank you
nicola

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf621a82-36f4-40b2-a356-3c5bf53d1441%40googlegroups.com.


Apache Django Devops: How to run django app runserver on Apache

2019-12-12 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 We can help you in this and related tasks mere at $7 per hour
Best Regards,
Divyesh Khamele,
Pythonmate

On Thu, 12 Dec 2019 at 10:30, Rupam Hazra  wrote:

>
>   Please help me out.
>
>  How to run django app runserver on Apache ?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4fa7f73b-a8d0-4784-9572-b7b07718ad8b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4fa7f73b-a8d0-4784-9572-b7b07718ad8b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH9mneWz1%3DiGqsHg27f4-gowhAwAi8vcpvxr2pROcuM8P2MezA%40mail.gmail.com.


Re: How to run django app runserver on Apache

2019-12-11 Thread Virendra Tripathi
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/modwsgi/


Virendra



On Wed, Dec 11, 2019 at 8:59 PM Rupam Hazra  wrote:

>
>   Please help me out.
>
>  How to run django app runserver on Apache ?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4fa7f73b-a8d0-4784-9572-b7b07718ad8b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4fa7f73b-a8d0-4784-9572-b7b07718ad8b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFJ-21DX6eNVy-XDTY5ZxPMN1_bhDR%3Dx1nRZJ-8uNHmdreNPAQ%40mail.gmail.com.


How to run django app runserver on Apache

2019-12-11 Thread Rupam Hazra

  Please help me out.

 How to run django app runserver on Apache ?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4fa7f73b-a8d0-4784-9572-b7b07718ad8b%40googlegroups.com.


apache on windows

2019-10-21 Thread Luca Bertolotti
Hello 
I need to run my project in windows with apache.

I have installed apache and it's running because when i browse to 
127.0.0.1:5000 i get "It works!", i change the default port to 5000 because 
on windows you have IIS working on port 80

this are my file I write only what i have change from the original
httpd.conf:

Listen 5000
LoadFile 
"c:/users/administrator/appdata/local/programs/python/python37/python37.dll"
LoadModule wsgi_module 
"c:/users/administrator/appdata/local/programs/python/python37/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIPythonHome 
"c:/users/administrator/appdata/local/programs/python/python37"


SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

WSGIScriptAlias /mysite "F:/mysite/mysite/wsgi.py"
WSGIPythonPath "F:/mysite/mysite/"



Require all granted



Thank this is my wsgi.py

"""
WSGI config for mysite project.

It exposes the WSGI callable as a module-level variable named 
``application``.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')

application = get_wsgi_application()

But as told before i see only it works

What is wrong?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/586bc3a6-3c6a-41e8-81ed-d237397de5e6%40googlegroups.com.


Apache reverse proxy for django app running in singularity container

2019-09-04 Thread bhuffman


I'm trying to set up an Apache reverse proxy for a django app that is 
running in a singularity container.

I've tried the following in my apache conf.d/app.conf:

ProxyPreserveHost OnRequestHeader set X-Forwarded-Proto 'https' 
env=HTTPSProxyPass "/app_prefix/"  "http://localhost:8101/"ProxyPassReverse 
"/app_prefix/"  "http://localhost:8101/";

I've tried using the following in the mysite/sittings (django):

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
USE_X_FORWARDED_HOST = True
FORCE_SCRIPT_NAME = '/app_prefix/'

None of these seem to work.

Here's how I'm starting the django app:

/software/singularity/bin/singularity exec -B /basedir:/mnt 
/basedir/container.simg /mnt/bin/run_in_singularity.sh

The 'run_in_singularity.sh' is as follows:

cd /mnt/simple-ajax-crud/
python manage.py runserver 0.0.0.0:8101

The app loads, but the app isn't creating relative URLs, so includes are 
referenced under /static (which can't be found b/c it doesn't match the 
proxy/reverse proxy).

If I work around '/static' by adding additional reverse proxies, then I run 
into other URLs in the app with the same problem. So I need to figure out 
how to inform the app to create the correct URLs.


Any help is greatly appreciated.

Thanks, Brian

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aa03bc92-07c9-4142-9411-0540eabaa29d%40googlegroups.com.


Apache reverse proxy for django app running in singularity container

2019-09-04 Thread bhuffman


I'm trying to set up an Apache reverse proxy for a django app that is 
running in a singularity container.  I'm also trying to enforce HTTPS on 
the Apache frontend.

I've tried the following in my apache conf.d/app.conf:

ProxyPreserveHost OnRequestHeader set X-Forwarded-Proto 'https' 
env=HTTPSProxyPass "/app_prefix/"  "http://localhost:8101/"ProxyPassReverse 
"/app_prefix/"  "http://localhost:8101/";

I've tried using the following in the mysite/sittings (django):

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
USE_X_FORWARDED_HOST = True
FORCE_SCRIPT_NAME = '/app_prefix/'

None of these seem to work.

Here's how I'm starting the django app:

/software/singularity/bin/singularity exec -B /basedir:/mnt 
/basedir/container.simg /mnt/bin/run_in_singularity.sh

The 'run_in_singularity.sh' is as follows:

cd /mnt/simple-ajax-crud/
python manage.py runserver 0.0.0.0:8101

The app loads, but the app isn't creating relative URLs, so includes are 
referenced under /static (which can't be found b/c it doesn't match the 
proxy/reverse proxy).

If I work around '/static' by adding additional reverse proxies, then I run 
into other URLs in the app with the same problem. So I need to figure out 
how to inform the app to create the correct URLs.


Can anyone help?


Thanks, Brian

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/247cf1c4-5ccb-40db-9545-68ae5714c4f1%40googlegroups.com.


Re: nginx server to apache

2019-08-15 Thread 'Maher, Brian' via Django users
Yes, certainly!

You can run Django apps under apache using mod_wsgi. There’s an example 
configuration here: 
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/modwsgi/

Best
Brian


—
Best Regards,
Brian Maher

On 15 Aug 2019, at 09:17, gopi p 
mailto:gopi.s...@gmail.com>> wrote:

Hi,

It is possible to run instead of  ngnix server  to apache server

--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKEkmnmr10UU2hf7OsjiFSLt7xNt2sMS47F-kh7hFiWO56WDA%40mail.gmail.com<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdjango-users%2FCAFKEkmnmr10UU2hf7OsjiFSLt7xNt2sMS47F-kh7hFiWO56WDA%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=01%7C01%7Cbrian.maher%40kcl.ac.uk%7C7a2c24b70ef0401937ea08d7217c88e5%7C8370cf1416f34c16b83c724071654356%7C0&sdata=RTq4kr4ZrUixx0MPaIeFSHcOU51I7kY0FOeRIktDMVA%3D&reserved=0>.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9C1A75B3-4CD4-4B56-82E9-6D47B1C8368E%40kcl.ac.uk.


nginx server to apache

2019-08-15 Thread gopi p
Hi,

It is possible to run instead of  ngnix server  to apache server

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKEkmnmr10UU2hf7OsjiFSLt7xNt2sMS47F-kh7hFiWO56WDA%40mail.gmail.com.


How to configure and run Laravel and Django project on different domains but same Apache server on Ubuntu 16.04 VPS Hostgator

2019-08-03 Thread Pooja Aiivine
Hello All,
  I have hosted Laravel Project as well as Django Project on two different 
domains on Ubuntu 16.04 VPS  with Plesk Panel. Laravel project was working 
perfectly until the Django was not hosted. After I have done Django 
configuration in apache2.conf file my all laravel projects stopped working. 
Kindly guide me on how to run laravel and django project on different 
domain but on same apache server (version 2.4) on Ubuntu.

We have added following configuration in apache2.conf file 

WSGIScriptAlias / 
/var/www/vhosts/itssmartworld.com/MyAwesomeCart/mac/wsgi.py
WSGIPythonHome /var/www/vhosts/itssmartworld.com/MyAwesomeCart/venv
WSGIPythonPath /var/www/vhosts/itssmartworld.com/MyAwesomeCart



Require all granted



Regards.

- Pooja

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6023f56-2107-4234-b961-740ecd8bbf72%40googlegroups.com.


Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-24 Thread Volker Kraut
Luke! That did the trick! Many thanks.

Am Mo., 24. Juni 2019 um 01:19 Uhr schrieb Luke :

> Hah! Found it!
>
> The psycopg2-binary module needed to be reinstalled (now version 2.8.3)
>
> I believe the old one must have been compiled against libssl1.1.0, which
> was replaced by 1.1.1 in the upgrade which broke things.
>
> On Monday, June 24, 2019 at 11:11:11 AM UTC+12, Luke wrote:
>>
>> I'm having the same problem, totally unable to find a resolution so far.
>>
>> I get no error messages of any use, even with all logging set to DEBUG.
>> The only thing i'm seeing is "Truncated or oversized response headers
>> received from daemon process" in the apache error log.
>>
>> Works fine when using the Django development server. Broke last week
>> after updating the system python and openssl packages.
>>
>> Anyone else having this problem?
>>
>> On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>>>
>>> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server
>>> with apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws
>>> an exception after https login - as it seems - after a package upgrade.
>>> To my understanding libssl/openssl is causing the error. The error
>>> message below states that openssl_1_1_1 is not found. Though it seems to be
>>> installed.
>>>
>>> Could you guys give me a pointer? Please let me know if I need to
>>> provide additional information.
>>>
>>> Thanks and cheers!
>>>
>>>
>>>
>>> Two days ago following packages where upgraded:
>>> =
>>> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
>>> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>>> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 =>
>>> 2.56.4-0ubuntu0.18.04.3
>>> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>>> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>>> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
>>> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>>> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>>> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>>
>>> Login Implementation
>>> 
>>> Im using djangos login views:
>>> settings.py:
>>> LOGIN_URL = '/accounts/login/'
>>> urls.py:
>>> path('accounts/', include('django.contrib.auth.urls')),
>>>
>>> Error after Login Page of application / and django admin:
>>> 
>>> "Internal Server Error
>>> The server encountered an internal error or misconfiguration and was
>>> unable to complete your request."
>>>
>>> Error in Apache Log
>>> ==
>>> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid
>>> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274):
>>> Request data read error when proxying data to daemon process: Connection
>>> reset by peer.
>>> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid
>>> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized
>>> response headers received from daemon process 'fotobau.ourdomain.de':
>>> /srv/fotobau/djangoprojekt/wsgi.py, referer:
>>> https://www.fotobau.ourdomain/accounts/login/
>>>
>>> Unfortunately I failed to obtain a core dump till now.
>>>
>>> Though right now I suspect the prob

Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-23 Thread Luke
Hah! Found it!

The psycopg2-binary module needed to be reinstalled (now version 2.8.3)

I believe the old one must have been compiled against libssl1.1.0, which 
was replaced by 1.1.1 in the upgrade which broke things.

On Monday, June 24, 2019 at 11:11:11 AM UTC+12, Luke wrote:
>
> I'm having the same problem, totally unable to find a resolution so far.
>
> I get no error messages of any use, even with all logging set to DEBUG. 
> The only thing i'm seeing is "Truncated or oversized response headers 
> received from daemon process" in the apache error log.
>
> Works fine when using the Django development server. Broke last week after 
> updating the system python and openssl packages.
>
> Anyone else having this problem?
>
> On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>>
>> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server 
>> with apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws 
>> an exception after https login - as it seems - after a package upgrade.
>> To my understanding libssl/openssl is causing the error. The error 
>> message below states that openssl_1_1_1 is not found. Though it seems to be 
>> installed.
>>
>> Could you guys give me a pointer? Please let me know if I need to provide 
>> additional information.
>>
>> Thanks and cheers!
>>
>>
>>
>> Two days ago following packages where upgraded:
>> =
>> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
>> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
>> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
>> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
>> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
>> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
>> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>>
>> Login Implementation
>> 
>> Im using djangos login views:
>> settings.py:
>> LOGIN_URL = '/accounts/login/'
>> urls.py:
>> path('accounts/', include('django.contrib.auth.urls')),
>>
>> Error after Login Page of application / and django admin:
>> 
>> "Internal Server Error
>> The server encountered an internal error or misconfiguration and was 
>> unable to complete your request."
>>
>> Error in Apache Log
>> ==
>> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
>> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
>> data read error when proxying data to daemon process: Connection reset by 
>> peer.
>> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
>> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
>> response headers received from daemon process 'fotobau.ourdomain.de': 
>> /srv/fotobau/djangoprojekt/wsgi.py, referer: 
>> https://www.fotobau.ourdomain/accounts/login/
>>
>> Unfortunately I failed to obtain a core dump till now.
>>
>> Though right now I suspect the problem occurs when django tries to 
>> receive the https/encrypted user and password. I suspect this because I got 
>> another error message!
>>
>> Another Error in Django Log
>> 
>> Here I got a new error message: The first one ('Exception' is not JSON 
>> serializable) is fairly common - though I didn´t manage to fix it till now, 
>> it never really bothered.
>> 

Re: libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-23 Thread Luke
I'm having the same problem, totally unable to find a resolution so far.

I get no error messages of any use, even with all logging set to DEBUG. The 
only thing i'm seeing is "Truncated or oversized response headers received 
from daemon process" in the apache error log.

Works fine when using the Django development server. Broke last week after 
updating the system python and openssl packages.

Anyone else having this problem?

On Friday, June 14, 2019 at 1:31:29 PM UTC+12, Volker wrote:
>
> Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server with 
> apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws an 
> exception after https login - as it seems - after a package upgrade.
> To my understanding libssl/openssl is causing the error. The error message 
> below states that openssl_1_1_1 is not found. Though it seems to be 
> installed.
>
> Could you guys give me a pointer? Please let me know if I need to provide 
> additional information.
>
> Thanks and cheers!
>
>
>
> Two days ago following packages where upgraded:
> =
> libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
> libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
> libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
> libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
> libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
> python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
> python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
> python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
> systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
> udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
>
> Login Implementation
> 
> Im using djangos login views:
> settings.py:
> LOGIN_URL = '/accounts/login/'
> urls.py:
> path('accounts/', include('django.contrib.auth.urls')),
>
> Error after Login Page of application / and django admin:
> 
> "Internal Server Error
> The server encountered an internal error or misconfiguration and was 
> unable to complete your request."
>
> Error in Apache Log
> ==
> [Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
> 140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
> data read error when proxying data to daemon process: Connection reset by 
> peer.
> [Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
> 140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
> response headers received from daemon process 'fotobau.ourdomain.de': 
> /srv/fotobau/djangoprojekt/wsgi.py, referer: 
> https://www.fotobau.ourdomain/accounts/login/
>
> Unfortunately I failed to obtain a core dump till now.
>
> Though right now I suspect the problem occurs when django tries to receive 
> the https/encrypted user and password. I suspect this because I got another 
> error message!
>
> Another Error in Django Log
> 
> Here I got a new error message: The first one ('Exception' is not JSON 
> serializable) is fairly common - though I didn´t manage to fix it till now, 
> it never really bothered.
> Though after the package upgrade it raises a new error message (which will 
> raise itself again for 3 times) below - the one with "ImportError: 
> /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":
>
> ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
> /restservice/v1/fotos/
> Traceback (most recent call last):
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
>  
> line 34, in inner
> response = get_response(request)
>   File 
> "/home/eidle/.virtualenvs/fotobau/lib/python3.6/si

libssl.so.1.1 / OPENSSL_1_1_1 not found after upgrade (ubuntu server 18.04 / apache / mod_wsgi)

2019-06-13 Thread Volker
Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server with 
apache 2.4 (from repo9 and mod_wsgi in an venv with Python 3.6 throws an 
exception after https login - as it seems - after a package upgrade.
To my understanding libssl/openssl is causing the error. The error message 
below states that openssl_1_1_1 is not found. Though it seems to be 
installed.

Could you guys give me a pointer? Please let me know if I need to provide 
additional information.

Thanks and cheers!



Two days ago following packages where upgraded:
=
libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22

Login Implementation

Im using djangos login views:
settings.py:
LOGIN_URL = '/accounts/login/'
urls.py:
path('accounts/', include('django.contrib.auth.urls')),

Error after Login Page of application / and django admin:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable 
to complete your request."

Error in Apache Log
==
[Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
data read error when proxying data to daemon process: Connection reset by 
peer.
[Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
response headers received from daemon process 'fotobau.ourdomain.de': 
/srv/fotobau/djangoprojekt/wsgi.py, referer: 
https://www.fotobau.ourdomain/accounts/login/

Unfortunately I failed to obtain a core dump till now.

Though right now I suspect the problem occurs when django tries to receive 
the https/encrypted user and password. I suspect this because I got another 
error message!

Another Error in Django Log

Here I got a new error message: The first one ('Exception' is not JSON 
serializable) is fairly common - though I didn´t manage to fix it till now, 
it never really bothered.
Though after the package upgrade it raises a new error message (which will 
raise itself again for 3 times) below - the one with "ImportError: 
/usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":

ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
/restservice/v1/fotos/
Traceback (most recent call last):
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
 
line 34, in inner
response = get_response(request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 154, in _get_response
response = response.render()
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/template/response.py",
 
line 106, in render
self.content = self.rendered_content
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/response.py",
 
line 72, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/renderers.py",
 
line 107, in render
allow_nan=not self.strict, separators=separators
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/uti

django/apache/ubuntu server18.04 openssl not found after package upgrade / libssl.so.1.1: version `OPENSSL_1_1_1' not found

2019-06-13 Thread Volker
Two days ago my django app which runs on an Ubuntu 18.04.2 LTS server with 
apache and mod_wsgi in an venv with Python 3.6 throws an exception after 
https login - as it seems - after a package upgrade.
To my understanding libssl/openssl is causing the error. The error message 
below states that openssl_1_1_1 is not found. Though it seems to be 
installed.

Could you guys give me a pointer? Please let me know if I need to provide 
additional information.

Thanks and cheers!



Two days ago following packages where upgraded:
=
libelf1:amd64 0.170-0.4 => 0.170-0.4ubuntu0.1
libglib2.0-0:amd64 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libglib2.0-data:all 2.56.4-0ubuntu0.18.04.2 => 2.56.4-0ubuntu0.18.04.3
libnss-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpam-systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libpython3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6-stdlib:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libpython3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
libssl1.1:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
libsystemd0:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
libudev1:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
openssl:amd64 1.1.0g-2ubuntu4.3 => 1.1.1-1ubuntu2.1~18.04.1
python3-cryptography:amd64 2.1.4-1ubuntu1.2 => 2.1.4-1ubuntu1.3
python3-distutils:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-gdbm:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04
python3-lib2to3:all 3.6.7-1~18.04 => 3.6.8-1~18.04
python3.6-minimal:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6-venv:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
python3.6:amd64 3.6.7-1~18.04 => 3.6.8-1~18.04.1
systemd-sysv:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
systemd:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22
udev:amd64 237-3ubuntu10.21 => 237-3ubuntu10.22

Login Implementation

Im using djangos login views:
settings.py:
LOGIN_URL = '/accounts/login/'
urls.py:
path('accounts/', include('django.contrib.auth.urls')),

Error after Login Page of application / and django admin:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable 
to complete your request."

Error in Apache Log
==
[Thu Jun 13 18:58:10.555937 2019] [wsgi:error] [pid 1274:tid 
140451378087680] [client 77.8.21.189:48212] mod_wsgi (pid=1274): Request 
data read error when proxying data to daemon process: Connection reset by 
peer.
[Thu Jun 13 20:46:51.186545 2019] [wsgi:error] [pid 1274:tid 
140451252197120] [client 217.18.178.226:61510] Truncated or oversized 
response headers received from daemon process 'fotobau.ourdomain.de': 
/srv/fotobau/djangoprojekt/wsgi.py, referer: 
https://www.fotobau.ourdomain/accounts/login/

Unfortunately I failed to obtain a core dump till now.

Though right now I suspect the problem occurs when django tries to receive 
the https/encrypted user and password. I suspect this because I got another 
error message!

Another Error in Django Log

Here I got a new error message: The first one ('Exception' is not JSON 
serializable) is fairly common - though I didn´t manage to fix it till now, 
it never really bothered.
Though after the package upgrade it raises a new error message (which will 
raise itself again for 3 times) below - the one with "ImportError: 
/usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1":

ERROR 2019-06-12 19:57:17,638 log 505 Internal Server Error: 
/restservice/v1/fotos/
Traceback (most recent call last):
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/exception.py",
 
line 34, in inner
response = get_response(request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 156, in _get_response
response = self.process_exception_by_middleware(e, request)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/core/handlers/base.py",
 
line 154, in _get_response
response = response.render()
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/django/template/response.py",
 
line 106, in render
self.content = self.rendered_content
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/response.py",
 
line 72, in rendered_content
ret = renderer.render(self.data, accepted_media_type, context)
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/renderers.py",
 
line 107, in render
allow_nan=not self.strict, separators=separators
  File 
"/home/eidle/.virtualenvs/fotobau/lib/python3.6/site-packages/rest_framework/utils/json.py"

django runserver + weasyprint + not taking the CSS files or getting css applied on the PDF + but working fine with Apache

2019-06-11 Thread Maurya Allimuthu
Hi All,

We are having two server.

In one server ,

   - django runs with apache
   - Weasyprint version 0.40
   - PDF is rendered with CSS applied (path is in static folder)

In another server,

   - django runs with runserver
   - Weasyprint version 0.40
   - PDF is rendered *WITHOUT* the CSS (path is in static folder)

Could anyone help here why with django runserver , the weasyprint could not 
able to link the CSS files in the static folder while rendering/generating 
PDF

Thanks,
Maurya
djangoian
   


-- 
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/97f559b7-36a3-49c8-acc0-06f059bf3c67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: is that any way to deploy django in apache with centos

2019-06-01 Thread Ryan Nowakowski
Please post the specific error you're getting.

On May 30, 2019 6:59:22 AM CDT, Kurosh Sol  wrote:
>is that any way to set Django in apache with wsgi mod  in centos
>I keep reading and still get error 
>any good resource can really work?
>
>-- 
>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/d041c339-201f-420b-a2b1-849016ae0b7a%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/ED256938-23CE-467B-A2B7-91F64A9D7425%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Re: is that any way to deploy django in apache with centos

2019-05-30 Thread Suresh Kannan
Hi,

I found this video helpful
https://www.youtube.com/watch?v=DzXCHAuHf0I&t=1553s but with Nginx and
Uwsgi.

Hope this helps you!

Suresh

On Thu, May 30, 2019 at 7:59 AM Kurosh Sol  wrote:

> is that any way to set Django in apache with wsgi mod  in centos
> I keep reading and still get error
> any good resource can really work?
>
> --
> 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/d041c339-201f-420b-a2b1-849016ae0b7a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d041c339-201f-420b-a2b1-849016ae0b7a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CANfVfcDo-vh6VHnoUSGDbr64pTxzbzSD_f1Lm_9GPTWKMf0hhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


is that any way to deploy django in apache with centos

2019-05-30 Thread Kurosh Sol
is that any way to set Django in apache with wsgi mod  in centos
I keep reading and still get error 
any good resource can really work?

-- 
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/d041c339-201f-420b-a2b1-849016ae0b7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django wsgi apache Deploy project

2019-05-30 Thread N'BE SORO
 thank you everyone I managed the deployment

Le mar. 7 mai 2019 à 18:48, Subhodeep Das  a
écrit :

> Try:
>
> WSGIScriptAlias /test/tc-test /var/www/stage/hello/tc-test/django.wsgi
>
> You shouldn't have trailing slash on first argument.
>
> On Tue, May 7, 2019 at 7:27 PM N'BE SORO  wrote:
>
>>
>> Hi I'm a beginner in python and I realized a project in Django. I have
>> problems in hosting my project. here is my code in the 000-default.conf
>>  #ServerName #ServerAlias ServerAdmin webmaster @
>> localhost DocumentRoot / var / www / html / ecommerce WSGIScriptAlias ​​/
>> /var/www/html/ecommerce/ecommerce/wsgi.py WSGIPythonPath / var / www / html
>> / ecommerce / ErrorLog $ {APACHE_LOG_DIR} /error.log CustomLog $
>> {APACHE_LOG_DIR} /access.log combined  and I have this error
>> Invalid command 'WSGIScriptAlias / /var / www / html / ecommerce /
>> ecommerce / wsgi.py ', perhaps misspelled or d efined by a module not
>> included in the server configuration
>>
>> --
>> 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/1912bcdc-cb2f-45a2-932c-d579eb944c0a%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/CAJEaip7ZtWWZW--O9Z2nqvVypwLe8CMRVSPboc28yoNkaLMV%3Dg%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/CAOtSHp--MqaZPhUZiPUgBdBEMp%2B2F0Mm_uQHJ%2But1_qHh75d4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1 project, X app = X subdomains (Django, Apache)

2019-05-23 Thread Aldian Fazrihady
Official way:
1. Run separate wsgi process for each subdomain. Each wsgi process uses
unique Unix or TCP socket.
2. Each wsgi process uses its own Django settings that points to the
specific app's urls.py
3. The web server configuration for each subdomain points to the socket of
the Django app representing that subdomain.

Unofficial way:
Create path rewriting rule in wsgi configuration.

I have used those both ways in the past. If your machine has very limited
RAM,  such as 1 GB or below that,  I suggest you to try the second way.


Regards,

Aldian Fazrihady
https://www.aldianfazrihady.com/en-us/

On Thu, 23 May 2019, 21:53 Jakub Jiřička,  wrote:

> Hi,
>
> I want to ask you if someone has solved how to prove that is possible the
> applications in one project run in different subdomains?
>
> I have 1 project (projekt.cz) and provide of 3 applications (app1, app2,
> app3) and I would like to get on my vps (CentOS, Apache, PostgreSQL,
> Django) app1.projekt.cz app2.projekt.cz and app3.projekt.cz
>
> I searched everywhere and I found only django-subdomains and
> django-domains ... unfortunately, I have not managed to get started,
> because out-of-date ...
>
> So, there is someone who can help me with settings Django for this
> task/problem?
>
> Many thanks and regards
> Jakub
>
> --
> 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/0d2ddb92-5aec-4155-9071-d8c3a69ebee6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0d2ddb92-5aec-4155-9071-d8c3a69ebee6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAN7EoAbNGEhsemXw6VV%2BPu3uvSTsRpX%2Bo2Y4AOJBicCcv%3DpAsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1 project, X app = X subdomains (Django, Apache)

2019-05-23 Thread Tim Chase
On 2019-05-23 06:22, Jakub Jiřička wrote:
> I want to ask you if someone has solved how to prove that is
> possible the applications in one project run in different
> subdomains?
>
> I have 1 project (projekt.cz) and provide of 3 applications (app1,
> app2, app3) and I would like to get on my vps (CentOS, Apache,
> PostgreSQL, Django) app1.projekt.cz app2.projekt.cz and
> app3.projekt.cz

I can read two interpretations of what what you describe:

1) each application is distinct/independent and you want each one to
run on its own subdomain.  This seems like the most sensible
interpretation and is fairly straightforward:  you configure your
web server (apache, from your description) to farm out different
subdomains:

  
   ServerName app1.example.com
   DocumentRoot /var/www/vhosts/app1
   WSGIScriptAlias / /var/www/vhosts/app1/myproject1/wsgi.py
   ⋮
  
  
   ServerName app2.example.com
   DocumentRoot /var/www/vhosts/app2
   WSGIScriptAlias / /var/www/vhosts/app2/myproject2/wsgi.py
   ⋮
  

with the relevant configuration in each block.


2) if you want to run the same Django code, backing multiple
subdomains with the same codebase, you want a wildcard subdomain
pointed at 

  
   ServerAlias *.example.com
   ⋮
  

and then sniff the Host: HTTP header which something like
django-subdomains helps to make easier.

> I searched everywhere and I found only django-subdomains and
> django-domains ... unfortunately, I have not managed to get
> started, because out-of-date 

I'm not sure what you mean by "because out-of-date".  While
they both appear to have been last updated in 2016, I imagine they
got to the point where they just worked and didn't need much more
care & feeding.  I'd assume they're fine unless you hit an issue with
them.

-tkc











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


1 project, X app = X subdomains (Django, Apache)

2019-05-23 Thread Jakub Jiřička
Hi,

I want to ask you if someone has solved how to prove that is possible the 
applications in one project run in different subdomains?

I have 1 project (projekt.cz) and provide of 3 applications (app1, app2, 
app3) and I would like to get on my vps (CentOS, Apache, PostgreSQL, 
Django) app1.projekt.cz app2.projekt.cz and app3.projekt.cz

I searched everywhere and I found only django-subdomains and django-domains 
... unfortunately, I have not managed to get started, because out-of-date 
...

So, there is someone who can help me with settings Django for this 
task/problem?

Many thanks and regards
Jakub

-- 
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/0d2ddb92-5aec-4155-9071-d8c3a69ebee6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django wsgi apache Deploy project

2019-05-07 Thread Subhodeep Das
Try:

WSGIScriptAlias /test/tc-test /var/www/stage/hello/tc-test/django.wsgi

You shouldn't have trailing slash on first argument.

On Tue, May 7, 2019 at 7:27 PM N'BE SORO  wrote:

>
> Hi I'm a beginner in python and I realized a project in Django. I have
> problems in hosting my project. here is my code in the 000-default.conf
>  #ServerName #ServerAlias ServerAdmin webmaster @
> localhost DocumentRoot / var / www / html / ecommerce WSGIScriptAlias ​​/
> /var/www/html/ecommerce/ecommerce/wsgi.py WSGIPythonPath / var / www / html
> / ecommerce / ErrorLog $ {APACHE_LOG_DIR} /error.log CustomLog $
> {APACHE_LOG_DIR} /access.log combined  and I have this error
> Invalid command 'WSGIScriptAlias / /var / www / html / ecommerce /
> ecommerce / wsgi.py ', perhaps misspelled or d efined by a module not
> included in the server configuration
>
> --
> 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/1912bcdc-cb2f-45a2-932c-d579eb944c0a%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/CAJEaip7ZtWWZW--O9Z2nqvVypwLe8CMRVSPboc28yoNkaLMV%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django wsgi apache Deploy project

2019-05-07 Thread Kevin Jay
Remove the spaces in the paths:
WSGIPythonPath / var / www / html / ecommerce /
should be
WSGIPythonPath  /var/www/html/ecommerce/

Do the same for the other paths

On Tue, May 7, 2019 at 8:57 AM N'BE SORO  wrote:

>
> Hi I'm a beginner in python and I realized a project in Django. I have
> problems in hosting my project. here is my code in the 000-default.conf
>  #ServerName #ServerAlias ServerAdmin webmaster @
> localhost DocumentRoot / var / www / html / ecommerce WSGIScriptAlias ​​/
> /var/www/html/ecommerce/ecommerce/wsgi.py WSGIPythonPath / var / www / html
> / ecommerce / ErrorLog $ {APACHE_LOG_DIR} /error.log CustomLog $
> {APACHE_LOG_DIR} /access.log combined  and I have this error
> Invalid command 'WSGIScriptAlias / /var / www / html / ecommerce /
> ecommerce / wsgi.py ', perhaps misspelled or d efined by a module not
> included in the server configuration
>
> --
> 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/1912bcdc-cb2f-45a2-932c-d579eb944c0a%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/CAEtabwdEQtikBmkrpvpFLJ0oHY%3DfWJhSm5VLGBU7yxwYWq_b2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django wsgi apache Deploy project

2019-05-07 Thread N'BE SORO

Hi I'm a beginner in python and I realized a project in Django. I have 
problems in hosting my project. here is my code in the 000-default.conf 
 #ServerName #ServerAlias ServerAdmin webmaster @ 
localhost DocumentRoot / var / www / html / ecommerce WSGIScriptAlias ​​/ 
/var/www/html/ecommerce/ecommerce/wsgi.py WSGIPythonPath / var / www / html 
/ ecommerce / ErrorLog $ {APACHE_LOG_DIR} /error.log CustomLog $ 
{APACHE_LOG_DIR} /access.log combined  and I have this error 
Invalid command 'WSGIScriptAlias / /var / www / html / ecommerce / 
ecommerce / wsgi.py ', perhaps misspelled or d efined by a module not 
included in the server configuration

-- 
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/1912bcdc-cb2f-45a2-932c-d579eb944c0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-29 Thread Gundla Kumar
Hai,

Can you help me how to solve my problem, when launch project in my local,
it gives error as "ImportError: No module named copy_reg" and "ImportError:
No module named multiplearray"

On Tue, Jan 29, 2019 at 5:30 PM Binoy U  wrote:

> Hello Simon,
>
> Thank you for the reply. I have changed it as you mentioned and it's
> working now. I will raise an issue to update the documentation.
>
> On Monday, January 28, 2019 at 1:20:24 PM UTC+1, Binoy U wrote:
>>
>> Hello,
>>
>> I have created a django project with only one application. I haven't made
>> any changes in the application. Only added the application to the settings
>> and updated static and media urls.
>>
>> Migration is done and super user was created.
>>
>> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according
>> to Authenticating against Django’s user database from Apache
>> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/apache-auth/>
>> .
>>
>> But getting the following error in apache error log.
>>
>> Traceback (most recent call last):
>>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
>> 13, in 
>> from django.contrib.auth.handlers.modwsgi import check_password
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>>  line 5, in 
>> UserModel = auth.get_user_model()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>>  line 165, in get_user_model
>> return django_apps.get_model(settings.AUTH_USER_MODEL, 
>> require_ready=False)
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 197, in get_model
>> self.check_apps_ready()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 132, in check_apps_ready
>> raise AppRegistryNotReady("Apps aren't loaded yet.")
>>
>> Please find files below wsgi.py
>>
>> import osimport mod_wsgi
>>
>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
>> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
>> django.core.wsgi import get_wsgi_application
>> application = get_wsgi_application()
>>
>> Error is triggered from from django.contrib.auth.handlers.modwsgi import
>> check_password.
>>
>>
>> apache config file 000-defaults.conf
>> <https://github.com/binoyudayan/django_apache_issue/blob/master/000-default.conf>
>>
>>
>> Authentication is enabled on the media url. So I hope the apache
>> configuration is working fine. I have create a github repository
>> <https://github.com/binoyudayan/django_apache_issue> if you would like
>> to check.
>>
>> I got this issue from a bigger project with many application and other
>> django modules. But I could still reproduce the same issue with this simple
>> project. Can you please help me to resolve this issue, thanks in advance!
>>
> --
> 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/276e126a-6093-42b2-b6ce-9db77b919027%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/276e126a-6093-42b2-b6ce-9db77b919027%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAN0qQEYQ8oTG8gLnWbG00a%2B97rcvPp77xh5zCtf57Sm-70ka_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-29 Thread Binoy U
Hello Simon,

Thank you for the reply. I have changed it as you mentioned and it's 
working now. I will raise an issue to update the documentation.

On Monday, January 28, 2019 at 1:20:24 PM UTC+1, Binoy U wrote:
>
> Hello,
>
> I have created a django project with only one application. I haven't made 
> any changes in the application. Only added the application to the settings 
> and updated static and media urls.
>
> Migration is done and super user was created.
>
> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according to 
> Authenticating 
> against Django’s user database from Apache 
> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/apache-auth/>
> .
>
> But getting the following error in apache error log.
>
> Traceback (most recent call last):
>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
> 13, in 
> from django.contrib.auth.handlers.modwsgi import check_password
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>  line 5, in 
> UserModel = auth.get_user_model()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>  line 165, in get_user_model
> return django_apps.get_model(settings.AUTH_USER_MODEL, 
> require_ready=False)
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 197, in get_model
> self.check_apps_ready()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 132, in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
>
> Please find files below wsgi.py
>
> import osimport mod_wsgi
>
> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
> django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> Error is triggered from from django.contrib.auth.handlers.modwsgi import 
> check_password.
>
>
> apache config file 000-defaults.conf 
> <https://github.com/binoyudayan/django_apache_issue/blob/master/000-default.conf>
>
>
> Authentication is enabled on the media url. So I hope the apache 
> configuration is working fine. I have create a github repository 
> <https://github.com/binoyudayan/django_apache_issue> if you would like to 
> check.
>
> I got this issue from a bigger project with many application and other 
> django modules. But I could still reproduce the same issue with this simple 
> project. Can you please help me to resolve this issue, thanks in advance!
>

-- 
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/276e126a-6093-42b2-b6ce-9db77b919027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-28 Thread Simon Charette
Hello again :)

Someone pointed out to me that it might be a documentation issue that 
requires
that you import check_password only after calling get_wsgi_application().

For example, your wsgi.py module would look like

import os
import mod_wsgi

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

from django.contrib.auth.handlers.modwsgi import check_password

In all cases a bug report should be filled to either adjust the 
documentation or the calls to
get_user_model() in django.contrib.auth.handlers.modwsgi.

Best,
Simon

Le lundi 28 janvier 2019 10:16:30 UTC-5, Simon Charette a écrit :
>
> Hello there,
>
> That looks like a Django bug to me as auth.get_user_model() should only be 
> performed
> from within the check_password() function as it will certainly crash at 
> the module level.
>
> You should file a bug report so it gets addressed[0].
>
> Best,
> Simon
>
> [0] https://code.djangoproject.com/newticket
>
> Le lundi 28 janvier 2019 07:20:24 UTC-5, Binoy U a écrit :
>>
>> Hello,
>>
>> I have created a django project with only one application. I haven't made 
>> any changes in the application. Only added the application to the settings 
>> and updated static and media urls.
>>
>> Migration is done and super user was created.
>>
>> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according 
>> to Authenticating against Django’s user database from Apache 
>> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/apache-auth/>
>> .
>>
>> But getting the following error in apache error log.
>>
>> Traceback (most recent call last):
>>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
>> 13, in 
>> from django.contrib.auth.handlers.modwsgi import check_password
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>>  line 5, in 
>> UserModel = auth.get_user_model()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>>  line 165, in get_user_model
>> return django_apps.get_model(settings.AUTH_USER_MODEL, 
>> require_ready=False)
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 197, in get_model
>> self.check_apps_ready()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 132, in check_apps_ready
>> raise AppRegistryNotReady("Apps aren't loaded yet.")
>>
>> Please find files below wsgi.py
>>
>> import osimport mod_wsgi
>>
>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
>> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
>> django.core.wsgi import get_wsgi_application
>> application = get_wsgi_application()
>>
>> Error is triggered from from django.contrib.auth.handlers.modwsgi import 
>> check_password.
>>
>>
>> apache config file 000-defaults.conf 
>> <https://github.com/binoyudayan/django_apache_issue/blob/master/000-default.conf>
>>
>>
>> Authentication is enabled on the media url. So I hope the apache 
>> configuration is working fine. I have create a github repository 
>> <https://github.com/binoyudayan/django_apache_issue> if you would like 
>> to check.
>>
>> I got this issue from a bigger project with many application and other 
>> django modules. But I could still reproduce the same issue with this simple 
>> project. Can you please help me to resolve this issue, thanks in advance!
>>
>

-- 
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/bfdc8e5e-d433-4467-9888-74630f4dfebf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-28 Thread Simon Charette
Hello there,

That looks like a Django bug to me as auth.get_user_model() should only be 
performed
from within the check_password() function as it will certainly crash at the 
module level.

You should file a bug report so it gets addressed[0].

Best,
Simon

[0] https://code.djangoproject.com/newticket

Le lundi 28 janvier 2019 07:20:24 UTC-5, Binoy U a écrit :
>
> Hello,
>
> I have created a django project with only one application. I haven't made 
> any changes in the application. Only added the application to the settings 
> and updated static and media urls.
>
> Migration is done and super user was created.
>
> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according to 
> Authenticating 
> against Django’s user database from Apache 
> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/apache-auth/>
> .
>
> But getting the following error in apache error log.
>
> Traceback (most recent call last):
>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
> 13, in 
> from django.contrib.auth.handlers.modwsgi import check_password
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>  line 5, in 
> UserModel = auth.get_user_model()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>  line 165, in get_user_model
> return django_apps.get_model(settings.AUTH_USER_MODEL, 
> require_ready=False)
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 197, in get_model
> self.check_apps_ready()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 132, in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
>
> Please find files below wsgi.py
>
> import osimport mod_wsgi
>
> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
> django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> Error is triggered from from django.contrib.auth.handlers.modwsgi import 
> check_password.
>
>
> apache config file 000-defaults.conf 
> <https://github.com/binoyudayan/django_apache_issue/blob/master/000-default.conf>
>
>
> Authentication is enabled on the media url. So I hope the apache 
> configuration is working fine. I have create a github repository 
> <https://github.com/binoyudayan/django_apache_issue> if you would like to 
> check.
>
> I got this issue from a bigger project with many application and other 
> django modules. But I could still reproduce the same issue with this simple 
> project. Can you please help me to resolve this issue, thanks in advance!
>

-- 
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/522a8365-2da0-4241-84aa-a3bd29720452%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-28 Thread Binoy U
Hello,

I have created a django project with only one application. I haven't made 
any changes in the application. Only added the application to the settings 
and updated static and media urls.

Migration is done and super user was created.

I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according to 
Authenticating 
against Django’s user database from Apache 
<https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/apache-auth/>.

But getting the following error in apache error log.

Traceback (most recent call last):
  File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 13, 
in 
from django.contrib.auth.handlers.modwsgi import check_password
  File 
"/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
 line 5, in 
UserModel = auth.get_user_model()
  File 
"/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
 line 165, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
  File 
"/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
 line 197, in get_model
self.check_apps_ready()
  File 
"/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
 line 132, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")

Please find files below wsgi.py

import osimport mod_wsgi

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
django.contrib.auth.handlers.modwsgi import check_passwordfrom django.core.wsgi 
import get_wsgi_application
application = get_wsgi_application()

Error is triggered from from django.contrib.auth.handlers.modwsgi import 
check_password.


apache config file 000-defaults.conf 
<https://github.com/binoyudayan/django_apache_issue/blob/master/000-default.conf>


Authentication is enabled on the media url. So I hope the apache 
configuration is working fine. I have create a github repository 
<https://github.com/binoyudayan/django_apache_issue> if you would like to 
check.

I got this issue from a bigger project with many application and other 
django modules. But I could still reproduce the same issue with this simple 
project. Can you please help me to resolve this issue, thanks in advance!

-- 
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/add15d87-e8e1-4135-bfe4-7ba93177adfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No module named django.core.wsgi, Apache+ CentOS

2019-01-16 Thread ANi
Thank you and after facing so much mysterious(at least to me) errors,
I failed to install it through pip(I have no idea why)
so I tried to get it from compiling the source code, and it failed as well.
I started over and install python through the repository rather than source 
code,
and I compile the mod_wsgi myself using the python I've installed, get it 
done in a few minutes.lol
 
Now I am dealing with another mysterious problem. ˊ___>ˋ
seems endless...

ANi於 2019年1月16日星期三 UTC+8下午12時04分23秒寫道:
>
> Hey guys.
> I am trying to deploy my Django project on CentOS 7 with Apache.
> and I got an error of  *ImportError: No module named django.core.wsgi*
> I think it is because the Apache did not use the python version inside the 
> virtualenv
> However I dont know where the problem is.
>
> this is my httpd.conf 
> WSGIProcessGroup project
> WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
> inv/Lib/python3.7/site-packages
> WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
> packages
>
> Alias /static "/var/www/html/project/static-files"
> 
> Require all granted
> 
>
>
> 
> 
> Require all granted
> 
>
> I install wsgi_mod by *yum install mod_wsgi*
> [mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/
> 1.0.2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- 
> resuming normal operations
>
>
>
> Thank you in advance.
>
>

-- 
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/879ce142-1dc5-4d81-ad64-286684280d49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: No module named django.core.wsgi, Apache+ CentOS

2019-01-16 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Tue, Jan 15, 2019 at 08:04:23PM -0800, ANi wrote:
> Hey guys.

Maybe consider asking not just the guys next time. ;)

> I am trying to deploy my Django project on CentOS 7 with Apache.
> and I got an error of  *ImportError: No module named django.core.wsgi*
> I think it is because the Apache did not use the python version inside the 
> virtualenv
> However I dont know where the problem is.
> 
> this is my httpd.conf 
> WSGIProcessGroup project
> WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
> inv/Lib/python3.7/site-packages
> WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
> packages
> 
> Alias /static "/var/www/html/project/static-files"
> 
> Require all granted
> 
> 
> 
> 
> 
> Require all granted
> 
> 
> I install wsgi_mod by *yum install mod_wsgi*
> [mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.
> 2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- resuming 
> normal operations

As the log line above indicates, the mod_wsgi you're using is built
against Python 2.7.5, but you're configuring it to point to a Python
3.7 environment; that will not work.

A quick search of the internets indicates that CentOS 7 does not
provide a mod_wsgi package built against any other version of Python
than 2.7, which means you'll need to build it yourself.

One way would be to use pip to install mod_wsgi in your application's
virtualenv (you'll need to ensure that you have all the necessary
header files for apache and Python installed), and then execute::

mod_wsgi-express module-config

which will show you the lines you need to insert into your apache
config in order to use that build of mod_wsgi. More details are
explained at
https://pypi.org/project/mod_wsgi/#connecting-into-apache-installation.

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPv4XAAoJEHA7T/IPM/klJ9MQAMYJ60aXMk2c1ZsqIP0yuRfS
GEOKVGM53pPTKWBt74fVkMSRCg8A6pC/Vmwka9f/wBCbG6/5QeFzYu0usuiTTGM0
m3KjjddEr0f7zr4KABkzsT9Q7F1gRymRqG3tqec40dLTPfLbiyITy5MUBGi0g8VS
cqSHfXhqQLHls3EjqH5gDgQy9i7J3GvJmjO5be9HEqnukO3o2NIff6mCnTmx1+TX
irvnXJ3th29j8Z7iHHl11JzWQgNQf4xKPZkpIb8x9DcZ66Its7fnx//bAkWcngAw
BpglB3GkAuyLi8XgTDlSEkwbNqJS00bjwZ/RWzfHwnXyu684quZMqDdLk7pJdn0I
uJH0d47zb3NHlOy1ODBrkds6QJMxW84x5jMpZnmeCs0O+h4A+zm42TFvTGKf7DlG
Tu8p5ZjMLD1oB1MEypdXJuURO2fUKigHHMjstBl7oJ04zoaZ8UWgJnMAxrjRCIJH
G0u4Un/O5cMTAKEzakaHvn0FJ5okwXhF+Pdn8g5oIPedBZNhiG4jg7cu4VjOz3/s
B/FADAh/ZHPkLe9aMe/I4L+oMxr4daCDw09TiT4eMFH8qYkIv+VBqRx9Gb7d0Fu5
Gp74k7cclszfSSfXZzIM+AAsDhTg+njzOgMO6tazYW/APBABOWQygvgtEGPvgOJo
Ln0azAuyh+PShZW5JXeg
=X2I7
-END PGP SIGNATURE-

-- 
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/20190116094912.GA8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


No module named django.core.wsgi, Apache+ CentOS

2019-01-15 Thread ANi
Hey guys.
I am trying to deploy my Django project on CentOS 7 with Apache.
and I got an error of  *ImportError: No module named django.core.wsgi*
I think it is because the Apache did not use the python version inside the 
virtualenv
However I dont know where the problem is.

this is my httpd.conf 
WSGIProcessGroup project
WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
inv/Lib/python3.7/site-packages
WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
packages

Alias /static "/var/www/html/project/static-files"

Require all granted





Require all granted


I install wsgi_mod by *yum install mod_wsgi*
[mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.
2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- resuming 
normal operations



Thank you in advance.

-- 
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/bee8d91f-518c-434b-9103-ff126a13d9a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Deploy Django with Apache on Windows

2018-11-13 Thread ANi
Hi, 
I come across a problem when I want to deploy Django using Apache on 
Windows.

I separated some configurations into production.py and local.py, like 
database configurations.
And each files will read the actual setting data from a another file 
config.json.

I try to set the environment variables through the following files: 
 1. activate.bat  file of my virtual environment.
( This works only in local)

set "DJANGO_CONFIG=path\to\config.json"
set "DJANGO_SETTINGS_MODULE=myapp.settings.production"

 2. httpd.conf in Apache.
(env_module is enabled.)

LoadModule wsgi_module "path/to/mod_wsgi.cp37-win32.pyd"


WSGIScriptAlias / "path/to/wsgi.py"
WSGIPythonHome "path/to/virtualenv"
WSGIPythonPath "path/to/myproject"


SetEnv DJANGO_SETTINGS_MODULE "myapp.settings.production"
SetEnv DJANGO_CONFIG "path/to/config.json"


Alias /static "path/to/static-files"

 Require all granted





 Require all granted




The only way is to set the variables in wsgi.py, but this is not what I 
want.

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings.production')
os.environ.setdefault('DJANGO_CONFIG', 'path\to\config.json')

Please tell me if you need more information and thank you for helping.



-- 
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/ea0d1d61-f6b8-40f0-affe-61e78ddd41ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue after WAR deployment in Apache Tomcat server

2018-09-06 Thread hari . krishnan


I am using Django 1.8 on Jython in Windows 10. Have created a simple Django 
project following the tutorial 
https://docs.djangoproject.com/en/1.8/intro/tutorial01. After packaging 
using buildwar(including jars), when I deploy the mysite.war archive in 
tomcat, I get an error.
My project name is *mysite*, I have referenced the Jython path in web.xml. 
My project structure is

-mysite
 -WEB-INF
  -lib
   -jruby-extras-fileservlet.jar
   -jython.jar
  -lib-python
   -django
   -doj
   -polls
   -application_settingspy.class
   -application_settings.py
   -eggs.pth
  -web.xml
 -wsgi

Error is

Traceback (most recent call last):
  File "D:\jython27\Lib\modjy\modjy.py", line 80, in service
self.exc_handler.handle(req, resp, wsgi_environ, mx, (typ, value, tb) )
  File "D:\jython27\Lib\modjy\modjy.py", line 76, in service
self.dispatch_to_application(req, resp, wsgi_environ)
  File "D:\jython27\Lib\modjy\modjy.py", line 92, in dispatch_to_application
app_callable = self.get_app_object(req, environ)
  File "D:\jython27\Lib\modjy\modjy_publish.py", line 68, in get_app_object
return self.get_app_object_old_style(req, environ)
  File "D:\jython27\Lib\modjy\modjy_publish.py", line 120, in
get_app_object_old_style
return self.load_object(source_filename, callable_name)
  File "D:\jython27\Lib\modjy\modjy_publish.py", line 142, in load_object
self.raise_exc(NoCallable, "Error loading jython callable '%s': %s" %  
(callable_name, str(x)) )
  File "D:\jython27\Lib\modjy\modjy.py", line 121, in raise_exc
raise exc_class(message)
modjy.modjy_exceptions.NoCallable: Error loading jython callable 'application': 
No module named mysite

The application_settings file shows:

from mysite.settings import *
CONTEXT_ROOT = "mysite"


How to solve this issue? 

-- 



**DISCLAIMER**




 



This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION

intended Solely for the use of the addressee(s).If you are not the intended

Recipient, Please notify the sender by e-mail and delete the original 
message.
Further , you are not to copy, disclose, or distribute this e-mail 
or its
contents to any other person and any such actions are unlawful. This 
e-mail may
contain Viruses. Tekplay Systems Limited has taken every 
reasonable precaution
to minimize the risk, but is not liable for any 
damage you may sustain as a
result of any virus in this e-mail. You should 
carry out your own virus checks
before opening the e-mail or attachment. 




 



Tekplay systems Limited reserves the right to monitor and
review the 
content of all messages sent to or from this e-mail address.
Messages sent 
to or from this e-mail address may be stored on the Tekplay
systems Limited 
e-mail system. 



 




*End
of 
Disclaimer

-- 
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/37fd04b7-4794-4dea-8413-f695a327b4bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot find static files when using mod_wsgi and apache

2018-09-01 Thread Jason
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/#serving-files

Note the  bit

>
>

-- 
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/448a33e4-5e09-427f-92ed-156781dddcc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Cannot find static files when using mod_wsgi and apache

2018-08-31 Thread Joel Mathew
I'm having trouble getting serving static files.

My project is at /home/joel/myappointments
The app is at /home/joel/myappointments/appointments

An example template contains:


myappointments/myappointments/settings.py contains:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static/")

]
STATIC_URL = '/static/'
STATIC_ROOT = '/home/joel/myappointments/static/'
#'/home/joel/myappointments/appointments/static/'

I've tried different options. The present option is after creating
/home/joel/myappointments/static/ and running
python3 manage.py collectstatic

While running the application with:
(venv) root@localhost:/home/joel/myappointments# mod_wsgi-express
start-server wsgi.py --host myopip.com --user www-data --group
www-data --port 80

I get links like:
http://mysite.com/static/appointments/propellor/typography.css
which are broken.
If I use the development server, it all works.

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


Apache runs wsgi module twice in case of public router ip and internal server ip ?

2018-08-17 Thread HEMENDRA SINGH HADA
We've below netwrok setup
Internal server ip : 192.168.153.20:443
Public router ip : 111.93.87.11:26060 

We've port forwarding in router : 111.93.87.11:26060 to 192.168.153.20:443

So when we first access 192.168.153.20:443(Internal server ip) it 
runs/execute django application ( First time )
Now when we access 111.93.87.11:26060 (Public router ip) - due to port 
forwarding it comes to internal server ip but as apache receives 
host:111.93.87.11:26060,apache execute/run whole django application second 
time.

So ulimately our application is being run two times for ip i.e internal ip 
and public router ip.
This is creating very critical issue.
*We need to run single instance for both internal and external IP. But it 
seems Apache parsing host name and running different instance for new 
external IP*

Apache configuration 
Listen 192.168.153.120:80
Listen localhost:80
Listen 192.168.153.120:443 ( Configuration in SSL file)


ServerName 192.168.153.120:443

WSGIDaemonProcess abcadmin 
python-path=/usr/local/abc/webservice/abcadmin/abcadmin:/usr/local/lib/python3.4/site-package
 
user=abc group=abc processes=1 threads=20 display-name=%{GROUP}
WSGIProcessGroup abcadmin
WSGIScriptAlias / /usr/local/abc/webservice/abcadmin/abcadmin/wsgi.py

Redirect / http://192.168.153.120:443


-- 
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/bdbb7bf9-7bad-4202-8db9-2df68fd384f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Server complete html Static App without apache server and without modifying html code

2018-07-24 Thread Kasper Laudrup

Hi Archit,

On 2018-07-23 20:09, archit mehta wrote:


I have oraclejet frontend application and want to server that using 
django, I did it with flask but don't know how to do with django.


Here is complete description of my problem Please go through it and 
suggest some solution.


https://stackoverflow.com/questions/51484839/how-to-serve-complete-htmlapp-with-django-server-using-views-py



You could most likely achieve that by using the "staticfiles" app and 
make that serve the files from the URL root in your urls.py file.


As others have pointed out though, the big question is, why on earth 
would you want to do that?


Djangos builtin web server is not meant to be used for production as is 
stated clearly in the documentation, so it should only be used for 
development purposes and then I cannot see any reasons at all why you 
want to make things more complicated by using Django if you're not gonna 
use any of the features Django provides.


If you don't want to set up a web server, you can use the web server 
from Pythons standard library:


https://docs.python.org/3/library/http.server.html

I have used that myself when I just needed to test out some basic 
HTML/CSS/Javascript stuff and it worked just fine for that purpose.


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/361b9104-c93e-ec90-0b82-3efdd7622ee6%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Server complete html Static App without apache server and without modifying html code

2018-07-23 Thread mottaz hejaze
i dont understand .. why you need backend anyway ?

On Mon, 23 Jul 2018, 23:21 archit mehta,  wrote:

>
> Hi,
>
> I have oraclejet frontend application and want to server that using
> django, I did it with flask but don't know how to do with django.
>
> Here is complete description of my problem Please go through it and
> suggest some solution.
>
>
> https://stackoverflow.com/questions/51484839/how-to-serve-complete-htmlapp-with-django-server-using-views-py
>
>
>
>
> Regards,
> Archit
>
> --
> 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/231f5a83-c3cf-4a3e-87c2-ecc378b08b97%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/CAHV4E-fRtdo9Ae_%2BFFZeAS4B7PDDuznz4LjHjeT0pn2sQ%2BKwEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Server complete html Static App without apache server and without modifying html code

2018-07-23 Thread archit mehta

Hi,

I have oraclejet frontend application and want to server that using django, 
I did it with flask but don't know how to do with django.

Here is complete description of my problem Please go through it and suggest 
some solution.

https://stackoverflow.com/questions/51484839/how-to-serve-complete-htmlapp-with-django-server-using-views-py




Regards,
Archit

-- 
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/231f5a83-c3cf-4a3e-87c2-ecc378b08b97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fresh Django with mod_wsgi and apache goes Time Out on 18.04

2018-07-07 Thread Kasper Laudrup

Hi Mohammad,

On 2018-07-07 16:26, Mohammad Etemaddar wrote:
I have installed Ubuntu server 18.04 and *VirtualMin* on it. installed 
python3-pip and then virtualenv.

Also installed *libapache2-mod-wsgi-py3*
Created new virtual server and configured the modwsgi for it.
Also created fresh django website for it.
But I get Timeout error!


Which kind of timeout do you get?

If you get a timeout when trying to access your site with eg. a browser, 
I would try to ssh to the host and try to connect to the site locally, 
eg. "telnet localhost 80". If that connects, then I would look into 
whether port 80 is open in a firewall or similar.


If you get a "504 Gateway Timeout", then there's an issue with the 
connection between Apache and the WSGI application. Possibly the Django 
app is not running?


I cannot really come with a solution, but I hope that can help you in 
troubleshooting.


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/8168bb9f-fb80-715e-caf5-8dd595c48d3c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Fresh Django with mod_wsgi and apache goes Time Out on 18.04

2018-07-07 Thread Mohammad Etemaddar
I have installed Ubuntu server 18.04 and *VirtualMin* on it. installed 
python3-pip and then virtualenv.
Also installed *libapache2-mod-wsgi-py3*
Created new virtual server and configured the modwsgi for it.
Also created fresh django website for it.
But I get Timeout error!
Here is my apache configuration for mod_wsgi:

Code:

WSGIDaemonProcess username.ir python-home=/home/username/venv 
python-path=/home/username/website
WSGIProcessGroup username.ir


Alias /media/ /home/username/website/media/
Alias /static/ /home/username/website/static/


Require all granted



Require all granted


WSGIScriptAlias / /home/username/website/website/wsgi.py



Require all granted



Django version: 1.11.14
I have configured website like this on a Debian 9 server and worked great.
How can I solve it?

-- 
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/95b2df4a-bba5-4cd6-9e28-f069fb092126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-07-03 Thread Bob Bobsled
Hi,
I think I see the problem now.

WAMP is a special case for aliases, and it's root directory default setup
in c:wamp\www for ex..  I need to do some more work on, say for ex. using
Django Tut 01, setting up mysite as an alias in wamp, and then putting the
polls app in it.  I believe apache might start to work then with django if
the wamp alias is setup correctly.

I also found this vid tut:  really good, but for XAMPP, not WAMP...but it
shows how to get the mod_wsgi.so from a renamed and extracted .whl file.
And using the mod_wsgi.so with apache simplifies things a bit, so this is
good too.

XAMPP
This shows how to create a mod_wsgi.so from the .pyd extracted from the
.whl file
https://www.youtube.com/watch?v=VnR5O4IjmOs

Regards


On Sat, Jun 30, 2018 at 10:08 AM, Jason  wrote:

> I meant the tutorial at https://docs.djangoproject.
> com/en/2.0/intro/tutorial01/
>
> That said, there's a few different ways you can actually deploy, but
> digitalocean has some good resources for starting out.
>
> https://www.digitalocean.com/community/tutorials/how-to-
> serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
>
> This one shows how to use apache on ubuntu, and you should be able to
> extrapolate to use wamp.
>
> what I would do is just set up a simple view to return a http response
> saying "working", and map that to the root.  Something like
>
> app/views
>
> def index(request):
> return HttpResponse("Working!")
>
> app/urls
>
> from app.views import index
> urlpatterns = [
> path('', index),
> ]
>
> and hit localhost.  That'll be all you need.
>
> Hi,
>> Thanks.
>> Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
>> the point where I realized I needed to do more with the last mile, so to
>> speak working on setup of the production server part on Windows and wamp.
>> Seems most tuts end at manage.py runserver, or start into deployment from
>> dev to production.  I can't seem to locate a good uptodate tut for wamp
>> that shows how to test everything is working properly in a simple manner
>> for the wsgi part.
>>
>> I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py)
>> is working with apache, before spending too much more time building a site.
>>
>>
>> On Sat, Jun 30, 2018 at 2:54 AM, Jason  wrote:
>>
>>> appreciate the detailed report :-)
>>>
>>> so, have you set up the django tutorial project?  that application
>>> method in wsgi doesn't make any sense.  you should have urls and views set
>>> up in your project
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/django-users/-eJaLuJ85KE/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/-eJaLuJ85KE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6f5e5996-a85e-4eb6-b5e4-804f7379a2b4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6f5e5996-a85e-4eb6-b5e4-804f7379a2b4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CALWZDaNY4miqCqxy%3DLvH4417%3DP4XGOuHAOepCBT2tPpg0wqkrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-07-02 Thread Bob Bobsled
Hi,
I'm still stuck on getting Apache to verify as working with wsgi.
Wondering what I might be doing incorrectly.
I'm reading lots of tuts, but it's a jungle out there.

I changed the folder hierarchy for the project and app so
venv, django_project, and  django_app are all on the same level as manage.py
thus:
c:/wamp/www-src/django_project
c:/wamp/www-src/django_app
c:/wamp/www-src/venev
c:/wamp/www-src/manage.py

In wamp create folder named www-src alongside the www folder.
cd into www-src.

created a virtual environment:
Inside www-src run > virtualenv venv

ACTIVATE and DEACTIVATE:

then activate by
> venv\Scripts\activate

if that works see (venv) as a prefix to the command line.  To deactivate
type:
>venv\Scripts\deactivate.bat.
...or can also just use
(venv) c:\wamp\www-src >deactivate
-

DJANGO PROJECT, APP, and VENV:
Then with the virtual environment active, install Django with the local
instance of pip by typing: >pip install django

then created a new django project >python django-admin.py startproject
django_project

and on the same level as manage.py type
>django-admin.py startapp django_app

Should have django_app folder, django_project folder, venv folder, and
manage.py all on the same level.

SETUP SQLITE DATABASE:

in the top level folder (the one with manage.py in it), type this in:
> python manage.py migrate


START RUNSERVER:
> python manage.py runserver

see success...so far.
-
Trying to get Apache production server working...

SETUP STATIC files location:

in settings.py

SETTINGS.PY:

in settings.py change STATIC_URL to:

STATIC_URL = os.path.join(BASE_DIR, "static/")

...also set
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

then run
>(venv) c:\wamp\www-src>manage.py collectstatic

(should see new static dir under www-src)
---

MIGRATIONS:

then from c:\wamp\www-src run
(venv) c:\wamp\www-src >manage.py makemigrations
then
(venv) c:\wamp\www-src >manage.py migrate

SETTINGS.PY

in settings.py change STATIC_URL to:

STATIC_URL = os.path.join(BASE_DIR, "static/")

...also set
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

then run
>(venv) c:\wamp\www-src>manage.py collectstatic

(should see new static dir under www-src)
--
...per Jason's suggestion for simple view and url...

in DJANGO_APP/VIEWS.PY

def index(request):
return HttpResponse("Working!")

--
in DJANGO_APP/URLS.PY

from django_app.views import index
urlpatterns = [
path('', index),
]

-
APACHE HTTPD.CONF

#---mod_wgi-express config for location in python ---
LoadFile
"c:/users/administrator/appdata/local/programs/python/python36-32/python36.dll"
LoadModule wsgi_module
"c:/users/administrator/appdata/local/programs/python/python36-32/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win32.pyd"

WSGIPythonHome
"c:/users/administrator/appdata/local/programs/python/python36-32"
WSGIScriptAlias /django-project "C:/wamp/www-src/django_project/wsgi.py"
#WSGIPythonPath
"C:/wamp/www-src/django_project/:C:/wamp/www-src/venv/Lib/site-packages"
WSGIPythonPath "C:/wamp/www-src:C:/wamp/www-src/venv/Lib/site-packages"



Order deny,allow
Require all granted




APACHE HTTPD-VHOSTS.CONF


ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www

Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted




Alias /static c:/wamp/www-src/static

Require all granted



---

restart APACHE

...but what is the correct URL to test here?

tried localhost:8000 all pointing to various folders but nothing connects
so far.



On Sat, Jun 30, 2018 at 10:08 AM, Jason  wrote:

> I meant the tutorial at https://docs.djangoproject.
> com/en/2.0/intro/tutorial01/
>
> That said, there's a few different ways you can actually deploy, but
> digitalocean has some good resources for starting out.
>
> https://www.digitalocean.com/community/tutorials/how-to-
> serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
>
> This one shows how to use apache on ubuntu, and you should be able to
> extrapolate to use wamp.
>
> what I would do is just set up a simple view to return a http response
> saying "working", and map that to the root.  Something like
>
> app/views
>
> def index(request):
> return HttpResponse("Working!")
>
> app/urls
>
> from app.views import index
> urlpatterns = [
> path('', index),
> ]
>
> and hit localhost.  That'll be all you need.
>
> Hi,
>> Thanks.
>> Yes, I went thru the Mozilla library tuto

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-02 Thread Vinicius Assef
Maybe this other article helps you understand the essence of a
virtualenv: 
http://blog.aprendapython.com.br/articles/entendendo-virtualenv-1fr69/

Again, Google Translator is your friend.



On 2 July 2018 at 09:28, Vinicius Assef  wrote:
> I second Melvyn.
>
> On top of what he wrote, Bruce, I work in an environment with exactly
> this limitation: a shared hosting running Apache where I don't have
> access
>  to ssh.
>
> I build my environment (install libs, for that matter) locally and
> transfer all my pack through ftp in one shot.
>
> As Melvyn told us, "activate" a virtualenv means "put the path to your
> libs first, in the PATH variable". But it can also be done inside a
> Python program, too, manipulating `sys.path`.
>
> You can see an example here:
> http://blog.aprendapython.com.br/articles/setup-de-python-django-pyramid-dreamhost-1fr70/
>
> In spite the blog post is in Brazilian Portuguese, Google Translator
> is your friend and examples are in Python, afterall. ;-)
>
> Cheers.
>
>
>
> On 1 July 2018 at 09:38, Melvyn Sopacua  wrote:
>> On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote:
>>
>>> In all cases, a virtualenv is recommended for any Python
>>> deployment.  In both cases, I have Apache as the web server with mod_wsgi.
>>> Obviously, I need the server, Apache, to activate the
>>> Django environment.  I can ssh to my VPS but what good is that.  I don't
>>> need my username to be activating the Python isolated environment.  As soon
>>> as I close the ssh session the activated environment
>>> is no longer activated.  My best guess is that the Apache user must
>>> activate the virtual environment and keep it activated as an isolated
>>> virtual environment.
>>
>> Virtualenv "activation" is not magic. It simply adjusts PATH so that the
>> virtualenv's bin directory is first. This means that whenever "python" or 
>> "pip"
>> is typed into the shell it will not execute `/usr/bin/python` but
>> `your-virtualenv/bin/python`. Handing apache a sanitized PATH with the
>> virtualenv bin dir as first directory, will effectively do the same as
>> "activation".
>>
>> (To be complete: activate also alters your shell prompt, this has no effect 
>> in
>> one-off application launches).
>>
>> --
>> 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/2410185.edddNGrWiM%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/CAFmXjSApkLBW4Mb090Mq-40N7R00YeDmeOd34439UDptaV9pYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-02 Thread Vinicius Assef
I second Melvyn.

On top of what he wrote, Bruce, I work in an environment with exactly
this limitation: a shared hosting running Apache where I don't have
access
 to ssh.

I build my environment (install libs, for that matter) locally and
transfer all my pack through ftp in one shot.

As Melvyn told us, "activate" a virtualenv means "put the path to your
libs first, in the PATH variable". But it can also be done inside a
Python program, too, manipulating `sys.path`.

You can see an example here:
http://blog.aprendapython.com.br/articles/setup-de-python-django-pyramid-dreamhost-1fr70/

In spite the blog post is in Brazilian Portuguese, Google Translator
is your friend and examples are in Python, afterall. ;-)

Cheers.



On 1 July 2018 at 09:38, Melvyn Sopacua  wrote:
> On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote:
>
>> In all cases, a virtualenv is recommended for any Python
>> deployment.  In both cases, I have Apache as the web server with mod_wsgi.
>> Obviously, I need the server, Apache, to activate the
>> Django environment.  I can ssh to my VPS but what good is that.  I don't
>> need my username to be activating the Python isolated environment.  As soon
>> as I close the ssh session the activated environment
>> is no longer activated.  My best guess is that the Apache user must
>> activate the virtual environment and keep it activated as an isolated
>> virtual environment.
>
> Virtualenv "activation" is not magic. It simply adjusts PATH so that the
> virtualenv's bin directory is first. This means that whenever "python" or 
> "pip"
> is typed into the shell it will not execute `/usr/bin/python` but
> `your-virtualenv/bin/python`. Handing apache a sanitized PATH with the
> virtualenv bin dir as first directory, will effectively do the same as
> "activation".
>
> (To be complete: activate also alters your shell prompt, this has no effect in
> one-off application launches).
>
> --
> 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/2410185.edddNGrWiM%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/CAFmXjSAFWT2g8zmh2moxbnDog%2BjYf2gzsCXBd%3D7MCGbZ1S7JJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-07-01 Thread Melvyn Sopacua
On donderdag 28 juni 2018 17:46:42 CEST Bruce Whealton wrote:

> In all cases, a virtualenv is recommended for any Python
> deployment.  In both cases, I have Apache as the web server with mod_wsgi.
> Obviously, I need the server, Apache, to activate the
> Django environment.  I can ssh to my VPS but what good is that.  I don't
> need my username to be activating the Python isolated environment.  As soon
> as I close the ssh session the activated environment
> is no longer activated.  My best guess is that the Apache user must
> activate the virtual environment and keep it activated as an isolated
> virtual environment.

Virtualenv "activation" is not magic. It simply adjusts PATH so that the 
virtualenv's bin directory is first. This means that whenever "python" or "pip" 
is typed into the shell it will not execute `/usr/bin/python` but
`your-virtualenv/bin/python`. Handing apache a sanitized PATH with the 
virtualenv bin dir as first directory, will effectively do the same as 
"activation".

(To be complete: activate also alters your shell prompt, this has no effect in 
one-off application launches).

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


Re: django windows apache tell if apache is working

2018-06-30 Thread Jason
I meant the tutorial at 
https://docs.djangoproject.com/en/2.0/intro/tutorial01/

That said, there's a few different ways you can actually deploy, but 
digitalocean has some good resources for starting out.

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04

This one shows how to use apache on ubuntu, and you should be able to 
extrapolate to use wamp.

what I would do is just set up a simple view to return a http response 
saying "working", and map that to the root.  Something like 

app/views

def index(request):
return HttpResponse("Working!")

app/urls

from app.views import index
urlpatterns = [
path('', index), 
]

and hit localhost.  That'll be all you need.

Hi,
> Thanks.
> Yes, I went thru the Mozilla library tutorial on a fedora dev machine to 
> the point where I realized I needed to do more with the last mile, so to 
> speak working on setup of the production server part on Windows and wamp.
> Seems most tuts end at manage.py runserver, or start into deployment from 
> dev to production.  I can't seem to locate a good uptodate tut for wamp 
> that shows how to test everything is working properly in a simple manner 
> for the wsgi part.
>
> I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py) 
> is working with apache, before spending too much more time building a site. 
>  
>
> On Sat, Jun 30, 2018 at 2:54 AM, Jason > 
> wrote:
>
>> appreciate the detailed report :-)
>>
>> so, have you set up the django tutorial project?  that application method 
>> in wsgi doesn't make any sense.  you should have urls and views set up in 
>> your project
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/-eJaLuJ85KE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> 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/6f5e5996-a85e-4eb6-b5e4-804f7379a2b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-06-30 Thread Bob Bobsled
Hi,
Thanks.
Yes, I went thru the Mozilla library tutorial on a fedora dev machine to
the point where I realized I needed to do more with the last mile, so to
speak working on setup of the production server part on Windows and wamp.
Seems most tuts end at manage.py runserver, or start into deployment from
dev to production.  I can't seem to locate a good uptodate tut for wamp
that shows how to test everything is working properly in a simple manner
for the wsgi part.

I'm just trying to verify the plumbing (httpd.conf, settings.py wsgi.py) is
working with apache, before spending too much more time building a site.

On Sat, Jun 30, 2018 at 2:54 AM, Jason  wrote:

> appreciate the detailed report :-)
>
> so, have you set up the django tutorial project?  that application method
> in wsgi doesn't make any sense.  you should have urls and views set up in
> your project
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/-eJaLuJ85KE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CALWZDaPoCygU8hSSYcsEpQnHGE%2B52EUxAyOko3kPRhR12t6HCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django windows apache tell if apache is working

2018-06-30 Thread Jason
appreciate the detailed report :-)

so, have you set up the django tutorial project?  that application method 
in wsgi doesn't make any sense.  you should have urls and views set up in 
your project

-- 
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/6d241c04-55be-4524-959e-09630a7bc21f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django windows apache tell if apache is working

2018-06-29 Thread thebobbobsled

Hi,

I'm new to this group, and also new to Python, and Django.  Seems like lots 
of good info for django on this group.

Sorry for long, detailed descriptions, below, but I am stuck trying to 
verify wamp, apache and django are working as a production server on a 
Windows 7, 32-bit machine.

I am hung on last mile part (way below), or how to see something in the 
browser using apache, not the dev runserver.  The dev server seems to work 
fine at this point showing default django startup page.

I'm not sure how to proceed with verifying apache is working as a 
production server.  If all is working, should apache show the same Python 
default start page as the dev server?  Or what simple web pages should I 
implement to verify the apache connection is actually working on the server?

Wamp is also working fine with it's own www directory and local webpages 
etc. using apache.


Wampserver 3.0.6 32bit, with apache2.4.23
---
PYTHON AND APACHE:

Python 3.6.5 32bit, with Django 2.0.6

Tried following Eastwood description for Django setup for Wamp
https://ericeastwood.com/blog/3/django-setup-for-wamp
---
MOD_WSGI:

Could not pip install mod_wsgi, and needed to download VisualStudio build 
tools and upgrade framework to 4.7.1.

Downloaded mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win32.whl
https://www.lfd.uci.edu/~gohlke/pythonlibs/
to work with apache 2.4.23, VC++14, and python3.6

then did >> pip install 
C:\Users\Administrator\Downloads\mod_wsgi-4.5.24+ap24vc14-cp36-cp36m-win32.whl. 
 
Did not get mod_wsgi.so in apache modules folder, but did get a .pyd in: 
c:/users/administrator/appdata/local/programs/python/python36-32/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win32.pyd

Could then run mod_wsgi-express.

>From cmd prompt in apache bin dir used >httpd -t -D DUMP_MODULES to show 
wsgi_module (shared) is present.
---
VIRTUALENV:

Per Eastwood description (above), inside c:/wamp created a new directory 
www-src next to www which is where our other wamp sites are located. Inside 
c:\wamp\www-src ran >virtualenv django_project, then 
django_project\Scripts\activate.  See (django_project) as prefix to cmd 
prompt. With virtual environment active did >pip install django.  Then 
(django_project_ c:\wamp\www-src > django-admin.py startproject 
django_project .  to setup up project in current or www-src directory.

c:\wamp\www-src\django_project
c:\wamp\www-src\static
c:\wamp\www-src\db.sqlite3
c:\wamp\www-src\manage.py

and in c:\wamp\www-src\django_project have settings.py, urls.py, and 
wsgi.py, etc.
---
SETTINGS.PY

in settings.py change STATIC_URL to:

STATIC_ROOT = 'C:/wamp/www-src/static'
STATIC_URL = 'http://XXXmyipXXX/static/'


also added localhost, and my local IP to ALLOWED_HOSTS in settings.py
---
MIGRATIONS:

then from c:\wamp\www-src run
(django_project) c:\wamp\www-src >manage.py makemigrations
then
(django_project) c:\wamp\www-src >manage.py migrate

also ran >(django_project) c:\wamp\www-src >manage.py collectstatic
although static dir is empty at this point.
---
DEVELOPMENT SERVER:

(django_project) c:\wamp\www-src >manage.py runserver 0.0.0.0:8000

>From the browser > http://localhost:8000 this initially caused windows 
firewall error to appear but an exception was added to allow it to continue.

Can see python default page, and also localhost:8000\admin too on Dev 
server.  Dev server can be seen by other machines on the network too.

CONFIGURE APACHE:
for production server using wamp instead of dev server.

using mod_wsgi-express settings in httpd.conf.
Apache httpd.conf is in:
C:\wamp\bin\apache\apache2.4.23\conf\httpd.conf

Apache httpd-vhosts.conf is in:
C:\wamp\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf

added to httpd.conf:
LoadFile 
"c:/users/administrator/appdata/local/programs/python/python36-32/python36.dll"
LoadModule wsgi_module 
"c:/users/administrator/appdata/local/programs/python/python36-32/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win32.pyd"

WSGIPythonHome 
"c:/users/administrator/appdata/local/programs/python/python36-32"
WSGIScriptAlias /django-project 
"C:/wamp/www-src/django_project/wsgi.py:C:/wamp/www-src/django_project/wsgi_app.py"
WSGIPythonPath 
"C:/wamp/www-src/django_project/:C:/wamp/www-src/django_project/Lib/site-packages"



Order deny,allow
Require all granted


Order deny,allow
Require all granted
    



added to httpd-vhosts.conf:

Alias /static c:/wamp/www-src/static

Require all granted



...restarted apache


CONFUSED FROM HERE...or last mile to verify production server can run 
django from virtual environment.

If try localhost:8000 in browser see ERR_CONNECTION_REFUSED.
If try localhost/wsgi and have wsgi_app.py in django_project, see request

Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-29 Thread Kunal Grover
You can specify your VirtualEnv using WSGIDaemonProcess:
http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIPythonPath.html

Alternatively, you can use gunicorn to run your server behind Apache:
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/gunicorn/

My recommendation is to not go with Apache since you are just starting, and
pick Nginx, It works much better on smaller servers with lower memory.
There are a host of options when using Nginx for serving Django including
Gunicorn, uWSGI.

On Thu, Jun 28, 2018 at 9:35 PM Gerardo Palazuelos Guerrero <
gerardo.palazue...@gmail.com> wrote:

> hi Bruce,
> I found this link as part of a django training I did in a udemy course (
> https://www.udemy.com/the-ultimate-beginners-guide-to-django-python-web-dev-website
> ).
> Link is:
>
> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>
> I hopes that helps you.
> Gerardo.
>
> --
> Gerardo Palazuelos Guerrero
>
>
> On Thu, Jun 28, 2018 at 9:46 AM, Bruce Whealton <
> futurewavewebdevelopm...@gmail.com> wrote:
>
>> Hello all,
>>For a  long time, this has perplexed me and I cannot find the
>> answer.  It is a crucial recommendation for deploying Django (or any Python
>> app for that matter) into production.
>> Here is the issue.  I have two web hosting accounts, one is VPS with ssh
>> root access.  The other is shared hosting that specifically targets users
>> of Python-based applications such as Django.
>> It appears that the shared Python environment does not allow ssh access.
>> In all cases, a virtualenv is recommended for any Python
>> deployment.  In both cases, I have Apache as the web server with mod_wsgi.
>> Obviously, I need the server, Apache, to activate the
>> Django environment.  I can ssh to my VPS but what good is that.  I don't
>> need my username to be activating the Python isolated environment.  As soon
>> as I close the ssh session the activated environment
>> is no longer activated.  My best guess is that the Apache user must
>> activate the virtual environment and keep it activated as an isolated
>> virtual environment.
>> I have googled and googled for an answer to something so
>> basic to deploying into production an isolated Python environment for
>> Django (or any Python application) for that matter.  So, here is my best
>> effort
>> to ask the question clearly.  How do I deploy into production a Django
>> application following the best practice of using an isolated virtual
>> environment that is activated even after I close my ssh session?
>>
>>Regarding the shared Python hosting, if I don't have ssh
>> access I cannot even issue Pypi commands to install modules that I
>> might need for my Django app.
>> Thanks,
>> Bruce
>>
>> --
>> 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/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAJ8iCyMjjWFMRPdzYc3uWDkTo_AD8oa_nTFVSntt1VbZNaXHSw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJ8iCyMjjWFMRPdzYc3uWDkTo_AD8oa_nTFVSntt1VbZNaXHSw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAF39Kz_AUDVpL9E9wkPhqxb5_mJnc%3D3SWQYw9nSaBJmm3815gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-28 Thread Gerardo Palazuelos Guerrero
hi Bruce,
I found this link as part of a django training I did in a udemy course (
https://www.udemy.com/the-ultimate-beginners-guide-to-django-python-web-dev-website
).
Link is:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

I hopes that helps you.
Gerardo.

--
Gerardo Palazuelos Guerrero


On Thu, Jun 28, 2018 at 9:46 AM, Bruce Whealton <
futurewavewebdevelopm...@gmail.com> wrote:

> Hello all,
>For a  long time, this has perplexed me and I cannot find the
> answer.  It is a crucial recommendation for deploying Django (or any Python
> app for that matter) into production.
> Here is the issue.  I have two web hosting accounts, one is VPS with ssh
> root access.  The other is shared hosting that specifically targets users
> of Python-based applications such as Django.
> It appears that the shared Python environment does not allow ssh access.
> In all cases, a virtualenv is recommended for any Python
> deployment.  In both cases, I have Apache as the web server with mod_wsgi.
> Obviously, I need the server, Apache, to activate the
> Django environment.  I can ssh to my VPS but what good is that.  I don't
> need my username to be activating the Python isolated environment.  As soon
> as I close the ssh session the activated environment
> is no longer activated.  My best guess is that the Apache user must
> activate the virtual environment and keep it activated as an isolated
> virtual environment.
> I have googled and googled for an answer to something so basic
> to deploying into production an isolated Python environment for Django (or
> any Python application) for that matter.  So, here is my best effort
> to ask the question clearly.  How do I deploy into production a Django
> application following the best practice of using an isolated virtual
> environment that is activated even after I close my ssh session?
>
>Regarding the shared Python hosting, if I don't have ssh access
> I cannot even issue Pypi commands to install modules that I might need for
> my Django app.
> Thanks,
> Bruce
>
> --
> 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/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAJ8iCyMjjWFMRPdzYc3uWDkTo_AD8oa_nTFVSntt1VbZNaXHSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Isolated virtualenv and mod_wsgi - how do I do this on Apache

2018-06-28 Thread Bruce Whealton
Hello all,
   For a  long time, this has perplexed me and I cannot find the 
answer.  It is a crucial recommendation for deploying Django (or any Python 
app for that matter) into production.
Here is the issue.  I have two web hosting accounts, one is VPS with ssh 
root access.  The other is shared hosting that specifically targets users 
of Python-based applications such as Django.  
It appears that the shared Python environment does not allow ssh access.  
In all cases, a virtualenv is recommended for any Python 
deployment.  In both cases, I have Apache as the web server with mod_wsgi.  
Obviously, I need the server, Apache, to activate the 
Django environment.  I can ssh to my VPS but what good is that.  I don't 
need my username to be activating the Python isolated environment.  As soon 
as I close the ssh session the activated environment
is no longer activated.  My best guess is that the Apache user must 
activate the virtual environment and keep it activated as an isolated 
virtual environment.  
I have googled and googled for an answer to something so basic 
to deploying into production an isolated Python environment for Django (or 
any Python application) for that matter.  So, here is my best effort
to ask the question clearly.  How do I deploy into production a Django 
application following the best practice of using an isolated virtual 
environment that is activated even after I close my ssh session?

   Regarding the shared Python hosting, if I don't have ssh access 
I cannot even issue Pypi commands to install modules that I might need for 
my Django app.
Thanks,
Bruce

-- 
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/78f2b728-ae20-4daf-9d38-221f7487af05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: serving admin files in Apache

2018-05-03 Thread sum abiut
Thanks,
i've try that but still doesn't solve the problem

On Fri, May 4, 2018 at 11:51 AM, James Farris 
wrote:

> Did you run
> $ python manage.py collectstatic in your project folder on the server that
> is running Apache?
>
> This add all css, js, and images to the static root folder you specified
> in settings.py
>
> On Thu, May 3, 2018 at 4:40 PM sum abiut  wrote:
>
>> Hi,
>> I have recently setup my django app with Apache. The app files are serve
>> alright but, however when i access the admin page it looks all over the
>> place. Please advise how to i serve the admin files in Apache.
>>
>> Cheers,
>>
>> --
>> 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/CAPCf-y5%2BVkkGo%2BDGHfX2o6Q54Gdfoo_
>> AxNvTcuZEkOziAH2V1A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPCf-y5%2BVkkGo%2BDGHfX2o6Q54Gdfoo_AxNvTcuZEkOziAH2V1A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAE-E-_1AaYs5HYKxddZ1bf0YQ%3DbE4gvex2-ePSNB43SjNZtfmg%
> 40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAE-E-_1AaYs5HYKxddZ1bf0YQ%3DbE4gvex2-ePSNB43SjNZtfmg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAPCf-y7gHpwnu246na8NWQF_8ZQ3T4yEKuMsbWs7XCiCMtigdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: serving admin files in Apache

2018-05-03 Thread James Farris
Did you run
$ python manage.py collectstatic in your project folder on the server that
is running Apache?

This add all css, js, and images to the static root folder you specified in
settings.py

On Thu, May 3, 2018 at 4:40 PM sum abiut  wrote:

> Hi,
> I have recently setup my django app with Apache. The app files are serve
> alright but, however when i access the admin page it looks all over the
> place. Please advise how to i serve the admin files in Apache.
>
> Cheers,
>
> --
> 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/CAPCf-y5%2BVkkGo%2BDGHfX2o6Q54Gdfoo_AxNvTcuZEkOziAH2V1A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPCf-y5%2BVkkGo%2BDGHfX2o6Q54Gdfoo_AxNvTcuZEkOziAH2V1A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAE-E-_1AaYs5HYKxddZ1bf0YQ%3DbE4gvex2-ePSNB43SjNZtfmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


serving admin files in Apache

2018-05-03 Thread sum abiut
Hi,
I have recently setup my django app with Apache. The app files are serve
alright but, however when i access the admin page it looks all over the
place. Please advise how to i serve the admin files in Apache.

Cheers,

-- 
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/CAPCf-y5%2BVkkGo%2BDGHfX2o6Q54Gdfoo_AxNvTcuZEkOziAH2V1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-27 Thread Antonis Christofides
>
> But the following is still saying, “Forbidden”:
>
>
> https://www.angeles4four.info/static/admin/
>
This is normal. The reason is not the filesystem permissions, but that Apache is
configured to not list files inside that directory (to change that you'd need to
use "Options Indexes" somewhere, but you don't want to change that). You can
still access any file in that directory, but it will not tell you which files
are available. This is the correct thing to do.

> ...
>
> drwxrwxr-x  5 tranq www-data  4096 Jan 25 23:12 cel2fah
>
>
> Does this look right to all of you?
>
It's OK, though it could be better. Apache only needs to read that directory,
not write it. Apache is user www-data and group www-data, and this directory is
writeable by group www-data, that is, writeable by Apache. So better permissions
for that would be drwxr-xr-x (which you can achieve with "chmod 755 cel2fah" or
"chmod g-w cel2fah").

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 2018-01-27 07:20, drone4four wrote:
>
> The username on my droplet is ‘tranq’ but there is a line in both my vhost
> config files which reads:
>
>
> 
>
>
> So I swapped out ‘user’ for ‘tranq’. That line now reads:
>
>
> 
>
>
> Now some of my static files are accessible.  For example you can see here:
>
>
> https://www.angeles4four.info/static/admin/css/responsive.css
>
> https://www.angeles4four.info/static/admin/css/login.css
>
>
> But the following is still saying, “Forbidden”:
>
>
> https://www.angeles4four.info/static/admin/
>
>
> This may be pointing to an issue I noticed with how my user and group
> permissions are set up for Django.  The sqlite.db file was grouped in with
> ‘tranq’. According to the guide I’ve been using, it should be: ‘www-data’.
>  I’m not sure how I overlooked this mistake because I very clearly remember
> doing it properly.  I think I’m conflating this with one of my multiple recent
> previous attempts following this guide. Anyways, here is what my group
> permissions look like now from within my project directory:
>
>
> $ ls -la
>
> total 68
>
> drwxrwxr-x  5 tranq www-data  4096 Jan 25 23:12 .
>
> drwxr-xr-x 18 tranq tranq 4096 Jan 26 21:57 ..
>
> drwxrwxr-x  3 tranq tranq 4096 Jan 25 23:13 cel2fah
>
> -rw-rw-r--  1 tranq www-data 38912 Jan 25 23:11 db.sqlite3
>
> -rwxrwxr-x  1 tranq tranq  539 Jan 25 23:05 manage.py
>
> drwxrwxr-x  3 tranq tranq 4096 Jan 25 23:12 static
>
> drwxrwxr-x  5 tranq tranq 4096 Jan 25 23:04 venv
>
>
> Notice sqlite.db above? It now says ‘www-data’.  This is how it should be, 
> right?
>
>
> The parent directory (home user folder) shows these permissions for my 
> project:
>
>
> ...
>
> drwxrwxr-x  5 tranq www-data  4096 Jan 25 23:12 cel2fah
>
>
> Does this look right to all of you?
>
>
> The steps I took to arrange the permissions as such were from the bottom of
> the mod_wsgi guide on DigitalOcean
> <https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0ahUKEwjJ_d_P0OfYAhVlxoMKHZlBBkEQFgg0MAI&url=https%3A%2F%2Fwww.digitalocean.com%2Fcommunity%2Ftutorials%2Fhow-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04&usg=AOvVaw2wt2StyReKq9zmPyQnkrO7>which
> I referred to initially.
> Thanks for your attention.
> On Friday, January 26, 2018 at 1:21:07 AM UTC-5, drone4four wrote:
>
> You’re right, @Antonis, that I don’t want my Django source code exposed.
> No sysadmin would.  I have since moved my Django project folder to my home
> user’s directory. However (out of curiosity), if I continued to house
> Django in my public_html folder (which I am not any more, but say if i
> did) I would think that my .htaccess config file would prevent
> unauthorized access to my Django source.  Am I right?
>
>
> I didn’t realize that Django was suppose to be run using wsgi.  I was just
> foolishly running the server with ``$ python manage.py runserver
> 0.0.0.0:8000`` like when I was testing locally when I was coding my app.
> The keyword here is mod_wsgi.  So I found this guide
> 
> <https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04>.
> I followed along but the issue I now have is that Apache serves my
> public_html folder (just some light  HTML, CSS and Js).  Serving these
> contents take priority over Django.  I’m OK with this. I would prefer to
> keep my public_html folder accessible as it is, but how do I arrange for
> wsgi to serve Django from a subdirectory, say:
> www.angeles4f

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-26 Thread drone4four


The username on my droplet is ‘tranq’ but there is a line in both my vhost 
config files which reads:



So I swapped out ‘user’ for ‘tranq’. That line now reads:



Now some of my static files are accessible.  For example you can see here:

https://www.angeles4four.info/static/admin/css/responsive.css

https://www.angeles4four.info/static/admin/css/login.css

But the following is still saying, “Forbidden”: 

https://www.angeles4four.info/static/admin/ 

This may be pointing to an issue I noticed with how my user and group 
permissions are set up for Django.  The sqlite.db file was grouped in with 
‘tranq’. According to the guide I’ve been using, it should be: ‘www-data’. 
 I’m not sure how I overlooked this mistake because I very clearly remember 
doing it properly.  I think I’m conflating this with one of my multiple 
recent previous attempts following this guide. Anyways, here is what my 
group permissions look like now from within my project directory:

$ ls -la

total 68

drwxrwxr-x  5 tranq www-data  4096 Jan 25 23:12 .

drwxr-xr-x 18 tranq tranq 4096 Jan 26 21:57 ..

drwxrwxr-x  3 tranq tranq 4096 Jan 25 23:13 cel2fah

-rw-rw-r--  1 tranq www-data 38912 Jan 25 23:11 db.sqlite3

-rwxrwxr-x  1 tranq tranq  539 Jan 25 23:05 manage.py

drwxrwxr-x  3 tranq tranq 4096 Jan 25 23:12 static

drwxrwxr-x  5 tranq tranq 4096 Jan 25 23:04 venv

Notice sqlite.db above? It now says ‘www-data’.  This is how it should be, 
right?

The parent directory (home user folder) shows these permissions for my 
project:

...

drwxrwxr-x  5 tranq www-data  4096 Jan 25 23:12 cel2fah

Does this look right to all of you?

The steps I took to arrange the permissions as such were from the bottom of 
the mod_wsgi guide on DigitalOcean 
<https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0ahUKEwjJ_d_P0OfYAhVlxoMKHZlBBkEQFgg0MAI&url=https%3A%2F%2Fwww.digitalocean.com%2Fcommunity%2Ftutorials%2Fhow-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04&usg=AOvVaw2wt2StyReKq9zmPyQnkrO7>
 
which I referred to initially.

Thanks for your attention.

On Friday, January 26, 2018 at 1:21:07 AM UTC-5, drone4four wrote:
>
> You’re right, @Antonis, that I don’t want my Django source code exposed. 
> No sysadmin would.  I have since moved my Django project folder to my home 
> user’s directory. However (out of curiosity), if I continued to house 
> Django in my public_html folder (which I am not any more, but say if i did) 
> I would think that my .htaccess config file would prevent unauthorized 
> access to my Django source.  Am I right?
>
> I didn’t realize that Django was suppose to be run using wsgi.  I was just 
> foolishly running the server with ``$ python manage.py runserver 
> 0.0.0.0:8000`` like when I was testing locally when I was coding my app. 
> The keyword here is mod_wsgi.  So I found this guide 
> <https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04>.
>  
> I followed along but the issue I now have is that Apache serves my 
> public_html folder (just some light  HTML, CSS and Js).  Serving these 
> contents take priority over Django.  I’m OK with this. I would prefer to 
> keep my public_html folder accessible as it is, but how do I arrange for 
> wsgi to serve Django from a subdirectory, say: 
> www.angeles4four.info/cel2fah or something like that? 
>
> @Mulianto:
>
> An example of a static file would be a style sheet, like: 
> ~/cel2fah/static/admin/css/responsive.css
>
> How would trying to access this CSS file help?
>
> I tried: 
>
> http://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css 
>
> https://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css 
> <http://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css> 
>
> Both show “This site can’t be reached”
>
> Here are the contents of my two apache configuration files.
>
> /etc/apache2/sites-available/angeles4four.info.conf :
>
> 
>
>
>
> ServerAdmin coffee.drinker.dan...@gmail.com
>
> ServerName angeles4four.info
>
> ServerAlias www.angeles4four.info
>
> DocumentRoot /var/www/html/angeles4four.info/public_html
>
>
> 
>
> Options Indexes FollowSymlinks
>
> AllowOverride All
>
> Require all granted
>
> 
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
>
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>
> RewriteEngine on
>
> RewriteCond %{SERVER_NAME} =angeles4four.info [OR]
>
> RewriteCond %{SERVER_NAME} =www.angeles4four.info
>
> RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} 
> [

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-25 Thread drone4four


You’re right, @Antonis, that I don’t want my Django source code exposed. No 
sysadmin would.  I have since moved my Django project folder to my home 
user’s directory. However (out of curiosity), if I continued to house 
Django in my public_html folder (which I am not any more, but say if i did) 
I would think that my .htaccess config file would prevent unauthorized 
access to my Django source.  Am I right?

I didn’t realize that Django was suppose to be run using wsgi.  I was just 
foolishly running the server with ``$ python manage.py runserver 
0.0.0.0:8000`` like when I was testing locally when I was coding my app. 
The keyword here is mod_wsgi.  So I found this guide 
<https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04>.
 
I followed along but the issue I now have is that Apache serves my 
public_html folder (just some light  HTML, CSS and Js).  Serving these 
contents take priority over Django.  I’m OK with this. I would prefer to 
keep my public_html folder accessible as it is, but how do I arrange for 
wsgi to serve Django from a subdirectory, say: www.angeles4four.info/cel2fah 
or something like that? 

@Mulianto:

An example of a static file would be a style sheet, like: 
~/cel2fah/static/admin/css/responsive.css

How would trying to access this CSS file help?

I tried: 

http://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css 

https://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css 
<http://www.angeles4four.info:8000/cel2fah/static/admin/css/responsive.css> 

Both show “This site can’t be reached”

Here are the contents of my two apache configuration files.

/etc/apache2/sites-available/angeles4four.info.conf :





ServerAdmin coffee.drinker.dan...@gmail.com

ServerName angeles4four.info

ServerAlias www.angeles4four.info

DocumentRoot /var/www/html/angeles4four.info/public_html




Options Indexes FollowSymlinks

AllowOverride All

Require all granted




ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined


RewriteEngine on

RewriteCond %{SERVER_NAME} =angeles4four.info [OR]

RewriteCond %{SERVER_NAME} =www.angeles4four.info

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} 
[END,NE,R=permanent]


Alias /static /home/tranq/cel2fah/static




Require all granted








Require all granted






WSGIDaemonProcess cel2fah python-path=/home/tranq/cel2fah 
python-home=/home/tranq/cel2fah/venv

WSGIProcessGroup cel2fah

WSGIScriptAlias / /home/tranq/cel2fah/cel2fah/wsgi.py






And /etc/apache2/sites-available/angeles4four.info.conf :







ServerAdmin coffee.drinker.dan...@gmail.com

ServerName angeles4four.info

ServerAlias www.angeles4four.info

DocumentRoot /var/www/html/angeles4four.info/public_html



ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined


Alias /static /home/tranq/cel2fah/static




Require all granted








Require all granted






# WSGIDaemonProcess cel2fah python-path=/home/tranq/cel2fah 
python-home=/home/tranq/cel2fah/venv

# WSGIProcessGroup cel2fah

# WSGIScriptAlias / /home/tranq/cel2fah/cel2fah/wsgi.py


SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem

SSLCertificateKeyFile 
/etc/letsencrypt/live/angeles4four.info/privkey.pem

Include /etc/letsencrypt/options-ssl-apache.conf

SSLCertificateChainFile 
/etc/letsencrypt/live/angeles4four.info/chain.pem







Thanks to you both for your help so far.

On Saturday, January 20, 2018 at 10:00:57 PM UTC-5, drone4four wrote:
>
> I’ve played with a little Django (v2.0.1) locally. Now I am trying to 
> implement a test case on my production Apache web server. I’m running an 
> Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).
>
> I got Django running.
>
> Here it is: http://www.angeles4four.info:8000/
>
> Before I log into my admin panel, I figure it’s best practices to set up 
> HTTPS first. But when I visit that URL, Chrome throws this message:
>
>
> This site can’t provide a secure connection http://www.angeles4four.info 
>> sent an invalid response. ERR_SSL_PROTOCOL_ERROR
>
>
> And my shell on my server shows this message:
>
> [20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23] 
>> code 400, message Bad request syntax 
>> ('\x16\x03\x01\x00Ì\x01\x00\x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-21 Thread Phang Mulianto
Hi

If you use ssl on apache, the ssl terminate only on apache request from
client, then the wsgi from apache is no https.

So ssl handled by your webserver service, whether the webserver you use is
apache or nginx.

Try access the static file with https is it working?



On 21 Jan 2018 4:26 pm, "Antonis Christofides" 
wrote:

> Hello,
>
> I'm not certain I understand what you are describing. Is Apache listening
> on port 8000? How is it possible that you are using "runserver" when you
> are running Django through mod_wsgi? Something is wrong there.
>
> Also, don't put your Django app's files in public_html or any other
> directory that is publicly served by Apache. You don't want visitors from
> the web reading your source code (or, much worse, your settings file with
> its secrets). If you haven't done this before you may be confused by static
> files, in which case this article (of mine)
> <https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/>
> may help.
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 2018-01-21 05:00, drone4four wrote:
>
> I’ve played with a little Django (v2.0.1) locally. Now I am trying to
> implement a test case on my production Apache web server. I’m running an
> Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).
>
> I got Django running.
>
> Here it is: http://www.angeles4four.info:8000/
>
> Before I log into my admin panel, I figure it’s best practices to set up
> HTTPS first. But when I visit that URL, Chrome throws this message:
>
>
> This site can’t provide a secure connection http://www.angeles4four.info
>> sent an invalid response. ERR_SSL_PROTOCOL_ERROR
>
>
> And my shell on my server shows this message:
>
> [20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23]
>> code 400, message Bad request syntax ('\x16\x03\x01\x00Ì\x01\x00\
>> x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89æ\x82\r¢G§\x01ç°P%\x80)ÕÃ\x00\x00\x1c
>> * À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [21/Jan/2018
>> 00:01:23] *You're accessing the development server over HTTPS, but it
>> only supports HTTP.*
>
>
> That’s because SSL isn’t set up. My current SSL Certificate Authority is
> Let’s Encrypt. SSL is running properly for my public_html content but not
> for my recent deployment of Django.
>
> I found some resources elsewhere on SO for setting up SSL with Django.
>
> In an SO post titled, “Configure SSL Certificate on Apache for Django
> Application (mod_wsgi)”, a highly upvoted answer by Alexey Kuleshevich
> suggests a template for 000-default.conf and default-ssl.conf for Apache
> vhosts. See here: Configure SSL Certificate on Apache for Django
> Application (mod_wsgi)
> <https://stackoverflow.com/questions/32812570/configure-ssl-certificate-on-apache-for-django-application-mod-wsgi>
>
> I did my best to change up the suggested values and entries so that they
> refer to my specific configuration. Here are what these two vhost
> configuration files of mine look like now.
>
> /etc/apache2/sites-available/angeles4four.info-le-ssl.conf:
>
> 
> 
> #ServerName http://www.example.com
> ServerAdmin coffee.drinker.dan...@gmail.com
> ServerName angeles4four.info
> ServerAlias http://www.angeles4four.info
> DocumentRoot /var/www/html/angeles4four.info/public_html
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>
> # Django Application
> Alias /static /var/www/html/angeles4four.info/public_html/
> Cel2FahConversion
> 
> Require all granted
> 
> 
> 
> Require all granted
> 
> 
> WGIDaemonProcess cel python-path=/var/www/html/ange
> les4four.info/public_html/Cel2FahConversion/venv/bin/python3
> WSGIProcessGroup cel
> WSGIScriptAlias / /var/www/html/angeles4four.info/public_html/
> Cel2FahConversion/Cel2FahConversion/Cel2FahConversion/wsgi.py
>
>
> SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/angeles4four.info/privkey.pem
> Include /etc/letsencrypt/options-ssl-apache.conf
> SSLCertificateChainFile /etc/letsencrypt/live/angeles4four.info/chain.pem
> 
> 
>
>
> angeles4four.info.conf:
>
> Quote:
> 
>
>
> #ServerName http://www.example.com
> ServerAdmin coffee.drinker.dan...@gmail.com
> ServerName angeles4four.info
> ServerAlias http://www.angeles4four.info
> DocumentRoot /var/www/html/angeles4four.info/public_html
> 
> Options Indexes FollowSymlinks
> AllowOverride All
> Require all granted
> 
>
>
> ErrorLo

Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-21 Thread Antonis Christofides
Hello,

I'm not certain I understand what you are describing. Is Apache listening on
port 8000? How is it possible that you are using "runserver" when you are
running Django through mod_wsgi? Something is wrong there.

Also, don't put your Django app's files in public_html or any other directory
that is publicly served by Apache. You don't want visitors from the web reading
your source code (or, much worse, your settings file with its secrets). If you
haven't done this before you may be confused by static files, in which case this
article (of mine)
<https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/>
may help.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 2018-01-21 05:00, drone4four wrote:
> I’ve played with a little Django (v2.0.1) locally. Now I am trying to
> implement a test case on my production Apache web server. I’m running an
> Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).
>
> I got Django running.
>
> Here it is: http://www.angeles4four.info:8000/
>
> Before I log into my admin panel, I figure it’s best practices to set up HTTPS
> first. But when I visit that URL, Chrome throws this message:
>
>
> This site can’t provide a secure connection http://www.angeles4four.info
> sent an invalid response. ERR_SSL_PROTOCOL_ERROR
>
>
> And my shell on my server shows this message:
>
> [20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23]
> code 400, message Bad request syntax
> 
> ('\x16\x03\x01\x00Ì\x01\x00\x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89æ\x82\r¢G§\x01ç°P%\x80)ÕÃ\x00\x00\x1c
> * À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [21/Jan/2018
> 00:01:23] *You're accessing the development server over HTTPS, but it only
> supports HTTP.*
>
>
> That’s because SSL isn’t set up. My current SSL Certificate Authority is Let’s
> Encrypt. SSL is running properly for my public_html content but not for my
> recent deployment of Django.
>
> I found some resources elsewhere on SO for setting up SSL with Django.
>
> In an SO post titled, “Configure SSL Certificate on Apache for Django
> Application (mod_wsgi)”, a highly upvoted answer by Alexey Kuleshevich
> suggests a template for 000-default.conf and default-ssl.conf for Apache
> vhosts. See here: Configure SSL Certificate on Apache for Django Application
> (mod_wsgi)
> <https://stackoverflow.com/questions/32812570/configure-ssl-certificate-on-apache-for-django-application-mod-wsgi>
>
> I did my best to change up the suggested values and entries so that they refer
> to my specific configuration. Here are what these two vhost configuration
> files of mine look like now.
>
> /etc/apache2/sites-available/angeles4four.info-le-ssl.conf:
>
> |
> 
> 
> #ServerName http://www.example.com
> ServerAdmin coffee.drinker.dan...@gmail.com
> ServerName angeles4four.info
> ServerAlias http://www.angeles4four.info
> DocumentRoot /var/www/html/angeles4four.info/public_html
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>
> # Django Application
> Alias /static /var/www/html/angeles4four.info/public_html/Cel2FahConversion
> 
> Require all granted
> 
> 
> 
> Require all granted
> 
> 
> WGIDaemonProcess cel
> python-path=/var/www/html/angeles4four.info/public_html/Cel2FahConversion/venv/bin/python3
> WSGIProcessGroup cel
> WSGIScriptAlias /
> /var/www/html/angeles4four.info/public_html/Cel2FahConversion/Cel2FahConversion/Cel2FahConversion/wsgi.py
>
>
> SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/angeles4four.info/privkey.pem
> Include /etc/letsencrypt/options-ssl-apache.conf
> SSLCertificateChainFile /etc/letsencrypt/live/angeles4four.info/chain.pem
> 
> 
> |
>
>
> angeles4four.info.conf:
>
> |
> Quote:
> 
>
>
> #ServerName http://www.example.com
> serveradmincoffee.drinker.dan...@gmail.com
> ServerNameangeles4four.info
> ServerAliashttp://www.angeles4four.info
> DocumentRoot/var/www/html/angeles4four.info/public_html
> 
> OptionsIndexesFollowSymlinks
> AllowOverrideAll
> Requireall granted
> 
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog${APACHE_LOG_DIR}/access.log combined
>
>
> RewriteEngineon
> RewriteCond%{SERVER_NAME}=angeles4four.info [OR]
> RewriteCond%{SERVER_NAME}=www.angeles4four.info
> RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
> 
> |
>
> No dice. I still get the same traceback as I initially shared.
>
> The next SO post I came across su

Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-20 Thread drone4four
I’ve played with a little Django (v2.0.1) locally. Now I am trying to 
implement a test case on my production Apache web server. I’m running an 
Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).

I got Django running.

Here it is: http://www.angeles4four.info:8000/

Before I log into my admin panel, I figure it’s best practices to set up 
HTTPS first. But when I visit that URL, Chrome throws this message:


This site can’t provide a secure connection http://www.angeles4four.info 
> sent an invalid response. ERR_SSL_PROTOCOL_ERROR


And my shell on my server shows this message:

[20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23] 
> code 400, message Bad request syntax 
> ('\x16\x03\x01\x00Ì\x01\x00\x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89æ\x82\r¢G§\x01ç°P%\x80)ÕÃ\x00\x00\x1c
>  
> * À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [21/Jan/2018 
> 00:01:23] *You're accessing the development server over HTTPS, but it 
> only supports HTTP.*


That’s because SSL isn’t set up. My current SSL Certificate Authority is 
Let’s Encrypt. SSL is running properly for my public_html content but not 
for my recent deployment of Django.

I found some resources elsewhere on SO for setting up SSL with Django.

In an SO post titled, “Configure SSL Certificate on Apache for Django 
Application (mod_wsgi)”, a highly upvoted answer by Alexey Kuleshevich 
suggests a template for 000-default.conf and default-ssl.conf for Apache 
vhosts. See here: Configure SSL Certificate on Apache for Django 
Application (mod_wsgi) 
<https://stackoverflow.com/questions/32812570/configure-ssl-certificate-on-apache-for-django-application-mod-wsgi>

I did my best to change up the suggested values and entries so that they 
refer to my specific configuration. Here are what these two vhost 
configuration files of mine look like now.

/etc/apache2/sites-available/angeles4four.info-le-ssl.conf:

 

#ServerName http://www.example.com
ServerAdmin coffee.drinker.dan...@gmail.com
ServerName angeles4four.info
ServerAlias http://www.angeles4four.info
DocumentRoot /var/www/html/angeles4four.info/public_html


ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


# Django Application
Alias /static /var/www/html/angeles4four.info/public_html/Cel2FahConversion

Require all granted



Require all granted


WGIDaemonProcess cel 
python-path=/var/www/html/angeles4four.info/public_html/Cel2FahConversion/venv/bin/python3
WSGIProcessGroup cel
WSGIScriptAlias / 
/var/www/html/angeles4four.info/public_html/Cel2FahConversion/Cel2FahConversion/Cel2FahConversion/wsgi.py


SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/angeles4four.info/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/angeles4four.info/chain.pem




angeles4four.info.conf:

Quote:



#ServerName http://www.example.com
ServerAdmin coffee.drinker.dan...@gmail.com
ServerName angeles4four.info
ServerAlias http://www.angeles4four.info
DocumentRoot /var/www/html/angeles4four.info/public_html

Options Indexes FollowSymlinks
AllowOverride All
Require all granted



ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


RewriteEngine on
RewriteCond %{SERVER_NAME} =angeles4four.info [OR]
RewriteCond %{SERVER_NAME} =www.angeles4four.info
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


No dice. I still get the same traceback as I initially shared.

The next SO post I came across suggests modifying settings.py. Here it is: 
Error 
"You're accessing the development server over HTTPS, but it only supports 
HTTP" 
<https://stackoverflow.com/questions/35536491/error-youre-accessing-the-development-server-over-https-but-it-only-supports/41444706>

The upvoted suggestion here by YoYo is to modify session cookies and secure 
SSL redirect. YoYo also recommends managing base, local, production 
settings which doesn’t really apply to me. So I tried adding these three 
lines to my settings.py:


SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True


My python3 manage.py runserver shell traceback still says: *“You're 
accessing the development server over HTTPS, but it only supports HTTP.”*

Any ideas? What else could I try?

Thanks for your attention.

-- 
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/c0592c57-9a5a-4693-b685-80933643eb49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   8   9   10   >