Skip to content

docker-compose build not rebuild project #3

Open
@lyc2345

Description

@lyc2345

嗨,很好的教學,但我遇到一個問題,能不能為我解惑解惑,麻煩你了。

我clone了這個專案,然後執行docker-compose up --build
這時候如果我輸入http://0.0.0.0:8080/api/music/ 瀏覽器會出現下列錯誤

api-container |   File "./django_rest_framework_tutorial/urls.py", line 26, in <module>
api-container |     url(r'^api/', include(router.urls, namespace='api'), name='api'),
api-container |   File "/usr/local/lib/python3.6/site-packages/django/urls/conf.py", line 39, in include
api-container |     'Specifying a namespace in include() without providing an app_name '
api-container | django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
api-container | [pid: 10|app: 0|req: 1/2] 172.23.0.1 () {42 vars in 744 bytes} [Mon Jan  8 09:05:38 2018] GET /admin/ => generated 109203 bytes in 161 msecs (HTTP/1.1 500) 4 headers in 130 bytes (1 switches on core 0)

是include的錯誤,但我也不太知道怎麼解決,我使用最簡單的方法就是刪除api/ , api-auth/只留下url(^'admin', ...)這一行,因為我只想測試nginx,uwsgi,django之間的溝通,但我發現我每次重新build,我進入到api-container查看 cat django_rest_gramework_tutorial/url.py 被我刪除的兩行都沒有被刪除。
然後我想說是不是他沒有確實rebuild,然後我也有試過docker-compose down之後再重新build也還是會出現,我甚至直接docker rmi image,但也一樣,不知道您有沒有遇過類似的情形呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions