Error when trying to commit
onahkenneth opened this issue · comments
I get this error message when I want to commit my changes in config/urls.py
.git/hooks/pre-commit: 5: export: config/urls.py: bad variable name
Can anyone help me resolve it. I think it has something to do with the type of shell inside the container
What is the contents of your urls.py file?
@epicserve
Please see below
from typing import List
from django.contrib import admin
from django.urls import include, path
from django.views.generic import TemplateView
from django.conf import settings
from rest_framework.authtoken import views
from apps.accounts.urls import accounts_router
from apps.base.views import NameChange, http_404, http_500
urlpatterns: List[path] = []
Debug/Development URLs
if settings.DEBUG is True:
import debug_toolbar
urlpatterns += [
path("__debug__/", include(debug_toolbar.urls)),
path("admin/doc/", include("django.contrib.admindocs.urls")),
]
Includes
urlpatterns += [path(r"admin/", admin.site.urls)]
Project Urls
urlpatterns += [
path("", TemplateView.as_view(template_name="index.html"), name="site_index"),
path("api/auth/web/", include("rest_framework.urls")),
path("api/auth/token", views.obtain_auth_token),
path("api/accounts/", include(accounts_router.urls)),
path("500/", http_500),
path("404/", http_404),
path("accounts/name/", NameChange.as_view(), name="account_change_name"),
path("accounts/", include("allauth.urls")),
]
Try running the following to see what it tells you?
make lint
This runs all the linting that happens in the config/git_hooks/pre-commit
manually.
It's hard to tell what's going on from your file because the formatting got messed up.
Did you get it figured out?
@epicserve Yes I did, thank you.