Re: Getting 500 error on ASO

2015-12-13 Thread Jack Maxwell
I've got the same problem to configure my Shared Host on QHoster, using 
fastCGI. 

I didn't find a valid tutorial so far.

my config:
/home/username/
| /public_html/.htaccess
|   /index.fcgi
|-/mydjangoVirtualEnv
|-/MyDjangoProject_SRC
  |manage.py
  |MyDjangoProject
  |--settings.py

My .htaccess :

> AddHandler fcgi-script .fcgi
> RewriteEngine On
> RewriteCon %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
>

My index.fcgi:

> #!/home/username/djangoenv/bin/python
> import sys
> import os
>
> sys.path.insert(0, "/home/username/djangoenv/lib/python3.4/site-packages")
> sys.path.append("/home/username/MyDjangoProject_SRC/MyDjangoProject")
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'MyDjangoProject.settings'
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>

When I go to my home page, I get a 500 error.
The log from cPanel only displays: 
MY_IP - - [13/Dec/2015:09:34:29 +] "GET / HTTP/1.0" 500 - "-" 
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 
Firefox/42.0"


Any help or even a little suggestions welcome! I can go nowhere from here 
after days of searching... 

-- 
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/0eb8e651-7be8-42a3-bbed-59a7a8187a24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting 500 error on ASO

2015-03-11 Thread Collin Anderson
Hi Michael,

Are you checking your Apache log? Also, be sure to set up ADMINS so you can 
get emails for any django errors.

I believe runfastcgi is gone from django now, along with all 
of django.core.servers.fastcgi.

At work we used to host on ASO too. We now use Linode. Digital Ocean is 
good too.

Collin

On Monday, March 9, 2015 at 9:57:47 PM UTC-4, mfox_chi wrote:
>
> Hi Everyone,
>
> I've been working on learning Django the past few months and have been 
> following the django tutorials here:
>
> https://docs.djangoproject.com/en/1.7/.
>
> I've followed the tutorial on my local machine in addition to on my A 
> Small Orange account.
>
> A Small Orange has this tutorial:
>
>
> https://kb.asmallorange.com/customer/portal/articles/1603414-install-django-using-virtualenv
>
> which has gotten me to reach the default django "Congrats" webpage. This 
> pages appears on both my local machines django setup and the ASO website. 
> The next step is to run the startapp function within the mysite folder.
>
> My folder structure is as follows on the ASO server
>
> home/"username"/
>website/
>   mysite/ 
> polls/ (after I run the startapp command)
>(all the startapp default files) 
> mysite/
>  (all the startproject default files)
>   public_html/
>   dispatch.fcgi
>   .htaccess
>
> My issue is that when I run "python27 manage.py startapp polls" from 
> within the website/mysite folder my server immediately goes to a 500 
> internal server error page online while this function causes no issues on 
> my local computer.
>
> The only lead I have on the problem currently is that when I run my 
> dispatch.fcgi file via "python27 dispatch.fcgi" from within the public_html 
> directory I get the HTML output that should be up on my website. The output 
> is shown within my SSH. This makes me think the error has something to do 
> with the communication between the .htaccess file and the dispatch file. 
>
> -dispatch.fcgi 
>
> from traceback import formate_exc
> try:
> #!/home#/theopeni/.env/env/bin/python
>
>  import sys
>  import os
>
>  sys.path.insert(0, 
> "/home/(myusername)/.env/env/lib/python2.7/site-packages")
>  sys.path.append("/home/(my username)/website/mysite/mysite")
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
> except Exception:
> open("/home/(my username)/website/error.txt", "w").write(format_exc())
> raise
>
> -.htaccess
>
> AddHandler fcgi-script .fcgi
> RewriteEngine On
> RewriteCon %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]
>
> I've talked to the ASO customer support and I worked with a technical 
> support person for about a week to solve it and they were able to get an 
> app started without error but then told me that this was beyond the scope 
> of their customer support. I then tried adding my own app with the python27 
> manage.py startapp command and it broke the website again. 
>
> Has anyone else encountered this problem?
>
> Thank you!
>
> Michael
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8bd55f77-8617-43bf-9d88-4d04e95683d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting 500 error on ASO

2015-03-09 Thread mfox_chi
Hi Everyone,

I've been working on learning Django the past few months and have been 
following the django tutorials here:

https://docs.djangoproject.com/en/1.7/.

I've followed the tutorial on my local machine in addition to on my A Small 
Orange account.

A Small Orange has this tutorial:

https://kb.asmallorange.com/customer/portal/articles/1603414-install-django-using-virtualenv

which has gotten me to reach the default django "Congrats" webpage. This 
pages appears on both my local machines django setup and the ASO website. 
The next step is to run the startapp function within the mysite folder.

My folder structure is as follows on the ASO server

home/"username"/
   website/
  mysite/ 
polls/ (after I run the startapp command)
   (all the startapp default files) 
mysite/
 (all the startproject default files)
  public_html/
  dispatch.fcgi
  .htaccess

My issue is that when I run "python27 manage.py startapp polls" from within 
the website/mysite folder my server immediately goes to a 500 internal 
server error page online while this function causes no issues on my local 
computer.

The only lead I have on the problem currently is that when I run my 
dispatch.fcgi file via "python27 dispatch.fcgi" from within the public_html 
directory I get the HTML output that should be up on my website. The output 
is shown within my SSH. This makes me think the error has something to do 
with the communication between the .htaccess file and the dispatch file. 

-dispatch.fcgi 

from traceback import formate_exc
try:
#!/home#/theopeni/.env/env/bin/python

 import sys
 import os

 sys.path.insert(0, 
"/home/(myusername)/.env/env/lib/python2.7/site-packages")
 sys.path.append("/home/(my username)/website/mysite/mysite")

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

except Exception:
open("/home/(my username)/website/error.txt", "w").write(format_exc())
raise

-.htaccess

AddHandler fcgi-script .fcgi
RewriteEngine On
RewriteCon %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]

I've talked to the ASO customer support and I worked with a technical 
support person for about a week to solve it and they were able to get an 
app started without error but then told me that this was beyond the scope 
of their customer support. I then tried adding my own app with the python27 
manage.py startapp command and it broke the website again. 

Has anyone else encountered this problem?

Thank you!

Michael

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b97d7467-777d-4808-a447-8d71425bc8fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.