Bailey Posted November 18, 2017 Posted November 18, 2017 Hello, Does anyone know why http://django.area51.bailey.cf/projects/ won't work? I've tried for ages but still not working! Thanks in advance,Bailey Quote
Krydos Posted November 18, 2017 Posted November 18, 2017 [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. Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 Can you direct me to a place where it teaches how to upload it to the website because I've found the one on the wiki very confusing and all I'm getting is a 500 error. Thank you.ps. This is the project created from the tutorial: https://area51.bailey.cf/hello/ or https://area51.bailey.cf/ Quote
Krydos Posted November 19, 2017 Posted November 19, 2017 Does this work better for you? https://www.helionet.org/index/topic/27585-django-on-tommy/?p=126077 Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 I've got it working at https://Bailey.cf/djangotest but can't get it to work on http://Bailey.cf , and suggestions? Quote
Krydos Posted November 19, 2017 Posted November 19, 2017 Https versus http shouldn't affect django in the slightest. Most likely you have conflicting .htaccess resulting in an infinite loop like I told you somewhere else on the forums. Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 (edited) No I don't mean SSL, I can't get it to work on the root directory of Bailey.cf. I want to view it at https://Bailey.cf/ instead of https://Bailey.cf/djangotest Sorry for the confusion --DONE-- I've fixed it, thank you for your help! Edited November 19, 2017 by Bailey Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 My static urls aren't working, any reason why? Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 https://bailey.cf/projects/ , the style.css won't load, it's easier to use "inspect" to see that it won't load.It works offline Quote
Krydos Posted November 19, 2017 Posted November 19, 2017 Did you add the projects directory to the .htaccess file to prevent it from processing it through dispatch.wsgi? Quote
Krydos Posted November 19, 2017 Posted November 19, 2017 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. Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 Oh yeah, I know about Rewrite and the flags but I dont have an actual static directory. I used the Django tutorial to create the polls but I named it projects Quote
Bailey Posted November 19, 2017 Author Posted November 19, 2017 "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_ROOTsetting 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 collectstaticThis 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 uploadedhttps://bailey.cf/admin/login/?next=/admin/https://bailey.cf/projects/ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.