Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
Hi James, thank you for so detailed answer in general about this 
problematic.

1) I am agreed with you that "root" folder is not the best place for my 
application. *I thought if I try to chose another location for python app, 
paths in app will be different and it will not work.* but I will try it 
later when I use my computer, as you said (new *env* and new location) and 
I will see what will happen. I will see also how to make Apache just to 
read and not to write in that folder.

2) iRedMail had redirection in apache from mijaw.com to mijaw.com/mail but 
I deleted that redirection and I have now clear *apache default welcome 
page* when I visit mijaw.com it means I must type mijaw.com/mail to visit 
iRedMail/roundcube. although https://mijaw.com and https://mijaw.com/mail 
are using the same ssl certificate from iRedMail. so, mijaw.com is clear 
apache welcome page & that's the place for python application, when 
visitors type https://mijaw.com they should get/visit my python app.

3) about single site: *possibly you speak about single python site? but 
beside python can I have other sites as subdomains?*
in this moment, I have VPS with one IP address and 2 domains on the same 
IP. 
mijaw.com has one subdomain, html/css website, but it is subdomain like 
library.mijaw.com, mijaw.com is free for python application, another domain 
has several subdomains (flash, wordpress and 2 html/css websites). 
so, I think there should be no problem to connect python app with this 
domain mijaw.com because it is default apache welcome page, I should be 
able to connect it with my python app. am I wrong?

4) this is exactly what I can't do, the paths are nightmare for me, I 
*cannot* connect python with apache: 
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/
look this, I will never succeed to implement this general path into my 
particular case: 
WSGIPythonPath 
/path/to/mysite.com:/path/to/your/venv/lib/python3.X/site-packages
I suppose I should chose that apache/wsgi option because I use virtualenv.

5) well, in the case it will not work in apache because of iredmail and 
other sites, can I install parallel *nginx with apache and connect 
mijaw.com with nginx?* problem is that I never used nginx than only apache, 
but I could try it, if it is necessary. than apache and iredmail would use 
mijaw.com/mail and nginx would use mijaw.com i.e. python app.

but in general, I would like to try first in apache, so, I would need help 
to implement this below in my particular case, I wrote in my first post my 
application paths: 
WSGIPythonPath 
/path/to/mysite.com:/path/to/your/venv/lib/python3.X/site-packages

if somebody solve me this problem, I will move app from root folder in SRV 
or similar and change it in this path. 

this is also killing me, I suppose it should be written in apache conf file 
"mijaw-ssl.conf": 
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
Alias /robots.txt /path/to/mysite.com/static/robots.txt
Alias /favicon.ico /path/to/mysite.com/static/favicon.ico
Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/




6) of course, if I can use other port for https for django, it is good. 
just I don't know where are this https and port settings in my python app: 
https://docs.djangoproject.com/en/1.9/topics/security/#ssl-https
I will try to find later this string: *SECURE_SSL_REDIRECT to True. *
btw, I don't mind for search rankings :)

thank you for your answer. I will use later my computer and relocate app, 
try to find string and all the rest.

-- 
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/1ba75750-c424-473e-8ea1-62f556da5aef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
I don't know how to edit message, if it is important, here is path from 
yesterday, location of Django:
Requirement already satisfied (use --upgrade to upgrade): *Django==1.8.3* in
 */root/env/lib/python3.4/site-**packages* (from -r requirements.txt (line 1
))

-- 
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/1572ff3f-3760-411a-ac7c-af2f033312ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to deploy python/django application in debian/apache?

2016-02-10 Thread John Travolta
Hi,

I succeeded to run development python application: python3 ./manage.py 
runserver 0.0.0.0:8080

but now I need to make deployment, honestly I didn't succed to do it from 
august. I hope here I will get help.

*first of all, settings.py had to be corrected from debug = true to DEBUG = 
False & **ALLOWED_HOSTS = ['*',]** should be with domain name, let's say: 
mijaw.com, **ALLOWED_HOSTS = ['https://mijaw.com',]*

I use debian + apache with iRedMail (I think iredmail already installed 
wsgi module for apache), all my sites at my VPS are redirected from port 80 
to 443, visitors are forced to use httpS, it means when I tried 443 and 80, 
port was alrwady in use and I had to choose 8080. but I want that my python 
application is deployed with ssl, 443 port. 
if it is too much complicated let's try first with 8080, it doesn't matter 
so much,

