Jump to content

Django Help


Bailey

Recommended Posts


[Sat Nov 18 15:41:29.007142 2017] [core:error] [pid 16181:tid 139824572905216] [client x.x.x.x:58347] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://django.area51.bailey.cf/projects/
That probably means you have conflicting .htaccess bouncing you back and forth.
Link to comment
Share on other sites

The django wiki page http://wiki.helionet.org/Django has an example of two static resources directories: media and admin_media.

RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(hello/dispatch\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ hello/hello/dispatch.wsgi/$1 [QSA,PT,L]
The [L] means last so when that rule is matched it stop going down the line. Since it stops before it forces everything to be processed through dispatch.wsgi it is served statically. Likewise if your request already has dispatch.wsgi in it it doesn't tack another dispatch.wsgi on there. Finally everything else is forced to go through dispatch.wsgi. To add another static directory just copy the media or admin_media line and replace it with the name of your directory.
Link to comment
Share on other sites

"django.contrib.staticfiles" provides a convenience management command for gathering static files in a single directory so you can serve them easily.

Set the

STATIC_ROOT

setting to the directory from which you’d like to serve these files, for example:

STATIC_ROOT = "/var/www/example.com/static/"

Run the collectstatic management command:

$ python manage.py collectstatic

This will copy all files from your static folders into the STATIC_ROOT directory.

 

Had to do this to store static files and get them to work when they are uploaded



https://bailey.cf/admin/login/?next=/admin/

https://bailey.cf/projects/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...