Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django-backend #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Django-backend #1

wants to merge 2 commits into from

Conversation

Rhode01
Copy link
Collaborator

@Rhode01 Rhode01 commented Jun 23, 2023

No description provided.

Copy link
Owner

@siddharth-krishna siddharth-krishna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks great. I have added some comments on how to improve it before we merge the PR in.

Another thing we should add is a README file that explains how to install Django and other dependencies, and how to run the webserver on a laptop to test the website locally. I think we should also add a requirements.txt file and instructions on how to set up a python virtual environment for this project. (See for example https://github.com/etsap-TIMES/times-excel-reader/#development-setup)

<script src="linenumbers.min.js" type="text/javascript"></script>
<script src="index.js" type="text/javascript"></script>
<script src=" {% static 'js/codejar.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/codejar.min.js' %}" type="text/javascript"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This JS file is being imported twice.

Generated by 'django-admin startproject' using Django 4.0.5.

For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I go to this link, it says "This document is for an insecure version of Django that is no longer supported. Please upgrade to a newer release!". Maybe we should use v4.2?

# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-zjnqabq%c2lpq$jgg12z8q6foq^q2i94cr02q76&(2stpwn#a8'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not commit the secret key to a public repo. Let's find out where to store it instead

SECRET_KEY = 'django-insecure-zjnqabq%c2lpq$jgg12z8q6foq^q2i94cr02q76&(2stpwn#a8'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, we should set this to False in the repo, and have a way to make it True when we test the website locally.

<script src=" {% static 'js/codejar.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/codejar.min.js' %}" type="text/javascript"></script>
<script src=" {% static 'js/linenumbers.min.js' %}" type="text/javascript"></script>
<script type="text/javascript" src="{% static 'js/script.js' %}"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This expects script.js to live in static/js/ but this PR moves it to templates/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants