Merge lp:~widelands-dev/widelands-website/widelands_trunk_binaries into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 455
Proposed branch: lp:~widelands-dev/widelands-website/widelands_trunk_binaries
Merge into: lp:widelands-website
Diff against target: 150 lines (+46/-14)
3 files modified
README.txt (+36/-13)
local_settings.py.sample (+5/-0)
wlmaps/forms.py (+5/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/widelands_trunk_binaries
Reviewer Review Type Date Requested Status
SirVer Approve
GunChleoc Approve
Review via email: mp+319233@code.launchpad.net

Commit message

Change the PATH variable to include widelands/trunk.

Description of the change

In conjunction with

https://code.launchpad.net/~widelands-dev/widelands/move_website_binaries/+merge/319231

this branch makes it possible to upload a map on the local website.

To post a comment you must log in.
454. By kaputtnik

adjusted the README.txt; fixed a typo

455. By kaputtnik

merged with trunk

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM - 2 tiny nits.

review: Approve
Revision history for this message
SirVer (sirver) :
review: Approve
456. By kaputtnik

wording

Revision history for this message
kaputtnik (franku) wrote :

Thanks for proofreading and approval.

Merged and deployed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.txt'
2--- README.txt 2017-01-21 13:01:18 +0000
3+++ README.txt 2017-04-11 05:32:47 +0000
4@@ -58,10 +58,10 @@
5 This will take a while. If no errors are shown we should be fine.
6
7 Setting up the website
8-----------------------
9+======================
10
11 Setting your local paths
12-^^^^^^^^^^^^^^^^^^^^^^^^
13+------------------------
14
15 Copy or symlink the two files settings_local.py.sample and
16 local_urls.py.sample to settings_local.py and local_urls.py. Take a look at
17@@ -72,7 +72,7 @@
18 $ ln -s local_settings.py.sample local_settings.py
19
20 Setting up the database
21-^^^^^^^^^^^^^^^^^^^^^^^
22+-----------------------
23
24 Now creating the tables in the database:
25
26@@ -90,7 +90,7 @@
27 resembles the widelands homepage quite closely. All content is missing though.
28
29 Some important settings
30-^^^^^^^^^^^^^^^^^^^^^^^
31+-----------------------
32
33 Go to http://localhost:8000/admin. Log in with your super user and go to the
34 following table:
35@@ -100,7 +100,7 @@
36 Now everything should work.
37
38 Accessing the website from other machines
39-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+-----------------------------------------
41
42 When starting the server as described above, the website will by default
43 only be available from the machine it is running on. If you wish to access
44@@ -113,8 +113,27 @@
45 See also https://docs.djangoproject.com/en/dev/ref/django-admin/#examples-of-using-different-ports-and-addresses
46 for further details.
47
48+Dependencies between website and widelands source code
49+======================================================
50+
51+Some parts of the website need access to the source code of widelands:
52+
53+* Online help/Encyclopedia
54+* Possibility to upload a map onto the local website
55+* Source code documentation
56+
57+You will need the widelands source code for this, see
58+
59+https://wl.widelands.org/wiki/BzrPrimer/
60+
61+After the source code is downloaded, adjust the path of
62+
63+WIDELANDS_SVN_DIR
64+
65+in local_settings.py to the path where the widelands source code is found.
66+
67 Setting up the online help / encyclopedia
68-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69+-----------------------------------------
70
71 You will need graphviz to generate the graphs for the online help. On Ubuntu run:
72
73@@ -129,13 +148,9 @@
74 $ ./manage.py update_help_pdf
75
76 Setting up widelands source code documentation
77-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78-
79-You will need the widelands source code for this, see
80-
81-https://wl.widelands.org/wiki/BzrPrimer/
82-
83-Change to the directory doc/sphinx/ of the source code and run
84+----------------------------------------------
85+
86+Change to the directory doc/sphinx/ of the widelands source code and run
87
88 $ ./extract_rst.py
89
90@@ -155,6 +170,14 @@
91
92 Open http://localhost:8000/docs/wl/ to test if everything is working.
93
94+Uploading a map to the local website
95+------------------------------------
96+
97+Compile the widelands binaries by using the compile.sh script
98+
99+ $ ./compile.sh
100+
101+Now you should be able to upload a map onto your local website.
102
103 Contact
104 =======
105
106=== modified file 'local_settings.py.sample'
107--- local_settings.py.sample 2017-01-21 19:22:57 +0000
108+++ local_settings.py.sample 2017-04-11 05:32:47 +0000
109@@ -5,7 +5,12 @@
110
111 STATIC_MEDIA_PATH = os.path.join(bd, 'media')
112 MEDIA_ROOT = os.path.join(bd, 'media/')
113+
114+# If you are using the developer version of widelands from Launchpad
115+# set WIDELANDS_SVN_DIR to the correct path. See also:
116+# https://wl.widelands.org/wiki/BzrPrimer/
117 WIDELANDS_SVN_DIR = "/path/to/widelands/trunk/"
118+os.environ['PATH'] = WIDELANDS_SVN_DIR + ':' + os.environ['PATH']
119
120 DATABASES = {
121 'default': {
122
123=== modified file 'wlmaps/forms.py'
124--- wlmaps/forms.py 2016-12-09 10:10:57 +0000
125+++ wlmaps/forms.py 2017-04-11 05:32:47 +0000
126@@ -10,7 +10,8 @@
127
128 from settings import MEDIA_ROOT
129 from wlmaps.models import Map
130-
131+import os
132+from settings import WIDELANDS_SVN_DIR
133
134 class UploadMapForm(ModelForm):
135 """
136@@ -55,11 +56,14 @@
137
138 try:
139 # call map info tool to generate minimap and json info file
140+ old_cwd = os.getcwd()
141+ os.chdir(WIDELANDS_SVN_DIR)
142 check_call(['wl_map_info', saved_file])
143
144 # TODO(shevonar): delete file because it will be saved again when
145 # the model is saved. File should not be saved twice
146 default_storage.delete(saved_file)
147+ os.chdir(old_cwd)
148 except CalledProcessError:
149 self._errors['file'] = self.error_class(
150 ['The map file could not be processed.'])

Subscribers

People subscribed via source and target branches