16 """Creates all default settings and saves them to the configuration file.
21 "dbhost":
"localhost",
22 "dbname":
"private/system/default.db",
27 "/system/normalize.css",
30 "/system/paferalib.css",
34 "/system/loader.min.js",
35 "/system/minified.min.js",
36 "/system/stacktrace.min.js",
37 "/system/hammer.min.js",
38 "/system/paferalib.js",
39 "/system/paferadbobj.js",
40 "/system/paferapage.js",
47 'sessiontimeout': 604800,
53 os.makedirs(
'private/system', exist_ok =
True)
55 with open(
'private/system/pafera.cfg',
'w')
as f:
56 f.write(json.dumps(g.siteconfig, sort_keys =
True, indent = 2))
60 """Setups the initial database users, groups, and pages.
64 if db.HasTable(
'system_user'):
67 db.RegisterModel(system_session)
71 phonenumber =
'admin',
73 displayname = {
'en':
'admin'}
75 u.SetPassword(
'password',
'pafera')
78 admins = system_group()
81 displayname = {
'en':
'Administrators'}
87 siteheader = system_pagefragment()
93 <div class=
"SiteHeader Flex FlexCenter white">
94 <div
class=
"SiteHeader Flex FlexCenter white">
96 <img src=
"/favicon.ico" style=
"height: 2em; float: left;">
97 <span style=
"display: block; padding: 0.3em; float: left;">Pafera</span>
99 <a href=
"/system/controlpanel.html">Control Panel</a>
100 <a href=
"/system/translations.html">Translations</a>
101 <a
class=
"LoginLink" href=
"/system/login.html">Login</a>
108 db.Insert(siteheader)
110 sitefooter = system_pagefragment()
112 path =
'site.footer',
116 <div class=
"SiteFooter Center white Pad50">
117 This site
is powered by the Pafera WSGI Framework available at <a href=
"https://pafera.com/pafera">pafera.com/pafera</a>.
124 db.Insert(sitefooter)
128 path =
'/system/index.html',
130 'en':
'Welcome to Pafera!',
134 <div class=
"Grid GridCenter MinHeight80P">
135 <div
class=
"Center Margin25">
136 <h1
class=
"Center">Welcome to Pafera!</h1>
138 <div
class=
"whiteb Rounded Raised MaxWidth2400 Pad100 Left">
139 If you can see this page, then your install was successful. Please head to the <a href=
"/system/controlpanel">control panel</a> to start configuring your site.
146 topbarid = siteheader.rid,
147 bottombarid = sitefooter.rid,
154 path =
'/system/controlpanel.html',
156 'en':
'Welcome to Your New Pafera Install',
160<div class="Pad50 white">
161 <h1>Welcome to Your New Pafera Install</h1>
164 If you are seeing this screen, then your installation of the Pafera Framework was successful. Let's configure your site and get you on your way.
168 Remember to set a new administrator password before doing anything else. The last thing that you want
is to have your website start leaking every username
and password to the whole world
and have a nasty pile of angry lawsuits sitting on your desk.
172 <div
class=
"ConfigTiles FlexGrid30 Gap50" ></div>
182 path =
'/system/db.html',
184 'en':
'Database Management',
188<div class="PageLoadContent"></div>
198 path =
'/system/translations.html',
200 'en':
'Translations',
206<div class="ButtonBar TranslationActions"></div>
208<div class=
"Translations"></div>
219 path =
'/system/apps.html',
227<div class="ButtonBar AppActions"></div>
229<div class=
"AppTiles"></div>
240 path =
'/system/login.html',
246 <div class=
"Grid GridCenter MinHeight80P">
247 <div
class=
"Center Margin25">
248 <h1
class=
"Center">{g.T.login}</h1>
250 <div
class=
"LoginForm whiteb Rounded Raised MaxWidth2400 Left"></div>
256 topbarid = siteheader.rid,
257 bottombarid = sitefooter.rid,
264 path =
'/system/logout.html',
270 <div class=
"Grid GridCenter MinHeight80P">
271 <div
class=
"Center Margin25">
272 <h1
class=
"Center">{g.T.logout}</h1>
274 <div
class=
"whiteb Rounded Raised Pad100 MaxWidth2400 Left">{g.T.loggedout}</div>
279 contentfunc = "g.session.New(g)",
280 topbarid = siteheader.rid,
281 bottombarid = sitefooter.rid,
290 'en': g.T.nothingfound,
294 <div class=
"Grid GridCenter MinHeight80P">
295 <div
class=
"Center Margin25">
296 <h1>We couldn
't find your page.</h1>
297 <p>Please check your URL and try again.</p>
303 topbarid = siteheader.rid,
304 bottombarid = sitefooter.rid,
def InitConfig(g)
Creates all default settings and saves them to the configuration file.
def InitDB(g)
Setups the initial database users, groups, and pages.