-
Notifications
You must be signed in to change notification settings - Fork 729
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
'py-api-views' #385
base: master
Are you sure you want to change the base?
'py-api-views' #385
Conversation
cinema/urls.py
Outdated
path("cinema_halls/", cinema_hall_list, name="cinema-hall-list"), | ||
path("cinema_halls/<int:pk>/", cinema_hall_detail, | ||
name="cinema-hall-detail"), | ||
path("", include(router.urls)), |
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.
No need to use include when basepath is not provided. Use urlpatterns = [list of urls] + router.urls
def post(self, request): | ||
serializer = GenreSerializer(data=request.data) | ||
serializer.is_valid(raise_exception=True) | ||
serializer.save() |
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.
Where is return???
Pipfile
Outdated
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
|
||
[dev-packages] | ||
pytest-django = "*" | ||
|
||
[requires] | ||
python_version = "3.11" |
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 from PR
pyproject.toml
Outdated
requires = [ | ||
"setuptools>=61.0.0", | ||
] | ||
build-backend = "setuptools.build_meta" |
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 from PR
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.
Pipfile.lock remove from PR
.gitignore
Outdated
db.sqlite3 | ||
Pipfile | ||
pyproject.toml |
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 empty line
|
||
urlpatterns = [ | ||
path("movies/", movie_list, name="movie-list"), | ||
path("movies/<int:pk>/", movie_detail, name="movie-detail"), | ||
*router.urls, |
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.
You can do:
urlpatterns = [list of urls] + router.urls
pytest.ini
Outdated
addopts = --reuse-db | ||
django_find_project = false | ||
pythonpath = . src |
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 empty line
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.
Well done!
No description provided.