Some consistency improvements with URL overrides.
This commit is contained in:
parent
16bcc3c9f0
commit
fbe0eab01c
7 changed files with 50 additions and 17 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -26,6 +26,10 @@ __pycache__
|
||||||
*.restart
|
*.restart
|
||||||
*.db3
|
*.db3
|
||||||
|
|
||||||
|
# Installation-specific
|
||||||
|
game/settings.py
|
||||||
|
game/logs/*.log.*
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
|
|
||||||
|
|
@ -41,3 +45,6 @@ nosetests.xml
|
||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
.project
|
.project
|
||||||
.pydevproject
|
.pydevproject
|
||||||
|
|
||||||
|
# PyCharm config
|
||||||
|
.idea
|
||||||
|
|
|
||||||
1
game/gamesrc/web/examples/__init__.py
Normal file
1
game/gamesrc/web/examples/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
__author__ = 'kelketek'
|
||||||
28
game/gamesrc/web/examples/urls.py
Normal file
28
game/gamesrc/web/examples/urls.py
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
from django.conf.urls import url, include
|
||||||
|
|
||||||
|
from src.web.urls import urlpatterns
|
||||||
|
|
||||||
|
#
|
||||||
|
# File that determines what each URL points to. This uses _Python_ regular
|
||||||
|
# expressions, not Perl's.
|
||||||
|
#
|
||||||
|
# See:
|
||||||
|
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
|
||||||
|
#
|
||||||
|
|
||||||
|
# Copy this file into your web directory in gamesrc, and add this line to settings.py:
|
||||||
|
# ROOT_URLCONF = 'game.gamesrc.web.urls'
|
||||||
|
|
||||||
|
# Add your own URL patterns to the patterns variable below, and then change
|
||||||
|
#
|
||||||
|
# These are Django URL patterns, so you should look up how to use these at
|
||||||
|
# https://docs.djangoproject.com/en/1.6/topics/http/urls/
|
||||||
|
|
||||||
|
# Follow the full Django tutorial to learn how to create web views for Evennia.
|
||||||
|
# https://docs.djangoproject.com/en/1.6/intro/tutorial01/
|
||||||
|
|
||||||
|
patterns = [
|
||||||
|
# url(r'/desired/url/', view, name='example'),
|
||||||
|
]
|
||||||
|
|
||||||
|
urlpatterns = patterns + urlpatterns
|
||||||
5
game/gamesrc/web/static_overrides/README.md
Normal file
5
game/gamesrc/web/static_overrides/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
If you want to override one of the static files (such as a CSS or JS file) used by Evennia or a Django app installed in your Evennia project, copy it into this folder, and it will be placed in the static folder when you run:
|
||||||
|
|
||||||
|
python manage.py collectstatic
|
||||||
|
|
||||||
|
Do note you may have to reproduce any preceeding directory structures for the file to end up in the right place.
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
from src.web.urls import urlpatterns
|
|
||||||
#
|
|
||||||
# File that determines what each URL points to. This uses _Python_ regular
|
|
||||||
# expressions, not Perl's.
|
|
||||||
#
|
|
||||||
# See:
|
|
||||||
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
|
|
||||||
#
|
|
||||||
|
|
||||||
# You can add URLs to your game's website by extending urlpatterns.
|
|
||||||
#
|
|
||||||
# These are Django URL patterns, so you should look up how to use these at
|
|
||||||
# https://docs.djangoproject.com/en/1.6/topics/http/urls/
|
|
||||||
|
|
@ -479,8 +479,8 @@ LOCALE_PATHS = ["../locale/"]
|
||||||
# development webserver (normally Evennia runs its own server)
|
# development webserver (normally Evennia runs its own server)
|
||||||
SERVE_MEDIA = False
|
SERVE_MEDIA = False
|
||||||
# The master urlconf file that contains all of the sub-branches to the
|
# The master urlconf file that contains all of the sub-branches to the
|
||||||
# applications.
|
# applications. Change this to add your own URLs to the website.
|
||||||
ROOT_URLCONF = 'game.gamesrc.web.urls'
|
ROOT_URLCONF = 'src.web.urls'
|
||||||
# Where users are redirected after logging in via contrib.auth.login.
|
# Where users are redirected after logging in via contrib.auth.login.
|
||||||
LOGIN_REDIRECT_URL = '/'
|
LOGIN_REDIRECT_URL = '/'
|
||||||
# Where to redirect users when using the @login_required decorator.
|
# Where to redirect users when using the @login_required decorator.
|
||||||
|
|
@ -497,14 +497,19 @@ STATIC_URL = '/static/'
|
||||||
|
|
||||||
STATIC_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "static")
|
STATIC_ROOT = os.path.join(GAME_DIR, "gamesrc", "web", "static")
|
||||||
|
|
||||||
# Folders from which static files will be gathered from.
|
# Directories from which static files will be gathered from.
|
||||||
STATICFILES_DIRS = (
|
STATICFILES_DIRS = (
|
||||||
|
os.path.join(GAME_DIR, "gamesrc", "web", "static_overrides"),
|
||||||
os.path.join(SRC_DIR, "web", "static"),)
|
os.path.join(SRC_DIR, "web", "static"),)
|
||||||
|
# Patterns of files in the static directories. Used here to make sure that
|
||||||
|
# its readme file is preserved but unused.
|
||||||
|
STATICFILES_IGNORE_PATTERNS = ('README.md',)
|
||||||
# The name of the currently selected web template. This corresponds to the
|
# The name of the currently selected web template. This corresponds to the
|
||||||
# directory names shown in the webtemplates directory.
|
# directory names shown in the webtemplates directory.
|
||||||
ACTIVE_TEMPLATE = 'prosimii'
|
ACTIVE_TEMPLATE = 'prosimii'
|
||||||
# We setup the location of the website template as well as the admin site.
|
# We setup the location of the website template as well as the admin site.
|
||||||
TEMPLATE_DIRS = (
|
TEMPLATE_DIRS = (
|
||||||
|
os.path.join(GAME_DIR, "gamesrc", "web", "templates"),
|
||||||
os.path.join(SRC_DIR, "web", "templates", ACTIVE_TEMPLATE),
|
os.path.join(SRC_DIR, "web", "templates", ACTIVE_TEMPLATE),
|
||||||
os.path.join(SRC_DIR, "web", "templates"),)
|
os.path.join(SRC_DIR, "web", "templates"),)
|
||||||
# List of callables that know how to import templates from various sources.
|
# List of callables that know how to import templates from various sources.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
|
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.conf.urls import *
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.conf.urls import url, include
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.views.generic import RedirectView
|
from django.views.generic import RedirectView
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue