diff --git a/docs/source/Components/Webserver.md b/docs/source/Components/Webserver.md index c76b9447f3..8ffe70a031 100644 --- a/docs/source/Components/Webserver.md +++ b/docs/source/Components/Webserver.md @@ -1,3 +1,11 @@ # Webserver -TODO: There is no central docs for this component yet. \ No newline at end of file +When Evennia starts it also spins up its own Twisted-based web server. The webserver is responsible for serving the html pages of the game's website. It can also serve static resources like images and music. + +The webclient runs as part of the [Server](Portal-And-Server) process of Evennia. This means that it can directly access cached objects modified in-game, and there is no risk of working with objects that are temporarily out-of-sync in the database. + +The webserver runs on Twisted and is meant to be used in a production environment. It leverages the Django web framework and provides: + +- A [Game Website](Website) - this is what you see when you go to `localhost:4001`. The look of the website is meant to be customized to your game. Users logged into the website will be auto-logged into the game if they do so with the webclient since they share the same login credentials (there is no way to safely do auto-login with telnet clients). +- The [Web Admin](Web-Admin) is based on the Django web admin and allows you to edit the game database in a graphical interface. +- The [Webclient](Webclient) page is served by the webserver, but the actual game communication (sending/receiving data) is done by the javascript client on the page opening a websocket connection directly to Evennia's Portal. \ No newline at end of file diff --git a/docs/source/Components/Website.md b/docs/source/Components/Website.md new file mode 100644 index 0000000000..60f0dc04b8 --- /dev/null +++ b/docs/source/Components/Website.md @@ -0,0 +1,7 @@ +# Game Website + +When Evennia starts it will also start a [Webserver](Webserver) as part of the [Server](Portal-And-Server) process. This uses Django to serve a simple but functional default game website. + +With the default setup, open your browser to `localhost:4001` or `127.0.0.1:4001` to see it. + +The default website allows you to \ No newline at end of file diff --git a/evennia/web/admin/urls.py b/evennia/web/admin/urls.py index 44d5dfbf76..7f47602a91 100644 --- a/evennia/web/admin/urls.py +++ b/evennia/web/admin/urls.py @@ -13,9 +13,9 @@ from . import frontpage urlpatterns = [ # Django original admin page. Make this URL is always available, whether # we've chosen to use Evennia's custom admin or not. - url(r"/django/", frontpage.admin_wrapper, name="django_admin"), + url(r"django/", frontpage.admin_wrapper, name="django_admin"), # Admin docs - url(r"/doc/", include("django.contrib.admindocs.urls")), + url(r"doc/", include("django.contrib.admindocs.urls")), ] if settings.EVENNIA_ADMIN: @@ -24,7 +24,7 @@ if settings.EVENNIA_ADMIN: # Our override for the admin. url("^$", frontpage.evennia_admin, name="evennia_admin"), # Makes sure that other admin pages get loaded. - url(r"^/", admin.site.urls), + url(r"^", admin.site.urls), ] else: # Just include the normal Django admin. diff --git a/evennia/web/urls.py b/evennia/web/urls.py index 30617b6066..b9d17f4df6 100644 --- a/evennia/web/urls.py +++ b/evennia/web/urls.py @@ -31,7 +31,7 @@ urlpatterns = [ # webclient path("webclient/", include("evennia.web.webclient.urls")), # admin - path("admin", include("evennia.web.admin.urls")), + path("admin/", include("evennia.web.admin.urls")), # favicon path("favicon.ico", RedirectView.as_view(url="/media/images/favicon.ico", permanent=False)), ]