Question: I want to get boolean for all strings having digits at the end of string. For example

```
import re
# list of strings
li = ['/Usein-kysytyt-kysymykset;jsessionid=0727CD5A45A05D3CBD5A26D459C34D9D.xxlapp11',
      '/vaatteet/naisten-vaatteet/naisten-takit/c/120204',
      '/pyoraily/pyorailyvarusteet/pyorankuljetuslaukut-ja-vannepussit/c/100818_8']
for i in li:
    if(bool(re.match('\d+$', i))):
        print(i)

```

So this should work and return me `True` for `li[1]` and `li[2]` and `False` for `li[0]` but it is returning false for all elements in the list. What is wrong here ?

Answer: 
You shouldn't do anything. No errors no problem. The docs write about [development server](https://docs.djangoproject.com/en/1.11/howto/static-files/#serving-static-files-during-development) and [serving static files](https://docs.djangoproject.com/en/1.11/howto/static-files/#serving-static-files-during-development) AND that it is for development only. In a production environment you configure your server (Apache, NGNIX or third party like S3) to serve the files. That's all. 

Try to configure media files and access the file via it's url. If it works, try the {{ doc.tape.url }} template tag.

In your development environment your media may live in `/media/` (route and directory). While on production it may be something like `media.example.com`. Running Django with the settings for that environment will change all static/media domains and paths to their correct locations. 

You may split settings file into a settings file for each environment (production, acceptance, development). Like this:

```
project/
    settings/
        __init__.py
        base.py
        local.py
        staging.py
        test.py
        production.py

```

You can run your project with a specific env: `./manage.py runserver --settings=project.settings.development`. Do not repeat yourself and put development specific settings in `development.py` and `from base import *` so that `base.py` contains the default settings.

This project and settings layout is taken from the book Two Scoops of Django. It is just an example. Adjust to your own needs.
Basically adding that in the URL `urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)` will make the media files in the URL existing. Try removing that and visit your media file in the URL and you will receive a `404 not found`. It's very similar to the concept that you are inserting a `view` for rendering the media `files`