1

I am in the process of building a website with Django. The web app is for a local store in my city. The store sells gardening courses and workshops (the store is my mom's btw).

I want the admin of the page (the owner of the store) To be able to add new courses whenever she wants.

So I made this model for the courses:

class Curso(models.Model):
    title = models.TextField()
    photo = models.ImageField(upload_to='cursos/')
    description = models.TextField()
    price = models.IntegerField(null=False)
    content = models.JSONField(blank=True)
    clases = models.IntegerField(default=1)
    duration = models.IntegerField()
    isworkshop = models.BooleanField(default=False)

I included an ImageField because in the fronted there should be an image related to the course. I added the path /cursos/ but I actually have no idea where the image is going. I saw people had a "media" folder. But I also read the "media" folder was only for images uploaded by the user?

This is my static folder looks like: static |_app |_js |_css |_sass |_icons |_images |_homeslider |_plants |_pictures

Should the images uploaded from the admins app in that same folder?

Anyways I don't know where to store the images. And I don't have a hosting yet which leads me to my next question:

  • What should I do with the database?

I saw the majority of people asking these types of question had already bought a hosting so:

  • Should I buy a hosting even if the app is far from being ready just to start testing things out there and putting the courses objects there?
  • Are files stored differently in production?
  • Can I have my database locally and then upload it to the server?

What I don't want is to put a bunch of images and data on a sqlite database and then have to change all of it because that's not going to work for production

I'm new to web development and I am really lost when it comes to hosting, production and databases.

I would be very thankful for any help. I don't know what to do and I need someone more experienced to put me in the right direction.

Thank you in advanced!

pauzca
  • 164
  • 1
  • 12

0 Answers0