0

I am a newbie coder and I just started the cs50 web programming course on edEX. I seemingly cannot get my code to save a .md (markdown file) in a directory. For now I am just trying to save the .md file, I am not yet looking to redirect to the new entry's page. Please find a screenshot of screenshot of my codemy code below, corrections are welcome :)

2

1 Answer 1

0

I don't think you need to edit your util.py the way you did (https://cs50.harvard.edu/web/2020/projects/1/wiki/ also says there is no need to do it), but anyway there is another problem in your code:

you are trying to validate the form with Django validation (form.is_valid()), but you don't actually have a form in your new_page function.

You should add it with something like

form = Your_New_Page_Form(request.POST)

and then you can validate it the way you did.

Hope I helped! Happy coding!

1
  • hello there, so using django forms for this project has taken an entirely different turn as I just noticed that my form is rendering in only my index.html file and no other html file. I have looked up documentation and posts by people with similar problems but nothing seems to work. Have you ever encountered such a problem with django forms?
    – DaitoCode
    Oct 5, 2020 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .