-
Notifications
You must be signed in to change notification settings - Fork 0
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
BACKEND: Python Django, REST and DB #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add pycache to gitignore
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'django-insecure-dtk7$@ho6ty&4g-fe!ig^c81z27nkd@#r#^^e5jd++868gf_jh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put it to the .env and import here from os.getenv
# DATABASES = { | ||
# "default": { | ||
# "ENGINE": "django.db.backends.sqlite3", | ||
# "NAME": "mydatabase", | ||
# } | ||
# } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it
admin.site.register(Report) | ||
|
||
admin.site.register(Stages) | ||
admin.site.register(Employee) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an empty line at the end of the file
admin.site.register(Project) | ||
admin.site.register(Report) | ||
|
||
admin.site.register(Stages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to name it Objective
def __str__(self): | ||
return self.project_name | ||
|
||
class Stages(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objective
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
TrafficLight_Python/projects/urls.py
Outdated
urlpatterns = [ | ||
path("", views.index, name="index"), | ||
path("<int:project_id>", views.details, name="details") | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line at the end of the file
def details(request, project_id): | ||
try: | ||
projects = Project.objects.get(pk=project_id) | ||
except Project.DoesNotExist: | ||
raise Http404("Project does not exist") | ||
return render(request, "detail.html", {"projects": projects}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need no to have CRUD at views
return at the end just projects, need not to render
CRUD for a project in progress
… from migrations to .gitignore, removed garbage from admin.py, report_creator field in Report model
70c9adf
to
52e274b
Compare
LGTM 🚀 |
# 1.0.0 (2024-08-15) ### Features * **backend:** Python Django, REST and DB ([#4](#4)) ([66f57d0](66f57d0)) * **frontend, ci:** add configurations ([d78557d](d78557d)) * **frontend:** add an application ([38ce889](38ce889)) * **frontend:** create web folder with use react ts vite ([3dc5495](3dc5495))
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
CRUD for a project in progress