Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing in webfaction #35

Closed
andylou opened this issue Sep 2, 2013 · 2 comments
Closed

installing in webfaction #35

andylou opened this issue Sep 2, 2013 · 2 comments

Comments

@andylou
Copy link

andylou commented Sep 2, 2013

can you help or guide me install ?
I am not clear about virtualenv
first what I did is installing PIL and PostgreSQl on src
base on these link:
https://jamiecurle.co.uk/blog/webfaction-installing-pil/
http://stackoverflow.com/questions/5394331/how-to-setup-postgresql-database-in-django

and then I follow the short instruction on installation pinry which is:?
virtualenv .
bin/pip install -r requirements.txt

and I run python manage.py syncdb
I set everything to production so I configure database in postgresql

Did I missing anything? seems like database is not installing?

Please I need your guide

@reyman
Copy link

reyman commented Sep 17, 2013

If that can help you, i finally have a working pinry on webfaction acount, using ENV.

You need to create an application mod_wsgi in webfaction panel

My httpd.conf :

ServerRoot "/home/reyman64/webapps/pinry/apache2"

LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/reyman64/logs/user/access_pinry.log combined
ErrorLog /home/reyman64/logs/user/error_pinry.log
KeepAlive Off
Listen 22925
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess pinry processes=5 python-path=/home/reyman64/webapps/pinry/lib/python2.7 threads=1
WSGIProcessGroup pinry
WSGIRestrictEmbedded On
WSGILazyInitialization On

NameVirtualHost 127.0.0.1:22925

<VirtualHost 127.0.0.1:22925>
    WSGIScriptAlias / /home/reyman64/webapps/pinry/pinry/wsgi.py
    ServerName pic.squirrelartblog.fr
    ServerAlias www.pic.squirrelartblog.fr
</VirtualHost>

My wsgy.py :

import os,sys,site

site.addsitedir('/home/reyman64/.virtualenvs/pinry/lib/python2.7/site-packages')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.production")

activate_this = os.path.expanduser("~/.virtualenvs/pinry/bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))

project = '/home/reyman64/webapps/pinry/pinry/'
workspace = os.path.dirname(project)
sys.path.append(workspace)

sys.path = ['/home/reyman64/webapps/pinry/pinry',
'/home/reyman64/webapps/pinry/pinry/apps',
'/home/reyman64/webapps/pinry'] + sys.path

from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

my production.py :

from pinry.settings import *
import os
ALLOWED_HOSTS = ['pic.squirrelartblog.fr', ]
DEBUG = True
TEMPLATE_DEBUG = DEBUG

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'nameofbd',
        'USER': 'bduser',
        'PASSWORD': 'password',
        'HOST': ''
    }
}

# TODO: Be sure to set this.
SECRET_KEY = 'mysecretkey'

I run multiple time syncdb and migrate without success, and finally i understand with help of webfaction operator (webfaction is really a great hosting platform !) that i need to change in manage.py :

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.development")
transformed to os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.production")

Rerun syncdb and migrate, and normally that work :)
Hope that can help you

@overshard
Copy link
Member

@andylou I hope this helped, I'm closing this though, none of the core devs use Webfactions so I can't provide direct support for it. The only thing we really suggest deploying with right now is Docker, so any system that supports docker you can use https://github.com/pinry/docker-pinry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants