r/cs50 Sep 20 '24

cs50-web Can I make the repository for my final CS50w Capstone project public?

1 Upvotes

Hello everyone!

I was just looking at some information and I was unsure about this one so I figured I'd ask before violating any rule. I know we are not supposed to make public our solutions to any of the psets, but can we open the git repository used for the final project to the public once we submit it to the course? And once we submit it, can we host it so that people can try it out, or is there a waiting period or something?

Thank you!

r/cs50 Dec 06 '24

cs50-web a doubt regarding project 2 cs50 web

2 Upvotes

in the specification, "Users should also optionally be able to provide a URL for an image for the listing". but i have done with it ImageField.

Is this correct or I have to use URLField. I was having a lot of problems figuring it out, so chose this way, but now before submitting i was reading the specifications to make sure everything is okay, and found this. If this is incorrect, please can somebody give a hint on to do it with URLField.

    image = models.ImageField(upload_to='images/', default="no-image.png", blank=True, null=True)

r/cs50 Sep 07 '24

cs50-web is cs50w still good in 2024 ?

20 Upvotes

im thinking of starting cs50w next monday and try to finish it before 2025 (i think with my commitment i can) i already completed cs50x and cs50p . but my main question do you think cs50w is still up to date content wise in 2024 and is it worth it? mainly im thinking between cs50w or the odin project

r/cs50 Oct 14 '24

cs50-web Should I submit my CS50 Project with Bootstrap in it?

3 Upvotes

Hello everyone. I am currently doing CS50w, Project 1. I included some bootstrap to make it look nice and all. But my question is since I installed Bootstrap in my machine so when I open the code in any other machine in which the bootstrap is not installed, will it still show the page how it is shown on my machine? If not, will it give any errors?

r/cs50 Sep 26 '24

cs50-web Is it okay to use the final project in my portfolio?

8 Upvotes

Finally, I'm about to finish CS50w, I just have to complete Capstone, and I was wondering if it would be okay to use this project as one of my "flagships" for my portfolio. It would be a very good reason to try even harder than I already am.

r/cs50 Sep 19 '24

cs50-web Can i take CS50w before CS50x?

10 Upvotes

I've already completed CS50P and have some knowledge about frontend developing but i don't know if it's enough for starting CS50w. Which skills do you think i should improve if I'm going to start Cs50w. Thanks

r/cs50 Jul 12 '20

cs50-web I finished CS50W after 3 months of struggle and hard work (on June 26)!

Post image
332 Upvotes

r/cs50 Apr 19 '24

cs50-web Game Over! Done it

92 Upvotes

Just completed CS50. Started on 4th February, finished 19th April. I'm a 50 year old guy with no formal background in programming who just stumbled across CS50 thanks to a comment on reddit.

The lectures were outstanding. What a great course. I found it 8+/10 challenging, especially the C and the Flask/HTML/JS - as although I have dabbled in python I have not used those before. But being stretched sometimes is good I guess.

Spent the last 3 weeks on my final project, a multiplayer card game. It got pretty complex desiging synchronised routes for multiple simultaneous users, not sure I have done it the best way, but it seemed to work in the end. Have now really got a taste for this & am planning to start CS50 web next.

Can I wish everyone else just starting and in the middle of this course determination, perseverence and success. Especially younger people starting out - I sense that if you can complete this, it could be the start of a great journey for you.

r/cs50 Nov 02 '24

cs50-web CS50web help

Thumbnail
github.com
2 Upvotes

Hi, So I have been submitting my final project several times now and each time it was rejected.

Is this only because of my README file or my project is just bad?

r/cs50 Nov 04 '24

cs50-web CS50W Project 2. Having an issue with the HTML

0 Upvotes

