Re: file URL missing project name

2018-11-21 Thread Jeff Williams
I *had* added the above, but I put them in the 'lower down' URLS.PY file. As soon as I added them to the higher-level one everything worked! Thanks Roham! Thanks Akash! I really appreciate your time and help here. Jeff ‪On Wed, Nov 21, 2018 at 8:38 AM ‫رهام صادقی‬‎ wrote:‬ > Hi, > add t

Re: file URL missing project name

2018-11-21 Thread رهام صادقی
Hi, add these two lines to your settings.py file MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') after that in your base urls.py (a file along with settings.py) add the following url: from django.conf.urls.static import static from django.conf import settings if settings.DEBU

Re: file URL missing project name

2018-11-20 Thread Jeff Williams
Hey Akash, I did figure out the enctype="multipart/form-data" issue (I had that for a while but figured it out). My files are loading.they just aren't displaying. I just loaded an image using the Admin interface as you suggested (I hadn't thought of trying that) and the load is working. The

Re: file URL missing project name

2018-11-20 Thread Akash Purandare
Hey Jeff It is completely alright to try until we find a solution to this. I quote from the Django Documentation: Note that request.FILES will only contain data if the request method was POST and the th

Re: file URL missing project name

2018-11-19 Thread Jeff Williams
Hey Akash, Appreciate you still thinking about this. I've tried moving my Media folder to copy a working project (still no luck). Here is the file: http://127.0.0.1:8000/media/documents/dsBuffer_rQWWvO9.jpg This is the media folder: D:\DjangoStuff\familyrecipies\media\documents My current gues

Re: file URL missing project name

2018-11-19 Thread Akash Purandare
Hey Jeff Can you send me the URL of the file and the Location of the uploaded media file? Regards Akash Purandare On Sunday, November 18, 2018 at 8:48:04 PM UTC+5:30, Jeff Williams wrote: > > Hi All, > I'm new to django, so sorry if this is a newbie issue. > > I've managed to upload an ImageFie

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
That part is added by urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)so I doubt that is the issue. This is going to sound odd.but I've had some files display and then stop working when I don't think I changed anything. very odd. On Sun, Nov 18, 2018 at 6:46 PM J

Re: file URL missing project name

2018-11-18 Thread Jason
(?P.*) in your url is probably the reason why. remove that bit -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To po

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
MEDIA_ROOT and MEDIA_URL both seem fine.and the URL I'm getting in the template looks fine...but URLS.PY is kicking it out. I changed the security on the directory to full access to everyone. Any ideas on how to debug this? I can't see why the path isn't matching the pattern. Page not f

Re: file URL missing project name

2018-11-18 Thread Jason
Seems like there might be some confusion on what exactly `MEDIA_ROOT` means. you can do import logging logger = logging.getLogger(__name__) logger.info(MEDIA_ROOT) in settings after declaring MEDIA_ROOT if that path lines up with what you have in the server, then I suspect permission issue mi

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
Akash, You are good.but I already changed that to get to the error I have now. Still not working :-( The file is in the right place but the URL matching is messing up somehow. On Sun, Nov 18, 2018 at 1:00 PM Akash Purandare wrote: > Hey Jeff > > I tried the models that you were creating an

Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hey Jeff I tried the models that you were creating and I found out the error that you are having is with the Model. The upload_to of the pic variable is set to 'media/', which uploads the file to the url http://localhost:8000/oldgrub/media/media/56288852088__208FCEF9-5890- 4633-8BF6-C5C9A82D87E

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
Nope. Same error. I can see the file being loaded. Doesn't like the URL still. On Sun, Nov 18, 2018 at 11:30 AM Akash Purandare wrote: > Hey Jeff > > I think that you might need to upload the file again and try. > > Let me know if it works out. > > Regards > Akash Purandare > > > On Sunday, N

Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hey Jeff I think that you might need to upload the file again and try. Let me know if it works out. Regards Akash Purandare On Sunday, November 18, 2018 at 9:56:13 PM UTC+5:30, Jeff Williams wrote: > > OK this is almost fixed: > > Why isn't this path matching? > > Page not found (404) > Request

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
OK this is almost fixed: Why isn't this path matching? Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG Using the URLconf defined in familyrecipies.urls, Django tried these URL patterns, in this order:

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
Thanks Akash. Haven't quite fixed it yet but this is definitely the right area. Jeff On Sun, Nov 18, 2018 at 10:52 AM Akash Purandare wrote: > Hi Jeff > > I believe that the URL that you want to show is completely irrelevant as > the Django's FileField does that for you. However, in case you rea

Re: file URL missing project name

2018-11-18 Thread Akash Purandare
Hi Jeff I believe that the URL that you want to show is completely irrelevant as the Django's FileField does that for you. However, in case you really want your project name to be included in your URL, you can change the MEDIA_URL in your settings.py to '/oldgrub/media' to reflect the necessary

Re: file URL missing project name

2018-11-18 Thread Jeff Williams
OK here are what I think are the relevant parts: settings.py STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR,'static'), # if your static files folder is named "staticfiles" ) # Redirect to home URL after login (Default redirects to /accounts/profile/) LOGIN_RED

Re: file URL missing project name

2018-11-18 Thread Joel Mathew
It's anybody's guess unless you post your code. Sincerely yours, Joel G Mathew On Sun, 18 Nov 2018 at 20:47, Jeff Williams wrote: > Hi All, > I'm new to django, so sorry if this is a newbie issue. > > I've managed to upload an ImageFieldbut when I try to display it in my > template using

file URL missing project name

2018-11-18 Thread Jeff Williams
Hi All, I'm new to django, so sorry if this is a newbie issue. I've managed to upload an ImageFieldbut when I try to display it in my template using object.pic.url...the URL I'm getting back is missing my project name from the URL and the pic is not loading. Specifically I'm getting http://12