the biggest problem for me is connecting python application (placed in root 
folder) with domain/apache configuration file (virtual host): 
*/etc/apache2/sites-available/mijaw-ssl.conf*
mijaw-ssl.conf is apache configuration file for domain with port 443. as I 
said, it is forced from 80 to 443, so, it is httpS://mijaw.com

first I will tell you my python paths:
my settings.py is located at:* /root/mercury/mercury*
*but there is also urls.py and wsgi.py in this folder: *
*/root/mercury/mercury*
admins.py, *urls.py*, templates folder are located at: 
*/root/mercury/messages*
my virtualenv folder is: */root/env/bin/activate*
if static folder is important, there are css,fonts,javascript and other 
folders: */root/mercury/static*
html files are here: */root/mercury/messages/templates*

my problem is: all of this should be connected with 
*/etc/apache2/sites-available/mijaw-ssl.conf*

*here it is automatically created by iRedMail, *I suppose it should be 
added similar for my python app:



 ServerAdmin webmaster@localhost
 DocumentRoot /var/www/html

SSLEngine on
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always set Strict-Transport-Security "max-age=15768000"
SSLCipherSuite 
ECDHE-RSA-AES128-GCM-SHA256.blah-blah

SSLHonorCipherOrder on

SSLCertificateFile /etc/ssl/certs/iRedMail.crt
SSLCertificateKeyFile /etc/ssl/private/iRedMail.key
...


SSLOptions +StdEnvVars


SSLOptions +StdEnvVars


Alias /iredadmin/static "/opt/www/iredadmin/static/"
WSGIScriptAlias /iredadmin "/opt/www/iredadmin/iredadmin.py/"
Alias /mail "/opt/www/roundcubemail/"
Alias /awstats/icon "/usr/share/awstats/icon/"
Alias /awstatsicon "/usr/share/awstats/icon/"
ScriptAlias /awstats "/usr/lib/cgi-bin/"
 



*I checked of module wsgi is running and it is running: *

apache2ctl -t -D DUMP_MODULES

result: wsgi_module (shared)


should I add somewhere also: AddHandler wsgi-script .wsgi


*so, all in all, I should connected python app placed in root folder with 
apache configuration and domain running with 443 port/https, so I would like 
secure connection for my python application.*

wsgi_module (shared)

-- 
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/c7cfcd0d-94a0-4832-85c6-c9da1818debf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ./manage.py runserver 0.0.0.0:8080 is not working, No module named django.core.management

2016-02-09 Thread John Travolta


On Tuesday, February 9, 2016 at 7:28:31 PM UTC+1, Daniel Roseman wrote:
>
>
> Django is installed for Python 3.4, but you're running the shell and 
> server in Python 2. Do `python3 manage.py ...`.
> --
> DR
>
>  
>

*thank you very much, it solved my problem. *
now I will make new topic, how to configfure apache to deploy python/django 
application... 

-- 
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/30178b4a-c1e5-4013-9ed0-536b88145a3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


./manage.py runserver 0.0.0.0:8080 is not working, No module named django.core.management

2016-02-09 Thread John Travolta
Hi,
in the past I succeeded to start python server but now I changed VPS and I 
can't do it. 

here is what I get, i tried to find an answer with google but no success:

*./manage.py runserver 0.0.0.0:8080*
Traceback (most recent call last):
  File "./manage.py", line 8, in 
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

I tried sudo, python, python3.4, python2.7, before ./manage, but no 
success. even if django is not upgraded, it should work, but it is not.

*(env)root@mx:~/mercury# pip freeze|grep -i django*
Django==1.8.3
*(env)root@mx:~/mercury# python*
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import sys.path
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named path
>>> *print sys.path*
['', '/root/env/lib/python2.7', 
'/root/env/lib/python2.7/plat-x86_64-linux-gnu', 
'/root/env/lib/python2.7/lib-tk', '/root/env/lib/python2.7/lib-old', 
'/root/env/lib/python2.7/lib-dynload', '/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', 
'/root/env/local/lib/python2.7/site-packages', 
'/root/env/lib/python2.7/site-packages']

all requirements are met just it is not upgraded:
(env)root@mx:~/mercury# pip install -r requirements.txt
Requirement already satisfied (use --upgrade to upgrade): Django==1.8.3 in /
root/env/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): mysqlclient==1.3.6 
in /root/env/lib/python3.4/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pycrypto==2.6.1 in 
/root/env/lib/python3.4/site-packages (from -r requirements.txt (line 3))

any help?

