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

Error when trying to commit #12

Closed
onahkenneth opened this issue May 31, 2020 · 5 comments
Closed

Error when trying to commit #12

onahkenneth opened this issue May 31, 2020 · 5 comments

Comments

@onahkenneth
Copy link

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

@epicserve
Copy link
Owner

What is the contents of your urls.py file?

@onahkenneth
Copy link
Author

onahkenneth commented May 31, 2020

@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")),
]

@epicserve
Copy link
Owner

@onahkenneth,

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.

@epicserve
Copy link
Owner

@onahkenneth,

Did you get it figured out?

@onahkenneth
Copy link
Author

@epicserve Yes I did, thank you.

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

No branches or pull requests

2 participants