title: Syntax error ,I have tried to load my django project on a production server
body: <p>I have tried to load my project on a production server,I have the below syntax error for something that was working fine in test environment,any help here?   </p>
  
  <p>I cant see why I have the error</p>
  
  <blockquote>
    <p>f'accounts/emails/{template}.html', context) ^ SyntaxError: invalid syntax</p>
  </blockquote>
  
  <p>here is the code</p>
  
  <pre><code>def send_mail(to, template, context):
      html_content = render_to_string(f'accounts/emails/{template}.html', context)
      text_content = render_to_string(f'accounts/emails/{template}.txt', context)
  </code></pre>
  
  <p>Error Traceback</p>
  
  <pre><code>Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrapper at 0x7f00e7044158&gt;
      Traceback (most recent call last):
        File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 225, in wrapper
          fn(*args, **kwargs)
        File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 117, in inner_run
          self.check(display_num_errors=True)
        File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 379, in check
          include_deployment_checks=include_deployment_checks,
        File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 366, in _run_checks
          return checks.run_checks(**kwargs)
        File "/usr/local/lib/python3.5/dist-packages/django/core/checks/registry.py", line 71, in run_checks
          new_errors = check(app_configs=app_configs)
        File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
          return check_resolver(resolver)
        File "/usr/local/lib/python3.5/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
          return check_method()
        File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 396, in check
          for pattern in self.url_patterns:
        File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 37, in __get__
          res = instance.__dict__[self.name] = self.func(instance)
        File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 533, in url_patterns
          patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
        File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 37, in __get__
          res = instance.__dict__[self.name] = self.func(instance)
        File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 526, in urlconf_module
          return import_module(self.urlconf_name)
        File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
        File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
        File "&lt;frozen importlib._bootstrap&gt;", line 958, in _find_and_load_unlocked
        File "&lt;frozen importlib._bootstrap&gt;", line 673, in _load_unlocked
        File "&lt;frozen importlib._bootstrap_external&gt;", line 665, in exec_module
        File "&lt;frozen importlib._bootstrap&gt;", line 222, in _call_with_frames_removed
        File "/home/grouped/teroexamplecom/teroexamplecom/urls.py", line 21, in &lt;module&gt;
          url(r'^', include('toys.urls')),
        File "/usr/local/lib/python3.5/dist-packages/django/urls/conf.py", line 34, in include
          urlconf_module = import_module(urlconf_module)
        File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "&lt;frozen importlib._bootstrap&gt;", line 986, in _gcd_import
        File "&lt;frozen importlib._bootstrap&gt;", line 969, in _find_and_load
        File "&lt;frozen importlib._bootstrap&gt;", line 958, in _find_and_load_unlocked
        File "&lt;frozen importlib._bootstrap&gt;", line 673, in _load_unlocked
        File "&lt;frozen importlib._bootstrap_external&gt;", line 665, in exec_module
        File "&lt;frozen importlib._bootstrap&gt;", line 222, in _call_with_frames_removed
        File "/home/grouped/teroexamplecom/toys/urls.py", line 4, in &lt;module&gt;
          from toys import views as toysviews
        File "/home//grouped/toys/views.py", line 100, in &lt;module&gt;
          from .utils import (
        File "/home//toys/utils.py", line 9
          html_content = render_to_string(f'accounts/emails/{template}.html', context)
                                                                           ^
      SyntaxError: invalid syntax
  </code></pre>