-- 
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/eb9a149c-2b9c-45de-94e5-8d2ffe6a65a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


manage.py runserver is not working, No module named django.core.management

2016-02-09 Thread John Travolta
Hi,
in the past I succeeded to start python server but now I changed VPS and I 
can't do it. 

here is what I get, i tried to find an answer with google but no success:

*./manage.py runserver 0.0.0.0:8080*
Traceback (most recent call last):
  File "./manage.py", line 8, in 
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

I tried sudo, python, python3.4, python2.7, before ./manage, but no 
success. even if django is not upgraded, it should work, but it is not.

*(env)root@mx:~/mercury# pip freeze|grep -i django*
Django==1.8.3
*(env)root@mx:~/mercury# python*
Python 2.7.9 (default, Mar  1 2015, 12:57:24)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import sys.path
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named path
>>> *print sys.path*
['', '/root/env/lib/python2.7', 
'/root/env/lib/python2.7/plat-x86_64-linux-gnu', 
'/root/env/lib/python2.7/lib-tk', '/root/env/lib/python2.7/lib-old', 
'/root/env/lib/python2.7/lib-dynload', '/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', 
'/root/env/local/lib/python2.7/site-packages', 
'/root/env/lib/python2.7/site-packages']

all requirements are met just it is not upgraded:
(env)root@mx:~/mercury# pip install -r requirements.txt
Requirement already satisfied (use --upgrade to upgrade): Django==1.8.3 in /
root/env/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): mysqlclient==1.3.6 
in /root/env/lib/python3.4/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): pycrypto==2.6.1 in 
/root/env/lib/python3.4/site-packages (from -r requirements.txt (line 3))

any help?

-- 
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/20dae6d9-fc9f-4abd-ab23-d608f72f72b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Recovery Windows Registry

2007-10-02 Thread John Travolta
Repair corrupted registry, fix your system
http://windowsfreetips.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows XP tips and tricks

2007-09-27 Thread John Travolta
http://windowsfreetips.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Great deals on Laptop computers

2007-09-26 Thread John Travolta
Find cheap laptop http://cheaphardware.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Tips for Windows

2007-09-24 Thread John Travolta
Tweak your Windows XP http://windowsfreetips.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows Optimization Tips

2007-09-22 Thread John Travolta
http://windowsfreetips.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows XP tips and tricks

2007-09-21 Thread John Travolta
Learn how to repair, speed up and tweak your Windows XP
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



System optimizer

2007-09-21 Thread John Travolta
Optimize your operating system  http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Make Operating System Faster !!

2007-08-18 Thread John Travolta
Tune up your system and make it faster
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Software Problem Solving

2007-08-18 Thread John Travolta
Software problem solving
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Clean Up your Operating System

2007-08-16 Thread John Travolta
Optimize your operating system, minimize background activities,  repair
registry base, uninstall unnecessary components, get rid of boring errors
and make your operating system safer.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Repair Your (Microsoft) Operating System

2007-08-13 Thread John Travolta
Windows XP tips and tricks. Learn how to bypass very common windows
problems, to speed up your system and make it more reliable with useful tips
and tricks.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows XP - Repairing

2007-08-11 Thread John Travolta
Optimize your operating system, minimize background activities,  repair
registry base, uninstall unnecessary components, get rid of boring errors
and make your operating system safer.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Fix Your WINDOWS XP

2007-08-10 Thread John Travolta
Repair your installation and fix all errors in your operating system
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows XP optimization tricks

2007-08-07 Thread John Travolta
Collection of very useful tips and tricks
http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Repair Your (Microsoft) Operating System

2007-08-05 Thread John Travolta
Tweak your Windows and speed it up
http://windowsxpsp2pro.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Tune up your Windows XP

2007-08-05 Thread John Travolta
Optimize your operating system, minimize background activities,  repair
registry base, uninstall unnecessary components, get rid of boring errors
and make your operating system safer.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows Tips and Tricks

2007-08-04 Thread John Travolta
Speed up your system, repair registry base,  uninstall hidden windows
components and get rid of boring errors with powerful tips and tricks.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Free Windows XP tips and tricks

2007-08-04 Thread John Travolta
Windows XP tips and tricks. Learn how to bypass very common windows
problems, to speed up your system and make it more reliable with useful tips
and tricks.

http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Windows XP tips and tricks

2007-08-02 Thread John Travolta
Great Windows XP tips and tricks http://windowsxpsp2pro.blogspot.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---