Advertisement
Guest User

Untitled

a guest
Aug 29th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. kris@dask:~$ uname -a
  2. 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
  3.  
  4. kris@dask:~$ sudo cat /etc/postgresql/9.5/main/pg_hba.conf
  5. ...
  6.  
  7. local all postgres peer
  8.  
  9. # TYPE DATABASE USER ADDRESS METHOD
  10.  
  11. # "local" is for Unix domain socket connections only
  12. local all all md5
  13. # IPv4 local connections:
  14. host all all 127.0.0.1/32 md5
  15. # IPv6 local connections:
  16. host all all ::1/128 md5
  17. # Allow replication connections from localhost, by a user with the
  18. # replication privilege.
  19. #local replication postgres peer
  20. #host replication postgres 127.0.0.1/32 md5
  21. #host replication postgres ::1/128 md5
  22.  
  23. kris@dask:/home/dask/www/code/daskretreats_org$ cat wsgi.py
  24. """
  25. WSGI config for daskretreats_org project.
  26.  
  27. It exposes the WSGI callable as a module-level variable named ``application``.
  28.  
  29. For more information on this file, see
  30. https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
  31. """
  32.  
  33. import os
  34.  
  35. from django.core.wsgi import get_wsgi_application
  36. from mezzanine.utils.conf import real_project_name
  37.  
  38. os.environ.setdefault("DJANGO_SETTINGS_MODULE",
  39. "%s.settings" % real_project_name("daskretreats_org"))
  40.  
  41. application = get_wsgi_application()
  42.  
  43. (venv) dask@dask:~/www/secrets$ python
  44. Python 2.7.12 (default, Nov 19 2016, 06:48:10)
  45. [GCC 5.4.0 20160609] on linux2
  46. Type "help", "copyright", "credits" or "license" for more information.
  47. >>> import psycopg2
  48. >>> f = open("postgres_key")
  49. >>> passwd = f.read().strip()
  50. >>> conn = psycopg2.connect("dbname=daskretreats_org user=dask password=%s" % passwd)
  51. >>> conn.dsn
  52. 'password=xxx user=dask dbname=daskretreats_org'
  53.  
  54. kris@dask:~$ cat /etc/apache2/sites-enabled/daskretreats_org.conf
  55. <VirtualHost *:80>
  56. ServerName daskretreats.org
  57. Alias /static /home/dask/www/html/static
  58. <Directory /home/dask/www/html/static>
  59. Require all granted
  60. </Directory>
  61.  
  62. <Directory /home/dask/www/code/daskretreats_org>
  63. <Files wsgi.py>
  64. Require all granted
  65. </Files>
  66. </Directory>
  67.  
  68. WSGIDaemonProcess daskretreats_org python-home=/home/dask/www/venv python-path=/home/dask/www/code
  69. WSGIProcessGroup daskretreats_org
  70. WSGIScriptAlias / /home/dask/www/code/daskretreats_org/wsgi.py
  71. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement