Revision 25762387

b/snf-webproject/docs/index.rst
3 3
Component snf-webproject
4 4
========================
5 5

  
6
synnefo component :ref:`snf-webproject <snf-webproject>` defines
7
a Django project in which the various other synnefo components
6
synnefo component :ref:`snf-webproject <snf-webproject>` defines a Django 
7
project in which the various other synnefo components
8 8
(:ref:`snf-cyclades-app <snf-cyclades-app>`,
9 9
:ref:`snf-pithos-app <snf-pithos-app>`, etc.) may run.
10 10

  
......
229 229
You need to configure your webserver to serve static files and relay
230 230
requests to :ref:`snf-webproject <snf-webproject>`.
231 231

  
232

  
233
.. static_files::
232 234
Static files
233 235
````````````
234 236

  
......
288 290

  
289 291
    $ snf-manage link_static
290 292

  
291
.. todo:: perhaps include an ``snf-manage copy_static`` command?
292
* Configure your webserver to serve ``/static`` from the directory
293
  set in the ``MEDIA_ROOT`` setting.
294

  
295
.. todo:: Make the location of static files configurable. This has already
296
   been done for the UI, see ``UI_MEDIA_URL``.
297

  
298 293

  
299 294
Serving static files
300 295
^^^^^^^^^^^^^^^^^^^^
301 296

  
302 297
By default will serve the static files if ``DEBUG`` setting is set to True.
303
You can override this behaviour by using the ``WEBPROJECT_SERVE_STATIC`` 
304
setting.
298
You can override this behaviour by explicitly setting the 
299
``WEBPROJECT_SERVE_STATIC`` to True or False in your settings files.
305 300

  
306 301

  
307 302
Apache
......
338 333
    # apt-get install flup
339 334
    $ snf-manage runfcgi host=127.0.0.1 port=8015
340 335

  
336

  
341 337
For developers
342 338
--------------
343 339

  
344
.. todo:: kpap: describe the functions exported to Synnefo components for
345
   extending ``INSTALLED_APPS``, ``MIDDLEWARE_CLASSES`` and URL patterns.
340
Available entry points
341
^^^^^^^^^^^^^^^^^^^^^^
342

  
343
web_apps
344
````````
345
Extends INSTALLED_APPS django project setting.
346

  
347
Example::
348
    
349
    # myapp/synnefo_settings.py
350
    # synnefo_settings and variable name is arbitary
351
    my_app_web_apps = ['myapp', 'south', 'django.contrib.sessions']
352
    
353
    # another more complex configuration where we need our app to be placed
354
    # before django.contrib.admin app because it overrides some of the admin
355
    # templates used by admin app views
356
    my_app_web_apps = [{'before':'django.contrib.admin', 'insert':'myapp'}, 'south']
357

  
358
    # setup.py
359
    entry_points = {
360
        'synnefo': ['web_apps = myapp.synnefo_settings:my_app_web_apps']
361
    }
362

  
363

  
364
web_middleware
365
``````````````
366
Extends MIDDLEWARE_CLASSES django setting.
367

  
368

  
369
web_static
370
``````````
371
Extends STATIC_FILES setting (see `static_files`_).
372

  
373

  
374
web_context_processors
375
``````````````````````
376
Extends TEMPLATE_CONTEXT_PROCESSORS django setting.
377

  
378

  
379
loggers
380
```````
381
Extends `snf-common`_ LOGGING_SETUP['loggers'] setting.
382

  
383

  
384
urls
385
````
386
Extends django project urls. Accepts a urlpatterns variable. The urls defined
387
in this variable will be used to extend the django project urls.
346 388

  

Also available in: Unified diff