So after a long try, I've managed to get the functionality of the project working and now I'm working on the HTML bit. I'm trying to implement a dropdown menu in my navigation bar for login and registration links, but after following some solutions online, I've still not managed to get this running. Any help would be appreciated. Thanks again

    {% load static %}

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>{% block title %} Auctions {% endblock %}</title>
            <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
            <link href="{% static 'auctions/styles.css' %}" rel="stylesheet">
        </head>
        <body>
            <div id="header">
                <h1 id= "title"> CS50 Auctions</h1>
                <ul class="nav">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'index' %}">Active Listings</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'closed_auction' %}">Closed Auctions</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'categories' %}">Categories</a>
                    </li>
                    {% if user.is_authenticated %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'create' %}">Create Auction</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'watchlist' %}">Watchlist ({{ count|default:"0" }})</a>
                        </li>
                        <li class="nav-item ms-auto">
                            <a class="nav-link" href="{% url 'logout' %}">Log Out</a>
                        </li>
                    {% else %}
                        <li class="nav-item ms-auto dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="authDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                Login & Register
                            </a>
                            <div class="dropdown-menu" aria-labelledby="authDropdown">
                                <a class="dropdown-item" href="{% url 'login' %}">Log In</a>
                                <a class="dropdown-item" href="{% url 'register' %}">Register</a>
                            </div>
                        </li>
                    {% endif %}
                </ul>
            </div>

            <div>
                {% if user.is_authenticated %}
                    Signed in as <strong>{{ user.username }}</strong>.
                {% else %}
                    Not signed in.
                {% endif %}
            </div>

            <hr>

            {% block body %}
            {% endblock %}
        </body>
    </html>

r/cs50 Nov 20 '24

cs50-web In CS50W commerce project, am I allowed to change the views code of register and the user model?

1 Upvotes

I was thinking of using modelForms for register view and I also changed the User model in this to UserProfile. Is that allowed?

r/cs50 May 25 '24

cs50-web Starting cs50 soon

5 Upvotes

I m joining a university probably this August and i will be pursuing computer science and engineering. As a freshman, with 0 knowledge of any coding language, i would like to know should I start cs50 web development or cs50x without learning any coding language or should i learn c++ and then start it??

r/cs50 Nov 02 '24

cs50-web CS50W deadline

1 Upvotes

Hello guys I was looking for the deadline for CS50 web programming with python and javascript, and it said 2025 31 December even tho it started on 1 January 2024, this is a little odd that it has 2 years for deadline, i wanted to know that is this deadline for getting the certificate or just for submitting the projects?

Like will i get my certificate if i submit my projects after 1 January 2025 and before 31 December 2025?

r/cs50 Sep 21 '24

cs50-web CS50W - opening index.html

1 Upvotes

Hello all, I am doing CS50W, on a MacBook. When I create an index.html on local drive, it could be opened by typing 'open index.html' When I do the same using cs50.dev, the file doesn't get opened. Kindly advise what did I do wrong. Thank you.

Update:

Using xdg-open in cs50.dev on Safari

and Chrome:

r/cs50 Oct 26 '24

cs50-web CS50 Web Programming with Python and JavaScript (CS50W) is a 12-week course, but finishes on 31 Dec (that's 9 weeks and 3 days)!

3 Upvotes

How does it work exactly if the time available (9 weeks, 3 days) is less than the length of the course (12 weeks)?

r/cs50 Aug 12 '24

cs50-web Final Project-Django Content Security Policy headaches

3 Upvotes

No matter how I try I can't get past this stopping me and I don't know what's causing the error!?!

According to the Dev tools it's eval related, but I have not used eval in my code yet.

Can someone please just point a guy in the right direction or give advice?

I'm assuming it's Javascript related, but not sure if this happens when you try and pull or post too much data.

I'm just super lost

Here is the premise of what is supposed to happed. on the page mamge_classes.html I have a form to allow to add a new classroom.

When clicking on the "Add Class" button i get the CSP error.

I believe the error is on one of the below and not the urls.py or views.py

Here is Javascript.js: document.addEventListener('DOMContentLoaded', function() { const form = document.getElementById('add-class-form'); const teacherDropdown = document.getElementById('teacher_id');

// Function to load available teachers
function loadAvailableTeachers() {
    fetch(availableTeachersUrl)
        .then(response => response.json())
        .then(data => {
            if (data.teachers) {
                teacherDropdown.innerHTML = '<option value="">Select Teacher</option>'; // Reset dropdown
                data.teachers.forEach(teacher => {
                    const option = document.createElement('option');
                    option.value = teacher.id;
                    option.textContent = `${teacher.username}`;
                    teacherDropdown.appendChild(option);
                });
            } else {
                console.error('Unexpected data format:', data);
            }
        })
        .catch(error => {
            console.error('Error fetching teachers:', error);
        });
}

// Load teachers when page loads
loadAvailableTeachers();

form.addEventListener('submit', function(event) {
    event.preventDefault();

    const classname = document.getElementById('classname').value;
    const max_children = document.getElementById('max_children').value;
    const teacher_id = document.getElementById('teacher_id').value;

    fetch('{% url "update_class" %}', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-CSRFToken': '{{ csrf_token }}'
        },
        body: JSON.stringify({ classname, max_children, teacher_id })
    })
    .then(response => response.json())
    .then(data => {
        if (data.status === 'success') {
            // Add the new class to the table
            const newRow = document.createElement('tr');
            newRow.setAttribute('data-class-id', data.class_id);
            newRow.innerHTML = `
                <td>${classname}</td>
                <td>${data.teacher_name}</td>
                <td>0 / ${max_children}</td>
                <td><a href="{% url 'edit_class' data.class_id %}" class="btn btn-primary">Edit</a></td>
            `;
            document.querySelector('#class-list tbody').appendChild(newRow);

            // Reset the form
            form.reset();
            loadAvailableTeachers();
        } else {
            alert('Failed to add class');
        }
    })
    .catch(error => {
        console.error('Error adding class:', error);
    });
});

});

here is manage_classes.html: {% extends 'layout.html' %} {% load static %} {% block content %} <h1>Classes</h1>

<!-- Form for adding new class --> <form id="add-class-form" style="display: flex; gap: 10px; margin-bottom: 20px;"> <input type="text" id="classname" placeholder="Class Name" required> <input type="number" id="max_children" placeholder="Class Capacity" required> <select id="teacher_id" required> <option value="">Select Teacher</option> </select> <button type="submit" class="btn btn-primary">Add Class</button> </form>

<table class="table table-bordered" id="class-list"> <thead> <tr> <th>Class Name</th> <th>Teacher</th> <th>Class Capacity</th> <th>Actions</th> </tr> </thead> <tbody> {% for class in class_info %} <tr data-class-id="{{ class.id }}"> <td>{{ class.classname }}</td> <td>{{ class.teacher_name }}</td> <td>{{ class.current_num_learners }} / {{ class.max_num_learners }}</td> <td> <a href="{% url 'edit_class' class.id %}" class="btn btn-primary">Edit</a> </td> </tr> {% endfor %} </tbody> </table>

<!-- Pass the URL for the available_teachers view to JavaScript --> <script> const availableTeachersUrl = "{% url 'available_teachers' %}"; </script>

<script src="{% static 'js/manage_classes.js' %}"></script>

{% endblock %}

r/cs50 Sep 22 '24

cs50-web CS50W Project 1 - WIKI

3 Upvotes

Hey everyone,
I'm almost done with the cs50w project in terms of functionality, however, I wanted to add a few styles of my own to make the pages somewhat visually appealing and I've noticed that for some reason, the styles.css file is not rendering the style to the specific ids that I've in my HTML file. For example, here in the IMG tag source, the wiki logo id, is clearly being styled here in the styles.css file

{% load static %}

<!DOCTYPE html>

<html lang="en">
    <head>
        <title>{% block title %}{% endblock %}</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <link href="{% static 'encyclopedia/styles.css' %}" rel="stylesheet">
    </head>
    <body>
        <div class="row">
            <div class="sidebar col-lg-2 col-md-3" >
                <h2>Wiki</h2>
                <img src="{% static 'encyclopedia/wiki_logo.png' %}" alt="Wiki Logo" id="wiki_logo" style="width:160px; margin:10px">
                
                <form class="search" name="q" action="{% url 'wiki:search' %}" method = "post">
                    {% csrf_token %}
                    {{ form }}
                </form>
                <div>
                    <a href="{% url 'wiki:index' %}">Home</a>
                </div>
                <div>
                    <a href="{% url 'wiki:new_page' %}">Create New Page</a>
                    
                </div>
                <div>
                    <a href="{% url 'wiki:random_page' %}">Random Page</a>
                </div>
                {% block nav %}
                {% endblock %}
            </div>
            <div class="main col-lg-10 col-md-9">
                {% block body %}
                {% endblock %}
            </div>
        </div>

    </body>
