#26155: Can not Disable `check_url_config` Url Check
--------------------------------------+--------------------
     Reporter:  BuddyL                |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  Core (System checks)  |    Version:  1.9
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 If you try to create a migration with `makemigrations` it throws an error
 (below) because it is running the `check_url_config` system check. There
 currently isn't a way to disable this check, and the use case we have we
 don't need/use urls.

 {{{
 Traceback (most recent call last):
   File "./manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/management/__init__.py", line 353, in
 execute_from_command_line
     utility.execute()
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/management/__init__.py", line 345, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/management/base.py", line 348, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/management/base.py", line 398, in execute
     self.check()
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/management/base.py", line 426, in check
     include_deployment_checks=include_deployment_checks,
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/checks/registry.py", line 75, in run_checks
     new_errors = check(app_configs=app_configs)
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/checks/urls.py", line 9, in check_url_config
     resolver = get_resolver()
   File "/home/buddy/.venv/sk-client/lib/python3.4/functools.py", line 448,
 in wrapper
     result = user_function(*args, **kwds)
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/core/urlresolvers.py", line 151, in get_resolver
     urlconf = settings.ROOT_URLCONF
   File "/home/buddy/.venv/sk-client/lib/python3.4/site-
 packages/django/conf/__init__.py", line 56, in __getattr__
     return getattr(self._wrapped, name)
 AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'
 }}}

 Here are the steps to reproduce this error:

 {{{
 ./manage.py startproject demo
 cd blog
 vim blog/settings.py    # comment out ROOT_URLCONF
 ./manage.py startapp blog
 vim blog/models.py    # add model below
 ./manage.py makemigrations
 }}}

 {{{#!python
 from django.db import models

 class Post(models.Model):
     title = models.CharField(max_length=, blank=True)
     description = models.TextField(blank=True)
 }}}

 That should be enough to reproduce the error.

 My thought is we need to add a way to disable the `check_url_config`
 check.

--
Ticket URL: <https://code.djangoproject.com/ticket/26155>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.b5367b6188f8fc87da258d0ae92731d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to