Ticket #300: django-autoinstaller-updates.2.patch
File django-autoinstaller-updates.2.patch, 1.9 KB (added by lfaraone, 11 years ago) |
---|
-
django
35 35 close FASTCGI; 36 36 chmod 0755, "index.fcgi"; 37 37 38 open README, ">README.txt"; 39 print README <<EOF; 40 This directory contains index.fcgi, a script that serves up your Django site. 41 42 To modify your Django project access the files in 43 /mit/$user/Scripts/django/$name 44 45 Files placed in this directory will be served directly to users without 46 being processed by Django. 47 48 Static files live in the "static" subdirectory; you should not add things 49 there directly but instead place them with the relevant application as you 50 normally would, then run "python manage.py collectstatic" from the above 51 directory, see <https://docs.djangoproject.com/en/1.5/howto/static-files/>. 52 53 -- Scripts Team 2013-06-27 54 EOF 55 close README; 56 chmod 0555, "README.txt"; 57 38 58 open HTACCESS, ">.htaccess"; 39 59 print HTACCESS <<EOF; 40 60 RewriteEngine On … … 72 92 next; 73 93 } elsif (/Chicago/) { 74 94 $_ =~ s/Chicago/New_York/; 75 } elsif (/^ADMIN_MEDIA_PREFIX/) { 76 $_ = "ADMIN_MEDIA_PREFIX = '/__scripts/django/media/'"; 95 } elsif (/^STATIC_URL/) { 96 $_ = "STATIC_URL = '//$USER.$server/$name/static/'"; 97 } elsif (/^STATIC_ROOT/) { 98 $_ = "STATIC_ROOT = '/mit/$USER/web_scripts/$name/static/'"; 77 99 } elsif (/^INSTALLED_APPS/) { 78 100 print NEWSETTINGS "$_\n"; 79 101 while (<SETTINGS>) { … … 98 120 $_ =~ s/^# *//; 99 121 } elsif (/^#.*admin.autodiscover/) { 100 122 $_ =~ s/^# *//; 101 } elsif (/^ *# *\(r\'\^admin\//) {123 } elsif (/^ *# url\(r\'\^admin\//) { 102 124 $_ =~ s/# *//; 103 125 } 104 126 print NEWURLS "$_\n"; … … 109 131 110 132 chdir ".."; 111 133 134 system(qw{python manage.py collectstatic --noinput}) == 0 or die "\nFailed to collect static files.\n\n"; 135 112 136 print "Initializing your project's SQL database schema...\n"; 113 137 system qw{./manage.py syncdb --noinput}; 114 138 print "...done\n";