mirror of
https://github.com/evennia/evennia.git
synced 2026-04-03 06:27:17 +02:00
Updated HTML docs
This commit is contained in:
parent
58f5ece91b
commit
1bbc93507a
1000 changed files with 39106 additions and 33861 deletions
|
|
@ -4,7 +4,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||||
|
||||
<title>Web Features — Evennia 1.0-dev documentation</title>
|
||||
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
|
|
@ -37,10 +38,10 @@
|
|||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<div class="section" id="web-features">
|
||||
<section id="web-features">
|
||||
<h1>Web Features<a class="headerlink" href="#web-features" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Evennia is its own webserver and hosts a default website and browser webclient.</p>
|
||||
<div class="section" id="web-site">
|
||||
<section id="web-site">
|
||||
<h2>Web site<a class="headerlink" href="#web-site" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The Evennia website is a Django application that ties in with the MUD database. Since the website
|
||||
shares this database you could, for example, tell website visitors how many accounts are logged into
|
||||
|
|
@ -64,7 +65,7 @@ Django documentation for details on how to use these components.</p>
|
|||
<a class="reference external" href="https://github.com/evennia/evennia/tree/master/evennia/web/website">evennia/web/website</a>. In this
|
||||
folder you’ll find the simple default view as well as subfolders <code class="docutils literal notranslate"><span class="pre">templates</span></code> and <code class="docutils literal notranslate"><span class="pre">static</span></code>. Static
|
||||
files are things like images, CSS files and Javascript.</p>
|
||||
<div class="section" id="customizing-the-website">
|
||||
<section id="customizing-the-website">
|
||||
<h3>Customizing the Website<a class="headerlink" href="#customizing-the-website" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You customize your website from your game directory. In the folder <code class="docutils literal notranslate"><span class="pre">web</span></code> you’ll find folders
|
||||
<code class="docutils literal notranslate"><span class="pre">static</span></code>, <code class="docutils literal notranslate"><span class="pre">templates</span></code>, <code class="docutils literal notranslate"><span class="pre">static_overrides</span></code> and <code class="docutils literal notranslate"><span class="pre">templates_overrides</span></code>. The first two of those are
|
||||
|
|
@ -75,8 +76,8 @@ change from the <code class="docutils literal notranslate"><span class="pre">web
|
|||
add/modify <code class="docutils literal notranslate"><span class="pre">mygame/web/template_overrides/website/index.html</span></code>.</p>
|
||||
<p>The detailed description on how to customize the website is best described in tutorial form. See the
|
||||
<a class="reference internal" href="../Howto/Starting/Part5/Web-Tutorial.html"><span class="doc">Web Tutorial</span></a> for more information.</p>
|
||||
</div>
|
||||
<div class="section" id="overloading-django-views">
|
||||
</section>
|
||||
<section id="overloading-django-views">
|
||||
<h3>Overloading Django views<a class="headerlink" href="#overloading-django-views" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The Python backend for every HTML page is called a <a class="reference external" href="https://docs.djangoproject.com/en/1.9/topics/http/views/">Django
|
||||
view</a>. A view can do all sorts of
|
||||
|
|
@ -89,22 +90,22 @@ field of your web browser to get to the page in question. If you put your own UR
|
|||
the default ones, your own view will be used instead. The file <code class="docutils literal notranslate"><span class="pre">urls.py</span></code> even marks where you should
|
||||
put your change.</p>
|
||||
<p>Here’s an example:</p>
|
||||
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="c1"># mygame/web/urls.py</span>
|
||||
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
||||
<span class="normal"> 2</span>
|
||||
<span class="normal"> 3</span>
|
||||
<span class="normal"> 4</span>
|
||||
<span class="normal"> 5</span>
|
||||
<span class="normal"> 6</span>
|
||||
<span class="normal"> 7</span>
|
||||
<span class="normal"> 8</span>
|
||||
<span class="normal"> 9</span>
|
||||
<span class="normal">10</span>
|
||||
<span class="normal">11</span>
|
||||
<span class="normal">12</span>
|
||||
<span class="normal">13</span>
|
||||
<span class="normal">14</span>
|
||||
<span class="normal">15</span>
|
||||
<span class="normal">16</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="c1"># mygame/web/urls.py</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">django.conf.urls</span> <span class="kn">import</span> <span class="n">url</span><span class="p">,</span> <span class="n">include</span>
|
||||
<span class="c1"># default patterns</span>
|
||||
|
|
@ -138,15 +139,15 @@ file to <code class="docutils literal notranslate"><span class="pre">mygame/web<
|
|||
<p>Restart the server and reload the page in the browser - the website will now use your custom view.
|
||||
If there are errors, consider turning on <code class="docutils literal notranslate"><span class="pre">settings.DEBUG</span></code> to see the full tracebacks - in debug mode
|
||||
you will also log all requests in <code class="docutils literal notranslate"><span class="pre">mygame/server/logs/http_requests.log</span></code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="web-client">
|
||||
</section>
|
||||
</section>
|
||||
<section id="web-client">
|
||||
<h2>Web client<a class="headerlink" href="#web-client" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Evennia comes with a MUD client accessible from a normal web browser. During
|
||||
development you can try it at <code class="docutils literal notranslate"><span class="pre">http://localhost:4001/webclient</span></code>.
|
||||
<a class="reference internal" href="../Components/Webclient.html"><span class="doc">See the Webclient page</span></a> for more details.</p>
|
||||
</div>
|
||||
<div class="section" id="the-django-admin-page">
|
||||
</section>
|
||||
<section id="the-django-admin-page">
|
||||
<h2>The Django ‘Admin’ Page<a class="headerlink" href="#the-django-admin-page" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Django comes with a built-in <a class="reference external" href="https://docs.djangoproject.com/en/1.10/ref/contrib/admin/">admin
|
||||
website</a>. This is accessible by clicking
|
||||
|
|
@ -160,8 +161,8 @@ to register a model that has already been registered.</p>
|
|||
<p>To overload Evennia’s admin files you don’t need to modify Evennia itself. To customize you can call
|
||||
<code class="docutils literal notranslate"><span class="pre">admin.site.unregister(model</span> <span class="pre">class)</span></code>, then follow that with <code class="docutils literal notranslate"><span class="pre">admin.site.register</span></code> in one of your own
|
||||
admin.py files in a new app that you add.</p>
|
||||
</div>
|
||||
<div class="section" id="more-reading">
|
||||
</section>
|
||||
<section id="more-reading">
|
||||
<h2>More reading<a class="headerlink" href="#more-reading" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Evennia relies on Django for its web features. For details on expanding your web experience, the
|
||||
<a class="reference external" href="https://docs.djangoproject.com/en">Django documentation</a> or the <a class="reference external" href="http://www.djangobook.com/en/2.0/index.html">Django
|
||||
|
|
@ -169,8 +170,8 @@ Book</a> are the main resources to look into. In Django
|
|||
lingo, the Evennia is a django “project” that consists of Django “applications”. For the sake of web
|
||||
implementation, the relevant django “applications” in default Evennia are <code class="docutils literal notranslate"><span class="pre">web/website</span></code> or
|
||||
<code class="docutils literal notranslate"><span class="pre">web/webclient</span></code>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
<div class="clearer"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue