Set up your environment (old way)
We now have documentation on using the
There are some open tickets (31, 11) about getting the websites repository building on Fedora with Python 3.
However, it should be able to be built on Fedora 30, using Python 2 packages, for now.
Fedora 29 Alternative
Note, the dependencies below may not currently resolve due to package renaming in Fedora 30.
If the dependencies do not resolve in Fedora 30, running Flask from a Fedora 29 container is an alternative.
An example to run the Fedora 29 container using
podman is as follows:
# Expose the default port for Flask, 5000. podman run --expose 5000 --net=host --privileged -v /path/to/websites/repo:/path/to/websites/repo -ti registry.fedoraproject.org/fedora:29
That said, assuming Fedora 30, install the following dependencies. Note this list comes directly from the Fedora Infrastructure OpenShift build for Websites found here:
dnf install \ git \ python-flask \ python-frozen-flask \ python-flask-assets \ python-rjsmin \ python-cssmin \ python-flask-babel \ python-flask-htmlmin \ python-cssutils \ rubygem-sass \ babel \ python3-jinja2 \ python-pyyaml \ python-dateutil \ python-dogpile-cache \ python-requests \ python-zanata-client
Now we need to pull the current translations.
After installing the dependencies above, you can
sites/getfedora.org/ and run:
Once the dependencies are installed and translations are pulled, you can do one of two things:
Use the Development Server
One option is to use the Flask built-in development server. This is handy because it prevents you from needing to build the websites every time you change something. However, it bypasses the Frozen-Flask system which creates are static sites, entirely, so it’s not entirely an accurate representation of what goes live.
To use the development server:
export FLASK_APP=main.py flask run --reload
Now you many visit http://localhost:5000/ to get to the site.
Alternatively, you may simply run
You’ll get a statically built site in the
However, the HTML files are all language-code-suffixed as Apache/httpd MultiViews system expects (e.g.
As a result you cannot just run a simple HTTP server (like
python -m SimpleHTTPServer) in the
./build/ directory, unfortunately.
You can, however, set up an Apache on your system, and point it to the
We should probably add an example Apache config here at some point.
Want to help? Learn how to contribute to Fedora Docs ›