installation.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. Installation
  2. ============
  3. - `Basic Setup <#basic-setup>`_
  4. - `Configuration <#configuration>`_
  5. - `Deplyoing <#deploying>`_
  6. Basic Setup
  7. ===========
  8. Virtualenv Setup
  9. ~~~~~~~~~~~~~~~~
  10. Before you can start, you need to create a `virtualenv`.
  11. You can install the virtualenvwrapper with your package manager or via pip.
  12. Be sure that pip is installed. If you don't know how to install pip, have a
  13. look at their `documentation <http://www.pip-installer.org/en/latest/installing.html>`_.
  14. For example, on archlinux you can install it with
  15. ::
  16. $ sudo pacman -S python2-virtualenvwrapper
  17. or, if you own a Mac, you can simply install it with
  18. ::
  19. $ sudo pip install virtualenvwrapper
  20. For more information checkout the `virtualenvwrapper <http://virtualenvwrapper.readthedocs.org/en/latest/install.html#basic-installation>`_ installation.
  21. After that you can create your virtualenv with
  22. ::
  23. $ mkvirtualenv -a /path/to/flaskbb -p $(which python2) flaskbb
  24. and you should be switched automatically to your newly created virtualenv.
  25. To deactivate it you just have to type ``deactivate`` and if you want to work
  26. on it again, you need to type ``workon flaskbb``.
  27. Required Dependencies
  28. ~~~~~~~~~~~~~~~~~~~~~
  29. Now you can install the required dependencies.
  30. ::
  31. $ pip install -r requirements.txt
  32. Optional Dependencies
  33. ~~~~~~~~~~~~~~~~~~~~~~
  34. We have one optional dependency, redis (the python package is installed automatically).
  35. If you want to use it, be sure that a redis-server is running. If you decide
  36. to use redis, the `online guests` and `online users` are being tracked by redis,
  37. else it will only track the `online users` via a simple SQL query.
  38. On Archlinux
  39. ------------
  40. ::
  41. # Install redis
  42. $ sudo pacman -S redis
  43. # Check if redis is already running.
  44. $ systemctl status redis
  45. # If not, start it.
  46. $ sudo systemctl start redis
  47. # Optional: Start redis everytime you boot your machine
  48. $ sudo systemctl enable redis
  49. On Debian 7.0 (Wheezy)
  50. ----------------------
  51. ::
  52. # Install redis
  53. $ sudo apt-get install redis-server
  54. # Check if redis is already running.
  55. $ service redis-server status
  56. # If not, start it
  57. $ sudo service redis-server start
  58. # Optional: Start redis everytime you boot your machine
  59. # I can't remember if this is done automatically..
  60. $ sudo update-rc.d redis-server defaults
  61. Configuration
  62. =============
  63. Before you can start, you need to configure `FlaskBB`.
  64. Development
  65. ~~~~~~~~~~~
  66. For development, you need to copy ``flaskbb/configs/development.py.example`` to
  67. ``flaskbb/configs/development.py``.
  68. ::
  69. cp flaskbb/configs/development.py.example flaskbb/configs/development.py
  70. The reCAPTCHA keys should work fine on localhost. If you don't want to use
  71. Google Mail, see `Mail Examples <#mail-examples>`_ for more options.
  72. Production
  73. ~~~~~~~~~~
  74. If you plan, to use `FlaskBB` in a production environment (not recommended at
  75. the moment, because it's still in development), you need to copy
  76. ``flaskbb/configs/production.py.example`` to ``flaskbb/configs/production.py``.
  77. ::
  78. cp flaskbb/configs/production.py.example flaskbb/configs/production.py
  79. Now open ``flaskbb/configs/production.py`` with your favourite editor and adjust
  80. the config variables to your needs.
  81. If you don't want to use
  82. Google Mail, see `Mail Examples <#mail-examples>`_ for more options.
  83. Mail Examples
  84. ~~~~~~~~~~~~~
  85. Google Mail
  86. -----------
  87. ::
  88. MAIL_SERVER = "smtp.gmail.com"
  89. MAIL_PORT = 465
  90. MAIL_USE_SSL = True
  91. MAIL_USERNAME = "your_username@gmail.com"
  92. MAIL_PASSWORD = "your_password"
  93. MAIL_DEFAULT_SENDER = ("Your Name", "your_username@gmail.com")
  94. # Where to logger should send the emails to
  95. ADMINS = ["your_admin_user@gmail.com"]
  96. Local SMTP Server
  97. -----------------
  98. ::
  99. MAIL_SERVER = "localhost"
  100. MAIL_PORT = 25
  101. MAIL_USE_SSL = False
  102. MAIL_USERNAME = ""
  103. MAIL_PASSWORD = ""
  104. MAIL_DEFAULT_SENDER = "noreply@example.org"
  105. # Where to logger should send the emails to
  106. ADMINS = ["your_admin_user@example.org"]
  107. Installation
  108. ============
  109. Now, you should be able to install `FlaskBB` and can run therefore
  110. ::
  111. python manage.py initflaskbb
  112. Here you are asked about what your username is, which email adress you use
  113. and last but not least, which password your admin user has (please choose a secure one).
  114. To test if everything worked, run the development server with
  115. ``python manage.py runserver``.
  116. Deploying
  117. =========
  118. Supervisor
  119. ~~~~~~~~~~
  120. uWSGI
  121. ~~~~~
  122. nginx
  123. ~~~~~