Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

How do I build websites where someone without coding knowledge could add content to it?

I'm studying the Front End Web Dev track and it's been great, I've learned a lot about building websites, libraries and frameworks that assist the process etc. Now that I'm coming to the end of the track, I realise I still can't build something that someone else could update.

Say I build a real estate agency a website, I want to make it so they themselves could log on to the website and add new properties to it.

If the simple answer for this question is "that's backend, you're studying front end mate!" then an additional question... For the above example, how would I build that functionality? Say I was using Python as my backend language, would Django or other framework like Flask be the way to go to build something like that?

1 Answer

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Hi Ross,

That is a great question, and the short answer is "there are a million ways of achieving this goal". But I don't think that's the answer you would like so here we go.

You would want a database where the data your users adds will be saved when they add it, and retrieved when the browser requests it. You would then want to use a backend language/technique that can handle the users post/get requests and make sure the data gets stored in your database. You mentioned Python and Django, they would work great for this, as would most other backend techniques.

Let's say you create your database and start by putting some data in it (just to get you started). You would then using your chosen backend technique have one route (let's say "www.yoursite.com/home ) send a get request to your backend which will fetch the data from your database and send it back with the response. You could now present this data on your front end.

So how could your users add data? You use a form to let the users fill in what data they would like to add. When they are done filling in the form they will submit, which will trigger a post request to your backend which will in turn store the received data.

This is a pretty basic overview of the steps you would take to accomplish what you described. You could also do some research on CMS systems as they could also be of help to you.

I hope this helps you,

Jonas

Hey Jonas, thanks for answering my question! From what you're saying, I need a database to store data (like additional properties), and a backend language that handles saving and retrieving the data. As only the agent should be allowed to add/delete etc properties, they would need to be a log in system where they can log in with a username and password to make those changes. Would this all be done with the same backend technique, for example Django using Python?

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Correct!

And you figured that one out all by yourself, that's awesome :)

An example of how this could be done would be you creating a "sign up" page, where the user get to fill in a form (this form will save the user details in your database). When the user wants to log in to be able to make changes, another form(!), this time the backend will check if the submitted the credentials match any credentials in the database, if they do the user will be logged in and could reach the page where the user can add more estates.

The first time I was going to do this I was overwhelmed, there are so many pieces to this, right? My advice is to just divide your project into as many bite sized chunks as you can. You will get stuck every now and then, but with the help of this community, Google and some patience you will succeed :)

It doesn't have to be pretty the first time, just get started and you'll learn a ton! The second time is always easier :)

Jonas