| Django - Static Files |
| Vendor | Django Software Foundation |
| Platform | Django |
| Version | 1.3.1 |
| WebDevelopment - Django |
| Friday, 01 June 2012 00:00 |
|
Static Files is a Django app that helps with serving static content. This tutorial is meant as a short and quick guide on how to configure your Django project to serve static based content. settings.pyFirst of all the following settings are added to the settings of your Django project. STATIC_ROOT = '/opt/django/myproject/static/' Apache ConfigurationWithin the Apache configuration the Alias directive is defined. <VirtualHost *:80> Collect FilesIn order to copy all of your static content to your STATIC_ROOT the following command is used. python manage.py collectstatic Note : The urls that your static files are collected from are defined via the STATICFILES_DIRS setting (from within settings.py). NoteId you have no requirement to collect your static files from the paths defined within STATICFILES_DIRS then,
A good reference on this can be found here. |
Latest Articles
- How to configure a Cisco ASA Site to Site VPN between Static and Dynamic IP based Peers ?
- Django - How do I create a custom login page ?
- How do I connect to a serial device using a USB-to-Serial Convertor in Linux ?
- Incapsula (Review) - How to Protect and Secure your website in 10 minutes
- Window doesn't show when using Cisco VPN Client 5.x / Windows 7
- How to Fix Unreadable Directory Listings within Shell
- Python - List Comprehensions
- Python - What does 'if __name__ == "__main__"' mean ?
- Python - Decorators
- BIGIP F5 LTM - Action on Service Down
- Brocade ADX - How do I bind multiple ports to a single healthcheck ?
- MySQL - How to reset a forgotten Root password
- Django - How can I pass a string from a URL to a view ?
- Vyatta - Unable to log into GUI : "Username or password is incorrect"
- Cisco ASA - How do VPN Filters work ?
- How do I use AJAX along side Django ?
- Outlook 2010 - The 'Delete Conversation' Shortcut
- How do I import a python module from another folder ?
- How do I configure Django to serve my Robots.txt file ?
- Brocade ADX - The Dynamic Weighted Predictor
Popular
- Proxy ARP – SPLAT
- Check Point Commands
- IPSO - Commands
- ASA 8.3 - Auto NAT Examples
- vSphere - Creating User and Group Permissions
- How to set the Time / Date and Timezone in CentOS
- Configuring Windows 2008 R2 as an NTP Server
- Juniper Netscreen Commands
- Configuring Wireless Connectivity within Backtrack 4 r2
- PEMU - Free Cisco PIX Firewall Emulator / Simulator
- Juniper Netscreen - NAT Explained
- How do I install snmpwalk / snmpget using Yum ?
- Troubleshooting a Netscreen Site 2 Site VPN
- Netscreen - NSRP
- Check Point Logging Troubleshooting Guide
- How do I configure IPv6 in Windows XP ?
- Check Point - How to Reset SIC
- VI shows the error Terminal too wide within Solaris
- Endpoint Connect Installation / Troubleshooting Guide
- ESX Convertor - The session is not authenticated


