Project

General

Profile

UWeb2 to uWeb3 conversion » History » Version 1

Version 1/2 - Next » - Current version
Arjen Pander, 2020-05-05 16:26


Converting to uweb3 from uWeb

- Make a 'base' directory in your repository root directory.
- Move your pagemaker and config files, as well as router, static and templates directtories into this new base directory.
- Move your router file to the base directory and rename it to init.py
- Search and replace (case sensitive) in all python files all references of 'uweb' to 'uweb3'.
- Rename your config file to config.ini
- Change 'server' to 'host' in the mysql section of the config file.
- Add the following to the config file:

[routing]
disable_automatic_route_detection = False
default_routing = routes

- Replace the 'standalone' block with the following:

[development]
access_logging = True
error_logging = True
port = 8000
dev = True

- import os in the init file
- Remove the 'CONFIG' and 'PACKAGE' variables in the init file.
- Make 'routes' lower case.
- Move the routes and serversetup into a def main().
- Add path = os.path.dirname(os.path.abspath(file)) at the top of your main function.
- Replace the serversetup line in your init file with " return uweb3.uWeb(pages.PageMaker, routes, executing_path=path)"
- Remove the 'static' routes from your router config as this is now built in.
- Replace all page file imports with "from . import <name>".
- Update all sqltalk imports to: from uweb3.ext_lib.underdark.libs.sqltalk import <module>
- Copy a serve.py and base.wsgi from https://github.com/stefvanhouten/uweb3_template
- Add a file like the following to /etc/apache2/sites-available:

<VirtualHost *:80>
    ServerName none
    WSGIScriptAlias / /var/www/project/base.wsgi
    <Directory /var/www/project/base/>
        Require all granted
    </Directory>
</VirtualHost>