Re: CharField vs ImageField for Logo

2017-09-26 Thread tango ward
Got it. Thanks a lot!! On Tue, Sep 26, 2017 at 3:33 PM, Andréas Kühne wrote: > Hi, > > great that you are getting how the media settings work. > > If you look at this page : https://docs.djangoproject. > com/en/1.11/howto/static-files/ it explains what static files are and how > they work. Basi

Re: CharField vs ImageField for Logo

2017-09-26 Thread Andréas Kühne
Hi, great that you are getting how the media settings work. If you look at this page : https://docs.djangoproject.com/en/1.11/howto/static-files/ it explains what static files are and how they work. Basically, you use the static files template tags in your html templates and then you can use the

Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andreas, I was able to display the images but I dont know how they work. I checked some online resources and found out that I need to add these in my urls.py from django.conf import settings from django.conf.urls.static import static and at the bottom of it, I added if settings.DEBUG: u

Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andreas, Really appreciate your guidance on this. I am having trouble understanding this: 3: All that will be stored in your database is a path to the file (relative to MEDIA_ROOT ). You’ll most likely want to use t

Re: CharField vs ImageField for Logo

2017-09-25 Thread Andréas Kühne
Hi, I think you've made a lot of progress! The only thing I think you are missing now is that you should be using the following in your template: See: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield and https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.mode

Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andréas, Thank you for the response. I added these lines in my settings.py MEDIA_DIR = os.path.join(BASE_DIR, 'media') # Media MEDIA_ROOT = MEDIA_DIR MEDIA_URL = '/media/ Then I changed my logo to models.ImageField(upload_to='team_logo'). I also created a 'media' folder inside my project

Re: CharField vs ImageField for Logo

2017-09-25 Thread Andréas Kühne
Hi, There are a couple of things to think about here. First of all - just because you put an item on your computer doesn't mean that the icon can be served. For example, if you are running windows and you enter 'C:\pictures\icon.jpg' as the source for the icon, your server won't be able to find i

CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi guys, I am new to django currently stuck in these two. I am writing my pet project which will display a Team name and their logo. I used these lines for my Team class in mode.spy class Team(models.Model): name = models.CharField(max_length=150) logo = models.CharField(null=True, max_l