Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kris@dask:~$ uname -a
- Linux dask 4.9.36-x86_64-linode85 #1 SMP Thu Jul 6 15:31:23 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- kris@dask:~$ sudo cat /etc/postgresql/9.5/main/pg_hba.conf
- ...
- local all postgres peer
- # TYPE DATABASE USER ADDRESS METHOD
- # "local" is for Unix domain socket connections only
- local all all md5
- # IPv4 local connections:
- host all all 127.0.0.1/32 md5
- # IPv6 local connections:
- host all all ::1/128 md5
- # Allow replication connections from localhost, by a user with the
- # replication privilege.
- #local replication postgres peer
- #host replication postgres 127.0.0.1/32 md5
- #host replication postgres ::1/128 md5
- kris@dask:/home/dask/www/code/daskretreats_org$ cat wsgi.py
- """
- WSGI config for daskretreats_org 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/1.10/howto/deployment/wsgi/
- """
- import os
- from django.core.wsgi import get_wsgi_application
- from mezzanine.utils.conf import real_project_name
- os.environ.setdefault("DJANGO_SETTINGS_MODULE",
- "%s.settings" % real_project_name("daskretreats_org"))
- application = get_wsgi_application()
- (venv) dask@dask:~/www/secrets$ python
- Python 2.7.12 (default, Nov 19 2016, 06:48:10)
- [GCC 5.4.0 20160609] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import psycopg2
- >>> f = open("postgres_key")
- >>> passwd = f.read().strip()
- >>> conn = psycopg2.connect("dbname=daskretreats_org user=dask password=%s" % passwd)
- >>> conn.dsn
- 'password=xxx user=dask dbname=daskretreats_org'
- kris@dask:~$ cat /etc/apache2/sites-enabled/daskretreats_org.conf
- <VirtualHost *:80>
- ServerName daskretreats.org
- Alias /static /home/dask/www/html/static
- <Directory /home/dask/www/html/static>
- Require all granted
- </Directory>
- <Directory /home/dask/www/code/daskretreats_org>
- <Files wsgi.py>
- Require all granted
- </Files>
- </Directory>
- WSGIDaemonProcess daskretreats_org python-home=/home/dask/www/venv python-path=/home/dask/www/code
- WSGIProcessGroup daskretreats_org
- WSGIScriptAlias / /home/dask/www/code/daskretreats_org/wsgi.py
- </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement