UWeb2 to uWeb3 conversion » History » Version 2
Arjen Pander, 2020-05-05 16:27
1 | 2 | Arjen Pander | h1. Converting from uWeb2 to uWeb3 |
---|---|---|---|
2 | 1 | Arjen Pander | |
3 | 1 | Arjen Pander | - Make a 'base' directory in your repository root directory. |
4 | 1 | Arjen Pander | - Move your pagemaker and config files, as well as router, static and templates directtories into this new base directory. |
5 | 1 | Arjen Pander | - Move your router file to the base directory and rename it to __init__.py |
6 | 1 | Arjen Pander | - Search and replace (case sensitive) in all python files all references of 'uweb' to 'uweb3'. |
7 | 1 | Arjen Pander | - Rename your config file to config.ini |
8 | 1 | Arjen Pander | - Change 'server' to 'host' in the mysql section of the config file. |
9 | 1 | Arjen Pander | - Add the following to the config file: |
10 | 1 | Arjen Pander | |
11 | 1 | Arjen Pander | <pre>[routing] |
12 | 1 | Arjen Pander | disable_automatic_route_detection = False |
13 | 1 | Arjen Pander | default_routing = routes</pre> |
14 | 1 | Arjen Pander | |
15 | 1 | Arjen Pander | - Replace the 'standalone' block with the following: |
16 | 1 | Arjen Pander | |
17 | 1 | Arjen Pander | <pre>[development] |
18 | 1 | Arjen Pander | access_logging = True |
19 | 1 | Arjen Pander | error_logging = True |
20 | 1 | Arjen Pander | port = 8000 |
21 | 1 | Arjen Pander | dev = True</pre> |
22 | 1 | Arjen Pander | |
23 | 1 | Arjen Pander | - import os in the init file |
24 | 1 | Arjen Pander | - Remove the 'CONFIG' and 'PACKAGE' variables in the init file. |
25 | 1 | Arjen Pander | - Make 'routes' lower case. |
26 | 1 | Arjen Pander | - Move the routes and serversetup into a def main(). |
27 | 1 | Arjen Pander | - Add path = os.path.dirname(os.path.abspath(__file__)) at the top of your main function. |
28 | 1 | Arjen Pander | - Replace the serversetup line in your init file with " return uweb3.uWeb(pages.PageMaker, routes, executing_path=path)" |
29 | 1 | Arjen Pander | - Remove the 'static' routes from your router config as this is now built in. |
30 | 1 | Arjen Pander | - Replace all page file imports with "from . import <name>". |
31 | 1 | Arjen Pander | - Update all sqltalk imports to: from uweb3.ext_lib.underdark.libs.sqltalk import <module> |
32 | 1 | Arjen Pander | - Copy a serve.py and base.wsgi from https://github.com/stefvanhouten/uweb3_template |
33 | 1 | Arjen Pander | - Add a file like the following to /etc/apache2/sites-available: |
34 | 1 | Arjen Pander | |
35 | 1 | Arjen Pander | <pre><VirtualHost *:80> |
36 | 1 | Arjen Pander | ServerName none |
37 | 1 | Arjen Pander | WSGIScriptAlias / /var/www/project/base.wsgi |
38 | 1 | Arjen Pander | <Directory /var/www/project/base/> |
39 | 1 | Arjen Pander | Require all granted |
40 | 1 | Arjen Pander | </Directory> |
41 | 1 | Arjen Pander | </VirtualHost></pre> |