The official Uruk project wiki script.

ahmadnourallah ba39d9f1ff Update readme file 2 years ago
wiki ec3a39ee7f Use 'get' to fetch list elements 2 years ago
.gitignore 42a42b40bd Add .gitignore file 2 years ago
LICENSE 544d805bc8 Intial commit 2 years ago ba39d9f1ff Update readme file 2 years ago
babel.cfg fc7f37be8c Intial work 2 years ago 71d69a5ccf Update config file 2 years ago fc7f37be8c Intial work 2 years ago
messages.pot d3ee3f916e Add 'Front Page' feature 2 years ago
requirements.txt fc7f37be8c Intial work 2 years ago

Uruk Wiki

The official Uruk project wiki script.

Project structure

Project uses blueprints to organize sections. Project's files organized using "functional structure". You can take a look at files structure from here:

File/Directory Description
website/ the app's package
website/static/ contains static files
website/static/css/ contains custom css files for the app
website/static/fonts/ contains used fonts in the app
website/static/images/ contains website's images (e.g favicon, errors pictures, website logo)
website/static/js/ contains javascript files
website/static/media/ contains multimedia files (e.g audio files)
website/static/vendors/ contains 3rd party dependencies
website/templates/ contains jinja2 templates
website/views/ contains views for website's blueprints
website/ the application constructor
website/ contains app's models
website/ contains shared functions between blueprints
LICENSE the project's license (GPL 3) this file
babel.cfg contains pybabel extractor configurations the app's configuration variables the app's runner
messages.pot contains the text in app which must localized
requirements.txt the project's requirements



  • Python 3.6
  • PyPi
  • Flask
  • Flask-Babel
  • Flask-SQLAlchemy
  • Psutil
  • BeautifulSoup (bs4)

Installing requirements

You can install project requirements from requirements.txt file which attached with project files (in root the directory). Invoke this command to install the requirements with pip:

$ [sudo] python3.6 -m pip install -r requirements.txt

Configure project settings

Project must have two config files to run correctly. The first one must be in top-level directory with the name The file explained well using comments. You can take a look at it from here:

from os import urandom
from os.path import abspath, join, dirname
from flask_babel import gettext
from flask import url_for

LANGUAGES = { # Languages list (key must be the language and the value must be it's direction)
	gettext('English')  :'LTR',
	gettext('Arabic')   :'RTL'
PAGES = { # Pages in pages menu in website's navbar
	gettext('Bug tracker')	:'',
	gettext('Contribute')	:'',
	gettext('Dist')		:'',
	gettext('Home')		:'',
	gettext('Blog')		:'',
	gettext('Wiki')		:'/'

ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']) # Allowed images extensions
FAVICON = 'images/urukp.png'
FOOTER_MESSAGE = gettext('© 2017 Uruk GNU/Linux • Website Code distributed under the AGPLv3+ • Website media licensed under CC BY-SA 4.')
MAX_CONTENT_PATH = 16 * 1024 * 1024
SECRET_KEY = urandom(24) # The secret key (for signing sessions)
UPLOAD_FOLDER = join(dirname(abspath(__file__)), 'wiki/static/') # Upload folder
WEBSITE_LOGO = gettext('images/logo-e.png')
WEBSITE_NAME = gettext('Uruk Wiki')
WEBSITE_KEYWORDS = gettext('uruk, wiki, uruk wiki, uruk project, uruk linux, linux, URUK, URUK PROJECT') # Website Keywords (for SEO)
FRONT_PAGE = gettext('index') # Front Page url, set to False if none

Also, project must have a config file in instance directory. Create instance/ and fill it with the below template:

from hashlib import sha224

	'username'      :'USERNAME',
	'email'         :'ADMIN EMAIL',
	'password'      :sha224('ADMIN PASSWORD'.encode('utf-8')).hexdigest(),
	'fullname'      :'ADMIN FULLNAME',
	'privilege'     :'admin' # must be always admin

SQLALCHEMY_DATABASE_URI = '' # Database URI (Note: you must use sqlite3 database)

Running project

You can run the project using built-in flask development server by using file:

$ [sudo] python3.6

In production, you can use uwsgi with nginx server. see this tutorial for more information.