mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 15:37:17 +02:00
Correct tutorials on evennia startapp use, which seems to have changed with time. Resolve #3287
This commit is contained in:
parent
b4a3bae6a9
commit
8872e00001
3 changed files with 29 additions and 16 deletions
|
|
@ -5,12 +5,18 @@
|
|||
|
||||
In this tutorial we will create a web page that displays the stats of a game character. For this, and all other pages we want to make specific to our game, we'll need to create our own Django "app". We'll call our app `character`, since it will be dealing with character information. From your game dir, run
|
||||
|
||||
cd web
|
||||
evennia startapp character
|
||||
|
||||
This will create a new directory named `character` inside `mygame/web/`. We put it in `web/` to keep things tidy, but you could place it wherever you like. It contains all basic files that a Django app needs.
|
||||
This will create a new directory named `character` inside `mygame`. To keep
|
||||
things tidy, let's move it into the `web/` subdirectory.
|
||||
|
||||
Note that we will not edit all files in this new directory, many of the generated files are outside the scope of this tutorial.
|
||||
mv character web (linux/mac)
|
||||
move character web (windows)
|
||||
|
||||
We put it in `web/` to keep things tidy, but you could place it wherever you
|
||||
like. It contains all basic files that a Django app needs.
|
||||
|
||||
Note that we will not edit all files in this new directory, many of the generated files are outside the scope of this tutorial.
|
||||
|
||||
In order for Django to find our new web app, we'll need to add it to the `INSTALLED_APPS` setting. Evennia's default installed apps are already set, so in `server/conf/settings.py`, we'll just extend them:
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,18 @@ The first step is to create our new Django *app*. An app in Django can contain
|
|||
|
||||
From your game directory, use the following commands:
|
||||
|
||||
cd web
|
||||
cd web
|
||||
evennia startapp help_system
|
||||
|
||||
This creates a new folder `help_system` in your `mygame/` folder. To keep things
|
||||
tidy, let's move it to the `web/` folder:
|
||||
|
||||
mv help_system web (linux)
|
||||
move help_system web (windows)
|
||||
|
||||
> Note: calling the app "help" would have been more explicit, but this name is already used by Django.
|
||||
|
||||
This will create a directory named `help_system` under `mygame/web/`. We put it there to keep all web-related things together, but you can organize however you like. Here's how the structure looks:
|
||||
We put the new app under `web/`t o keep all web-related things together, but you can organize however you like. Here's how the structure looks:
|
||||
|
||||
mygame/
|
||||
...
|
||||
|
|
@ -211,7 +217,7 @@ But what if the user's not logged in? Again, we have different solutions. One
|
|||
The system should answer:
|
||||
|
||||
Created new character anonymous. Use @ic anonymous to enter the game as this character.
|
||||
|
||||
|
||||
So in our view, we could have something like this:
|
||||
|
||||
```python
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue