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 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.DEBUG:
> urlpatterns += static(settings.MEDIA_URL, 
> document_root=settings.MEDIA_ROOT)
>
> urlpatterns += static(settings.STATIC_URL, 
> document_root=settings.STATICFILES_DIRS)
>
>
> ‫‪Jeff Williams‬‏ <‪jeff99willi...@gmail.com‬‏> در تاریخ چهارشنبه ۲۱
> نوامبر ۲۰۱۸ ساعت ۴:۳۸ نوشت:‬
>
>> 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 URL and path
>> are still (relatively) the same:
>> http://127.0.0.1:8000/media/documents/reciper_rK1KS3j.jpg
>> D:\DjangoStuff\familyrecipies\media\documents\reciper_rK1KS3j.jpg
>>
>> Still getting this when I try to display.
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/media/documents/reciper_rK1KS3j.jpg
>>
>> Using the URLconf defined in familyrecipies.urls, Django tried these URL
>> patterns, in this order:
>>
>>1. admin/
>>2. oldgrub/
>>3.
>>4. accounts/
>>
>> The current path, media/documents/reciper_rK1KS3j.jpg, didn't match any
>> of these.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>> I think I mentioned before that I took another picture-upload project,
>> built it, and made it work (which it did).
>> When I took the relevant parts into my own appit stopped working :-(.
>>
>> On Tue, Nov 20, 2018 at 3:06 AM Akash Purandare 
>> wrote:
>>
>>> 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
>>> <https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpRequest.FILES>
>>>  will
>>> only contain data if the request method was POST and the  that
>>> posted the request has the attribute enctype="multipart/form-data".
>>> Otherwise, request.FILES will be empty.
>>>
>>> Can you ensure that the particular requirements are fulfilled?
>>>
>>> Also, I would like to ask you to try to upload a file from the Django
>>> admin panel and tell me if it is working. If not, can you send me the URL
>>> and the uploaded path of the Admin panel uploaded 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>  back.and
>>>> I need
>>>>
>>>> http://127.0.0.1:8000/*oldgrub*
>>>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>
>>>> back to have it work.
>>>>
>>>> What am I missing?  I've poured over my configs.
>>>> Jeff
>>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at 

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 URL and path are
still (relatively) the same:
http://127.0.0.1:8000/media/documents/reciper_rK1KS3j.jpg
D:\DjangoStuff\familyrecipies\media\documents\reciper_rK1KS3j.jpg

Still getting this when I try to display.
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/media/documents/reciper_rK1KS3j.jpg

Using the URLconf defined in familyrecipies.urls, Django tried these URL
patterns, in this order:

   1. admin/
   2. oldgrub/
   3.
   4. accounts/

The current path, media/documents/reciper_rK1KS3j.jpg, didn't match any of
these.

You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard 404
page.

I think I mentioned before that I took another picture-upload project,
built it, and made it work (which it did).
When I took the relevant parts into my own appit stopped working :-(.

On Tue, Nov 20, 2018 at 3:06 AM Akash Purandare 
wrote:

> 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
> <https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpRequest.FILES>
>  will
> only contain data if the request method was POST and the  that
> posted the request has the attribute enctype="multipart/form-data".
> Otherwise, request.FILES will be empty.
>
> Can you ensure that the particular requirements are fulfilled?
>
> Also, I would like to ask you to try to upload a file from the Django
> admin panel and tell me if it is working. If not, can you send me the URL
> and the uploaded path of the Admin panel uploaded 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>  back.and
>> I need
>>
>> http://127.0.0.1:8000/*oldgrub*
>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>
>> back to have it work.
>>
>> What am I missing?  I've poured over my configs.
>> Jeff
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7a1672c8-0f53-41f3-88c0-e3d7a70e7ae3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7a1672c8-0f53-41f3-88c0-e3d7a70e7ae3%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCdBfiKTUS38XtwsmZ1ETp6cJ04G8CyiFPne6rOfbc2oog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 guess is that I have something wrong in my HTML that is somehow
causing an errorI think I've noticed that Dango gives a 404 error if it
sees an HTML error (?).

I copied a small working file-upload example and it worked.  I can't see
any difference between the example and my code.
Jeff


On Mon, Nov 19, 2018 at 8:16 PM Akash Purandare 
wrote:

> 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>  back.and
>> I need
>>
>> http://127.0.0.1:8000/*oldgrub*
>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>
>> back to have it work.
>>
>> What am I missing?  I've poured over my configs.
>> Jeff
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5c9ebd72-bb98-49b8-81eb-dd9da3e7796e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5c9ebd72-bb98-49b8-81eb-dd9da3e7796e%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCf4EjsNO68Dq%3DZnoxMiec%2BZ0CS9BJRK3q4Xs8hgkrZoFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 Jason  wrote:

> (?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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/92369a7c-6d1b-4b6a-a38d-38151bb10772%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCcPgGc3SPLOMmhJXfFZiJ-N%3DVzBrfZV463r2Ljtu2TvNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 found (404)
Request Method: GET
Request URL:
http://127.0.0.1:8000/oldgrub/media/56288593216__746F513A-D6F6-446D-949F-D0C09E7C4419_sU3W0z5.JPG

Using the URLconf defined in familyrecipies.urls, Django tried these URL
patterns, in this order:

   1. admin/
   2. oldgrub/ [name='index']
   3. oldgrub/ cookbooks/ [name='cookbooks']
   4. oldgrub/ cookbook/ [name='cookbook']
   5. oldgrub/ recipe/ [name='recipes']
   6. oldgrub/ recipe/ [name='recipe']
   7. oldgrub/ family/ [name='family']
   8. oldgrub/ recipe/add/ [name='addrecipe']
   9. oldgrub/ ^static/(?P.*)$
   10. oldgrub/ ^oldgrub/media/(?P.*)$
   11.
   12. accounts/

The current path,
oldgrub/media/56288593216__746F513A-D6F6-446D-949F-D0C09E7C4419_sU3W0z5.JPG,
didn't match any of these.


On Sun, Nov 18, 2018 at 5:24 PM Jason  wrote:

> 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 might be at play as well.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/070f631f-d327-47c7-b283-b3bec62b44a6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCfyA7A8rZL4Phs20X6MFumRBP7XmgaaEF3_heCj%2B4wb_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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-C5C9A82D87EE.JPG. So if you change the upload_to to '', the URL
> will be http://localhost:8000/oldgrub/media/56288852088__208FCEF9-5890-
> 4633-8BF6-C5C9A82D87EE.JPG.
>
> Hope this fixes the issue that you are facing.
>
> Regards
> Akash Purandare
>
> On Sunday, November 18, 2018 at 10:57:31 PM UTC+5:30, Jeff Williams wrote:
>
>> 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, 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 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:
>>>>
>>>>1. admin/
>>>>2. oldgrub/ [name='index']
>>>>3. oldgrub/ cookbooks/ [name='cookbooks']
>>>>4. oldgrub/ cookbook/ [name='cookbook']
>>>>5. oldgrub/ recipe/ [name='recipes']
>>>>6. oldgrub/ recipe/ [name='recipe']
>>>>7. oldgrub/ family/ [name='family']
>>>>8. oldgrub/ recipe/add/ [name='addrecipe']
>>>>9. oldgrub/ ^oldgrub/media/(?P.*)$
>>>>10.
>>>>11. accounts/
>>>>
>>>> The current path,
>>>> oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG,
>>>> didn't match any of these.
>>>>
>>>> On Sun, Nov 18, 2018 at 11:08 AM Jeff Williams 
>>>> wrote:
>>>>
>>> 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 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
>>>>>> changes for you.
>>>>>>
>>>>>> Also, I believe that the problem you are facing is because you want
>>>>>> to serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence,
>>>>>> you must add this URL pattern at the end of your urls.py file of your 
>>>>>> main
>>>>>> project folder.
>>>>>>
>>>>>> from django.conf import settings
>>>>>> from django.conf.urls.static import static
>>>>>> urlpatterns = [
>>>>>> ...(Your Urls)
>>>>>> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>>>>>>
>>>>>> 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 ImageFieldbut when I try to display it
>>>>>>> in my template using object.pic.url...the URL I'm getting back is 
>>>>>>> missing
>>>&

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, 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 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:
>>
>>1. admin/
>>2. oldgrub/ [name='index']
>>3. oldgrub/ cookbooks/ [name='cookbooks']
>>4. oldgrub/ cookbook/ [name='cookbook']
>>5. oldgrub/ recipe/ [name='recipes']
>>6. oldgrub/ recipe/ [name='recipe']
>>7. oldgrub/ family/ [name='family']
>>8. oldgrub/ recipe/add/ [name='addrecipe']
>>9. oldgrub/ ^oldgrub/media/(?P.*)$
>>10.
>>11. accounts/
>>
>> The current path,
>> oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG,
>> didn't match any of these.
>>
>> On Sun, Nov 18, 2018 at 11:08 AM Jeff Williams 
>> wrote:
>>
> 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 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
>>>> changes for you.
>>>>
>>>> Also, I believe that the problem you are facing is because you want to
>>>> serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you
>>>> must add this URL pattern at the end of your urls.py file of your main
>>>> project folder.
>>>>
>>>> from django.conf import settings
>>>> from django.conf.urls.static import static
>>>> urlpatterns = [
>>>> ...(Your Urls)
>>>> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>>>>
>>>> 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>>  back.and
>>>>> I need
>>>>>
>>>>> http://127.0.0.1:8000/*oldgrub*
>>>>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>>>
>>>>> back to have it work.
>>>>>
>>>>> What am I missing?  I've poured over my configs.
>>>>> Jeff
>>>>>
>>>> --
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>>
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
> You received this message becau

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:

   1. admin/
   2. oldgrub/ [name='index']
   3. oldgrub/ cookbooks/ [name='cookbooks']
   4. oldgrub/ cookbook/ [name='cookbook']
   5. oldgrub/ recipe/ [name='recipes']
   6. oldgrub/ recipe/ [name='recipe']
   7. oldgrub/ family/ [name='family']
   8. oldgrub/ recipe/add/ [name='addrecipe']
   9. oldgrub/ ^oldgrub/media/(?P.*)$
   10.
   11. accounts/

The current path,
oldgrub/media/56288852088__208FCEF9-5890-4633-8BF6-C5C9A82D87EE.JPG, didn't
match any of these.

On Sun, Nov 18, 2018 at 11:08 AM Jeff Williams 
wrote:

> 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 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 changes
>> for you.
>>
>> Also, I believe that the problem you are facing is because you want to
>> serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you
>> must add this URL pattern at the end of your urls.py file of your main
>> project folder.
>>
>> from django.conf import settings
>> from django.conf.urls.static import static
>> urlpatterns = [
>> ...(Your Urls)
>> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>>
>> 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>  back.and
>>> I need
>>>
>>> http://127.0.0.1:8000/*oldgrub*
>>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>>
>>> back to have it work.
>>>
>>> What am I missing?  I've poured over my configs.
>>> Jeff
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCe6Bf-3pVgWWw%3D0P11cYq8dbZXhLDuH4UM6PG6AqWYqTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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 changes
> for you.
>
> Also, I believe that the problem you are facing is because you want to
> serve your files online by using the MEDIA_URL and MEDIA_ROOT. Hence, you
> must add this URL pattern at the end of your urls.py file of your main
> project folder.
>
> from django.conf import settings
> from django.conf.urls.static import static
> urlpatterns = [
> ...(Your Urls)
> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
> 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 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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>  back.and
>> I need
>>
>> http://127.0.0.1:8000/*oldgrub*
>> /media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
>>
>> back to have it work.
>>
>> What am I missing?  I've poured over my configs.
>> Jeff
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ca83632a-89d5-4186-873e-8ef6bf552cc5%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCeRNy2_KxuEnjGMv%3DK0h1kqR1%3DVP35YF7bH%2BPkvH3%3D2Cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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_REDIRECT_URL = '/'

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


urls.py


urlpatterns = [
path('', views.index, name='index'),
path('cookbooks/', views.CookBookListView.as_view(), name='cookbooks'),
path('cookbook/', views.CookBookDetailView.as_view(),
name='cookbook'),
path('recipe/', views.RecipeListView.as_view(), name='recipes'),
path('recipe/', views.RecipeDetailView.as_view(), name='recipe'),
path('family/', views.FamilyDetailView.as_view(), name='family'),
path('recipe/add/', views.RecipeAdd, name='addrecipe'),
#Add Django site authentication urls (for login, logout, password
management)
]

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

models.py

class Recipe(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4,
help_text='Unique ID for this particular recipe across whole library')
cookbook = models.ForeignKey(CookBook,on_delete=models.SET_NULL,
null=True, related_name='recipies')
title = models.TextField(max_length=1000, help_text='Enter a brief
description of the Recipe')
author = models.TextField(max_length=1000, help_text='Enter the
creator of the Recipie', blank=True)
text = models.TextField(max_length=1, help_text='Enter the recipe')
notes = models.TextField(max_length=1, help_text='Enter notes
on the recipe',blank=True)
pic = models.ImageField(upload_to='media/',blank=True, null=True)


views.py

def RecipeAdd(request):
template_name = 'recipe_add.html'

r = Recipe(cookbook=Family.objects.get(members=request.user).FamilyCookbook)
# If this is a POST request then process the Form data
if request.method == 'POST':

# Create a form instance and populate it with data from the
request (binding):
add_recipe_form = AddRecipeForm(request.POST, request.FILES)

# Check if the form is valid:
if add_recipe_form.is_valid():
# process the data in form.cleaned_data as required (here
we just write it to the model due_back field)
# book_instance.due_back =
book_renewal_form.cleaned_data['renewal_date']
r.author = add_recipe_form.cleaned_data['author']
r.notes = add_recipe_form.cleaned_data['notes']
r.text = add_recipe_form.cleaned_data['text']
r.title = add_recipe_form.cleaned_data['title']
# r.pic=add_recipe_form.cleaned_data['pic'] # file not
being returned here
# r.pic = add_recipe_form.data['pic']  # file not being
returned here
r.pic = request.FILES['pic']  #file not here

add_recipe_form.save()  # save the recipe

# redirect to a new URL:
return HttpResponseRedirect(reverse('recipes'))

# If this is a GET (or any other method) create the default form.
else:
# proposed_renewal_date = datetime.date.today() +
datetime.timedelta(weeks=3)
add_recipe_form = AddRecipeForm()

context = {
'form': add_recipe_form,
}

return render(request, 'recipe_add.html', context)


forms.py

class AddRecipeForm( ModelForm ):
pic = ImageField(widget= FileInput)  # was widget=PictureWidget

class Meta:
model = Recipe
fields = ('title', 'author', 'text', 'notes', 'pic')
widgets = {
'title': Textarea( attrs={'cols': 40, 'rows': 1} ),
'author': Textarea( attrs={'cols': 40, 'rows': 1} ),
'text': Textarea( attrs={'cols': 40, 'rows': 1} ),
'notes': Textarea( attrs={'cols': 40, 'rows': 1} ),
# 'pic': Textarea(attrs={'cols': 40, 'rows': 1}),

recipe_list.html

Recipe List
 {% if recipe_list %}
 
   {% for recipe in recipe_list %}
 
  
  {{ recipe.title }} {{recipe.author}}

{{recipe.text}} 
 {{ recipe.notes }}
 {% load static %}
 
   {% if recipe.pic %}
   {{ recipe.title }}
   

   {% endif %}
 
  {{ recipe.pic }}
 
   {% endfor %}


On Sun, Nov 18, 2018 at 10:23 AM Joel Mathew  wrote:

> 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 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://127.0.0.1:8000/media/media/56288852934__7

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://127.0.0.1:8000/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG
back.and
I need

http://127.0.0.1:8000/*oldgrub*
/media/media/56288852934__75FACD12-1711-4655-96D5-716198FE10B7.JPG

back to have it work.

What am I missing?  I've poured over my configs.
Jeff

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCe3UzvrWFg4fiRSPXp6HtLJoPJmGs8oPSZjAd%3Dxx4ygNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to connect mysql with django

2018-11-11 Thread Jeff Williams
You have to use the path of where you! downloaded the file.
On Sun, Nov 11, 2018 at 4:28 PM Ansh Srivastava 
wrote:

> Ahhh! not working:
> C:\Users\ansh>pip install c:\downloads\mysqlclient-1.3.13-cp37-cp3
> Invalid requirement: 'c:\downloads\mysqlclient-1.3.13-cp37-cp3'
> It looks like a path. File 'c:\downloads\mysqlclient-1.3.13-cp37-cp3' does
> not e
> xist.
> I just simply pasted your command !
>
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  Sender
> notified by
> Mailtrack
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  11/12/18,
> 2:57:02 AM
>
> On Mon, Nov 12, 2018 at 2:11 AM Jeff Williams 
> wrote:
>
>> sorry.  I meant the full path to the file.like below if you
>> downloaded it into C:\downloads.
>>
>> pip install c:\downloads\mysqlclient-1.3.13-cp37-cp3
>>
>> On Sun, Nov 11, 2018 at 2:58 PM Ansh Srivastava <
>> ansh.srivastav...@gmail.com> wrote:
>>
>>> Full path means? If you can send the screenshot or command instead @Jeff
>>> Williams
>>>
>>> [image: Mailtrack]
>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>  Sender
>>> notified by
>>> Mailtrack
>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>  11/12/18,
>>> 1:28:00 AM
>>>
>>> On Mon, Nov 12, 2018 at 1:07 AM Jeff Williams 
>>> wrote:
>>>
>>>> give it the full path to the file.  I had the same issue yesterday and
>>>> this fixed it for me.
>>>>
>>>> On Sun, Nov 11, 2018 at 2:27 PM Ansh Srivastava <
>>>> ansh.srivastav...@gmail.com> wrote:
>>>>
>>>>> Yes @,Jeff Williams , I did but it still prompts the same:
>>>>>
>>>>> C:\Users\ansh>pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>> Requirement 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a
>>>>> filename,
>>>>>  but the file does not exist
>>>>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not a supported wheel
>>>>> on this pla
>>>>> tform.
>>>>>
>>>>> -- Forwarded message -
>>>>> From: Jeff Williams 
>>>>> Date: Sun, Nov 11, 2018 at 11:43 PM
>>>>> Subject: Re: How to connect mysql with django
>>>>> To: 
>>>>>
>>>>>
>>>>> Did you download the .whl file first?
>>>>>
>>>>> On Sun, Nov 11, 2018 at 11:57 AM Ansh Srivastava <
>>>>> ansh.srivastav...@gmail.com> wrote:
>>>>>
>>>>>> Thank you @pujiarahman. I have tried out the above command but it
>>>>>> didn't work!It says::C:\Users\ansh\Desktop\Dje\p1\marvellous> pip
>>>>>> install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whlRequirement
>>>>>> 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename, but
>>>>>> the file does not existmysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>>> is not a supported wheel on this platform.Furthermore appreciated.
>>>>>>
>>>>>>
>>>>>> [image: Mailtrack]
>>>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>>>  Sender
>>>>>> notified by
>>>>>> Mailtrack
>>>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>>>  11/11/18,
>>>>>> 10:26:27 PM
>>>>>>
>>>>>> On Sun, Nov 11, 2018 at 8:46 PM pujiarahman 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Go to this site
>>>>>>> https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
>>>>>>> i use this for my python 3.7 and windows x64  :
>>>>>>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>>>> try :  pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>>>>
>>>>>>> regards
>>>>>>>
>>>>>>> Pada Minggu, 11 November 2018 18.57.11 UTC+7, ansh.srivastav999
>>>>>>> menulis:
>>>>>>>>
>>>>>&

Re: How to connect mysql with django

2018-11-11 Thread Jeff Williams
sorry.  I meant the full path to the file.like below if you downloaded
it into C:\downloads.

pip install c:\downloads\mysqlclient-1.3.13-cp37-cp3

On Sun, Nov 11, 2018 at 2:58 PM Ansh Srivastava 
wrote:

> Full path means? If you can send the screenshot or command instead @Jeff
> Williams
>
> [image: Mailtrack]
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  Sender
> notified by
> Mailtrack
> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>  11/12/18,
> 1:28:00 AM
>
> On Mon, Nov 12, 2018 at 1:07 AM Jeff Williams 
> wrote:
>
>> give it the full path to the file.  I had the same issue yesterday and
>> this fixed it for me.
>>
>> On Sun, Nov 11, 2018 at 2:27 PM Ansh Srivastava <
>> ansh.srivastav...@gmail.com> wrote:
>>
>>> Yes @,Jeff Williams , I did but it still prompts the same:
>>>
>>> C:\Users\ansh>pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>> Requirement 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a
>>> filename,
>>>  but the file does not exist
>>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not a supported wheel on
>>> this pla
>>> tform.
>>>
>>> -- Forwarded message -
>>> From: Jeff Williams 
>>> Date: Sun, Nov 11, 2018 at 11:43 PM
>>> Subject: Re: How to connect mysql with django
>>> To: 
>>>
>>>
>>> Did you download the .whl file first?
>>>
>>> On Sun, Nov 11, 2018 at 11:57 AM Ansh Srivastava <
>>> ansh.srivastav...@gmail.com> wrote:
>>>
>>>> Thank you @pujiarahman. I have tried out the above command but it
>>>> didn't work!It says::C:\Users\ansh\Desktop\Dje\p1\marvellous> pip
>>>> install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whlRequirement
>>>> 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename, but
>>>> the file does not existmysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is
>>>> not a supported wheel on this platform.Furthermore appreciated.
>>>>
>>>>
>>>> [image: Mailtrack]
>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>  Sender
>>>> notified by
>>>> Mailtrack
>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>  11/11/18,
>>>> 10:26:27 PM
>>>>
>>>> On Sun, Nov 11, 2018 at 8:46 PM pujiarahman 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Go to this site
>>>>> https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
>>>>> i use this for my python 3.7 and windows x64  :
>>>>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>> try :  pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>>>
>>>>> regards
>>>>>
>>>>> Pada Minggu, 11 November 2018 18.57.11 UTC+7, ansh.srivastav999
>>>>> menulis:
>>>>>>
>>>>>> I m tryin' to connect mysql database with django, for that, I did
>>>>>> this:-
>>>>>>
>>>>>>   python manage.py runserver
>>>>>>
>>>>>> but, this new mess came around sayin' :-
>>>>>>
>>>>>>  (django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb 
>>>>>> module.
>>>>>>  Did you install mysqlclient?).
>>>>>>
>>>>>> But when I m tryin' to install mysqlclient through pip as:-
>>>>>>
>>>>>>   pip install mysqlclient
>>>>>>
>>>>>> another creepy thing comes up:-
>>>>>>
>>>>>>   _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': 
>>>>>> No
>>>>>>such file or directory
>>>>>>   error: command 'C:\\Program Files (x86)\\Microsoft Visual
>>>>>>   Studio\\2017\\Comm
>>>>>>   unity\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed
>>>>>>   with exit status 2
>>>>>>
>>>>>> For installing mysql.h, I have downloaded mysql connector too, but
>>>>>> the error continues. I don't know how to proceed furher. Any help would 
>>>>>> be
>>>>>> appreciated.
>>

Re: How to connect mysql with django

2018-11-11 Thread Jeff Williams
give it the full path to the file.  I had the same issue yesterday and this
fixed it for me.

On Sun, Nov 11, 2018 at 2:27 PM Ansh Srivastava 
wrote:

> Yes @,Jeff Williams , I did but it still prompts the same:
>
> C:\Users\ansh>pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
> Requirement 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a
> filename,
>  but the file does not exist
> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not a supported wheel on
> this pla
> tform.
>
> -- Forwarded message -
> From: Jeff Williams 
> Date: Sun, Nov 11, 2018 at 11:43 PM
> Subject: Re: How to connect mysql with django
> To: 
>
>
> Did you download the .whl file first?
>
> On Sun, Nov 11, 2018 at 11:57 AM Ansh Srivastava <
> ansh.srivastav...@gmail.com> wrote:
>
>> Thank you @pujiarahman. I have tried out the above command but it
>> didn't work!It says::C:\Users\ansh\Desktop\Dje\p1\marvellous> pip
>> install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whlRequirement
>> 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename, but
>> the file does not existmysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is
>> not a supported wheel on this platform.Furthermore appreciated.
>>
>>
>> [image: Mailtrack]
>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>  Sender
>> notified by
>> Mailtrack
>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>  11/11/18,
>> 10:26:27 PM
>>
>> On Sun, Nov 11, 2018 at 8:46 PM pujiarahman 
>> wrote:
>>
>>> Hi,
>>>
>>> Go to this site  https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
>>> i use this for my python 3.7 and windows x64  :
>>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>> try :  pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>>
>>> regards
>>>
>>> Pada Minggu, 11 November 2018 18.57.11 UTC+7, ansh.srivastav999 menulis:
>>>>
>>>> I m tryin' to connect mysql database with django, for that, I did this:-
>>>>
>>>>   python manage.py runserver
>>>>
>>>> but, this new mess came around sayin' :-
>>>>
>>>>  (django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb 
>>>> module.
>>>>  Did you install mysqlclient?).
>>>>
>>>> But when I m tryin' to install mysqlclient through pip as:-
>>>>
>>>>   pip install mysqlclient
>>>>
>>>> another creepy thing comes up:-
>>>>
>>>>   _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No
>>>>such file or directory
>>>>   error: command 'C:\\Program Files (x86)\\Microsoft Visual
>>>>   Studio\\2017\\Comm
>>>>   unity\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed
>>>>   with exit status 2
>>>>
>>>> For installing mysql.h, I have downloaded mysql connector too, but the
>>>> error continues. I don't know how to proceed furher. Any help would be
>>>> appreciated.
>>>>
>>>>
>>>> [image: Mailtrack]
>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>  Sender
>>>> notified by
>>>> Mailtrack
>>>> <https://mailtrack.io?utm_source=gmail_medium=signature_campaign=signaturevirality5;>
>>>>  11/11/18,
>>>> 5:26:30 PM
>>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/396993f8-9e9d-4e4e-ac6f-0e687576627d%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/396993f8-9e9d-4e4e-ac6f-0e687576627d%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails

Re: How to connect mysql with django

2018-11-11 Thread Jeff Williams
Did you download the .whl file first?

On Sun, Nov 11, 2018 at 11:57 AM Ansh Srivastava <
ansh.srivastav...@gmail.com> wrote:

> Thank you @pujiarahman. I have tried out the above command but it
> didn't work!It says::C:\Users\ansh\Desktop\Dje\p1\marvellous> pip install
> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whlRequirement
> 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename, but
> the file does not existmysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not
> a supported wheel on this platform.Furthermore appreciated.
>
>
> [image: Mailtrack]
> 
>  Sender
> notified by
> Mailtrack
> 
>  11/11/18,
> 10:26:27 PM
>
> On Sun, Nov 11, 2018 at 8:46 PM pujiarahman  wrote:
>
>> Hi,
>>
>> Go to this site  https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
>> i use this for my python 3.7 and windows x64  :
>> mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>> try :  pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
>>
>> regards
>>
>> Pada Minggu, 11 November 2018 18.57.11 UTC+7, ansh.srivastav999 menulis:
>>>
>>> I m tryin' to connect mysql database with django, for that, I did this:-
>>>
>>>   python manage.py runserver
>>>
>>> but, this new mess came around sayin' :-
>>>
>>>  (django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
>>>  Did you install mysqlclient?).
>>>
>>> But when I m tryin' to install mysqlclient through pip as:-
>>>
>>>   pip install mysqlclient
>>>
>>> another creepy thing comes up:-
>>>
>>>   _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No
>>>such file or directory
>>>   error: command 'C:\\Program Files (x86)\\Microsoft Visual
>>>   Studio\\2017\\Comm
>>>   unity\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed
>>>   with exit status 2
>>>
>>> For installing mysql.h, I have downloaded mysql connector too, but the
>>> error continues. I don't know how to proceed furher. Any help would be
>>> appreciated.
>>>
>>>
>>> [image: Mailtrack]
>>> 
>>>  Sender
>>> notified by
>>> Mailtrack
>>> 
>>>  11/11/18,
>>> 5:26:30 PM
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/396993f8-9e9d-4e4e-ac6f-0e687576627d%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHMQ533731OMH6UwgJDA__JpkP0d1_gR3OY0ek2tPMh7JN%3DuKQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMgbqCe8Hkrbfh3YZ2aR_6ErJZgKSwJaJUqyP46ct3tHhsfeUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.