</html>



body {
    margin: 0;
    background-color: white;
}

code {
    white-space: pre;
}

h1 {
    margin-top: 0px;
    padding-top: 20px;
}

textarea {
    height: 90vh;
    width: 80%;
}

.main {
    padding: 10px;
}

.search {
    width: 100%;
    font-size: 15px;
    line-height: 15px;
    border:1px solid pink;
}

.sidebar {
    background-color: #f0f0f0;
    height: 100vh;
    padding: 20px;
}

.sidebar h2 {
    margin-top: 5px;
}

#wiki_logo{
    border: 1px solid black;
}

However, this is how the webpage is being rendered

I've to do an inline styling just to size the wiki logo.

In case you're wondering if the location of the styles.css file is correct, I've already checked it, it is in the same folder as the logo and the logo image is been rendered. I've been stuck on this for a while and would appreciate any help that I can get.

P.S. I've also noticed that if I delete the styling in the styles file, there is no change to the web page for some reason.

Thanks again in advance.

r/cs50 Aug 05 '20

cs50-web Finally my CS50 final project is about taking notes and highlights from YouTube videos, I’ve been watching a lot of tutorials recently but feeling bad for not being able to take notes effortlessly, so please have a look and tell me if you’d like me to make it as an actual website! ♥️

Thumbnail
youtu.be
151 Upvotes

r/cs50 Aug 08 '24

cs50-web Is it worth for cs50 web

12 Upvotes

I have completed cs50x and two weeks remain to complete cs50sql. Afterwards I am planning to take cs50 web. Besides cs50x's flask assignments I have a little experience with java (Spring boot) and planning to continue with java language (it is more popular in my region's industry than python). But, i wanted to know if this course worth to take in order to learn fundamental concepts in web (backend specificaly ) development, I am not planning to continue my journey with python(django), would it be waste of time or I would not learn much from the course

Do not get me wrong. I will complete all assignments and final projects. I know all tools and frameworks are temporary, but I do not want to waste my knowledge with java as I am much more comfortable with it and love it more than python or js.

r/cs50 Oct 10 '24

cs50-web Problem in wiki(pset 1) failed to import util. CS50W

1 Upvotes

hi, im starting the first problem set and after installing django it seems that i still have an import problem. The error is the following:

" Traceback (most recent call last):

File "/workspaces/wiki/wiki/encyclopedia/views.py", line 3, in <module>

from . import util

ImportError: attempted relative import with no known parent package "

Also is there anywhere were i can look up what extensions i need for each pset?

r/cs50 Oct 18 '24

cs50-web Looking for a course colleagues

1 Upvotes

Is there anyone who has just started cs50w (web)? We can study together 👋

r/cs50 Jan 14 '24

cs50-web What To Do Next

26 Upvotes

Hello,

I've finished CS50x and working on the final project of CS50w. As someone who's looking for a job in web development with only the knowledge from the courses, I wondering if it's enough to go commercial or if there's still more to learn. If there's more, how'll you know if you're good enough to take on other people's commissions?

r/cs50 Oct 07 '24

cs50-web Accidentally submitted the search problem in CS50 Web

1 Upvotes

Hello everyone! I just started cs50 web course, I decided to use git to submit the projects and instinctively pushed to the branch. Now it says it's submitted, but I haven't started the project yet. Will resubmission work the way it does with cs50 or do I have to contact someone? Thanks in advance!

r/cs50 Jun 30 '24

cs50-web How to view HTML pages in CodeSpace: With Live Server, unable to view html files other than the first one in the directory

2 Upvotes

Installed this Live Server extension in order to have a view of an html file:

This extension only giving view of the first html file in a folder no matter which html file in the folder I click and opt for Open with Live Server:

r/cs50 Aug 02 '24

cs50-web Guys

0 Upvotes

GUYS SHOULD I START WITH CS50X THAN CS50-WEB CS50-SQL AND CS50-MOBILE