Sharing the contents of polls/urls.py could help but I assume you didn't
make any errors on the first line. To be sure, you can add a comment on the
first line and leave the second line blank.
If you still have an error on line 1, it might be related to how you save
your file. Python might not like utf8 with BOM.

I hope that helps you

On 1 Feb 2017 1:32 p.m., "Zhou Sicong" <genie10...@gmail.com> wrote:

> Hi,
>
>   I tried doing exactly everything as told in Tutorial 1 (
> https://docs.djangoproject.com/en/1.10/intro/tutorial01/)
>   I use idle to write the polls.py and urls.py
>   Do i totally overwrite the code already in those file or leave them
> alone and add on the codes in the tutorial.
>
>   Because i always get this when i start run the server again. What could
> possibly be the error?
>
>
>
> Performing system checks...
>
> Unhandled exception in thread started by <function
> check_errors.<locals>.wrapper at 0x03C7D978>
> Traceback (most recent call last):
>   File "c:\django\django\utils\autoreload.py", line 226, in wrapper
>     fn(*args, **kwargs)
>   File "c:\django\django\core\management\commands\runserver.py", line
> 125, in inner_run
>     self.check(display_num_errors=True)
>   File "c:\django\django\core\management\base.py", line 356, in check
>     include_deployment_checks=include_deployment_checks,
>   File "c:\django\django\core\management\base.py", line 343, in
> _run_checks
>     return checks.run_checks(**kwargs)
>   File "c:\django\django\core\checks\registry.py", line 78, in run_checks
>     new_errors = check(app_configs=app_configs)
>   File "c:\django\django\core\checks\urls.py", line 13, in
> check_url_config
>     return check_resolver(resolver)
>   File "c:\django\django\core\checks\urls.py", line 23, in check_resolver
>     return check_method()
>   File "c:\django\django\urls\resolvers.py", line 247, in check
>     for pattern in self.url_patterns:
>   File "c:\django\django\utils\functional.py", line 31, in __get__
>     res = instance.__dict__[self.name] = self.func(instance)
>   File "c:\django\django\urls\resolvers.py", line 398, in url_patterns
>     patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File "c:\django\django\utils\functional.py", line 31, in __get__
>     res = instance.__dict__[self.name] = self.func(instance)
>   File "c:\django\django\urls\resolvers.py", line 391, in urlconf_module
>     return import_module(self.urlconf_name)
>   File "C:\Users\SzeChong\AppData\Local\Programs\Python\
> Python35-32\lib\importlib\__init__.py", line 126, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 958, in
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 662, in exec_module
>   File "<frozen importlib._bootstrap>", line 222, in
> _call_with_frames_removed
>   File "C:\mysite\mysite\urls.py", line 20, in <module>
>     url(r'^polls/', include('polls.urls')),
>   File "c:\django\django\conf\urls\__init__.py", line 39, in include
>     urlconf_module = import_module(urlconf_module)
>   File "C:\Users\SzeChong\AppData\Local\Programs\Python\
> Python35-32\lib\importlib\__init__.py", line 126, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 958, in
> _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 658, in exec_module
>   File "<frozen importlib._bootstrap_external>", line 764, in get_code
>   File "<frozen importlib._bootstrap_external>", line 724, in
> source_to_code
>   File "<frozen importlib._bootstrap>", line 222, in
> _call_with_frames_removed
>   File "C:\mysite\polls\urls.py", line 1
>     Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900
> 32 bit (Intel)] on win32
>              ^
> SyntaxError: invalid syntax
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAF_57Gsq7nM5bJNGhhdoomQV9ywJ6pN5A
> gOfdGVYXe2jzFn4sg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF_57Gsq7nM5bJNGhhdoomQV9ywJ6pN5AgOfdGVYXe2jzFn4sg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTZgAdw%2BdaMdbTpu8AUD2SSu8o9iF%3Dt4PvjHMHH1TfrTSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to