Comments (11)
I have also problems running the commands like in the book. I think there is something mixed up with the folders.
First we have to mkdir /code/hello/ and then he does not tell in the book where to start the Docker commands. Or where to put the Dockerfile. One does not know in which directory he currently is, when he tells to start the commands. There is just the $ sign, absolutely no idea where I am with it.
from djangoforprofessionals.
from djangoforprofessionals.
Thanks, I tried a bunch of directories now and it still doesn't work.
After the docker-compose up command it says
Recreating hello_web_1 ... done
Attaching to hello_web_1
web_1 | python: can't open file '/hello/hello_project/manage.py': [Errno 2] No such file or directory
hello_web_1 exited with code 2
No matter how I change the directory it can not find the file. I'm on Windows and don't know how to write down the directory tree right. I tried it also with backslashes, but that doesn't work either.
from djangoforprofessionals.
@mehtez was there anything helpful in the logs?
To see them type: docker-compose logs
from djangoforprofessionals.
when i'm trying to execute commands within docker they never works!, for instance the command
$ docker-compose exec web python manage.py startapp users
from the third chapter in django for professionals.
returns:
CommandError: 'users' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.!!!
however I changed the app's name to be customers, this time nothing showed up on the screen and no app had been created.!
is anyone of you went through something related?
from djangoforprofessionals.
Hi,
My issue is similar...
When I run docker-compose up, I get the following:
$ docker-compose up
Recreating hello_web_1 ... done
Attaching to hello_web_1
web_1 | Watching for file changes with StatReloader
web_1 | Performing system checks...
web_1 |
web_1 | System check identified no issues (0 silenced).
web_1 | March 29, 2020 - 13:41:35
and it stops at that point. In the book it shows a further 3 lines...
web_1 | Django version 3.0, using settings 'hello_project.settings'
web_1 | Starting development server http://0.0.0.0:8000
web_1 | Quit the server qith CONTROL-C
I DO NOT get those last 3 lines. Consequently, when I run http://0.0.0.0:8000 (I also tried http://127.0.0.1:8000) I get the error message:
This site can’t be reached
0.0.0.1 refused to connect.
Can anyone help?
Regards,
GuyE
from djangoforprofessionals.
Hi,
My issue is similar...
When I run docker-compose up, I get the following:
$ docker-compose up
Recreating hello_web_1 ... done
Attaching to hello_web_1
web_1 | Watching for file changes with StatReloader
web_1 | Performing system checks...
web_1 |
web_1 | System check identified no issues (0 silenced).
web_1 | March 29, 2020 - 13:41:35and it stops at that point. In the book it shows a further 3 lines...
web_1 | Django version 3.0, using settings 'hello_project.settings'
web_1 | Starting development server http://0.0.0.0:8000
web_1 | Quit the server qith CONTROL-CI DO NOT get those last 3 lines. Consequently, when I run http://0.0.0.0:8000 (I also tried http://127.0.0.1:8000) I get the error message:
This site can’t be reached
0.0.0.1 refused to connect.Can anyone help?
Regards,
GuyE
Did you check your docker logs?
$ docker logs hello_web_1
from djangoforprofessionals.
from djangoforprofessionals.
Hi Siya,
I think I have resolved this (further chapters in the book will prove it). This is what I did...
- Delete / Drop everything and start from scratch EXCEPT the initial installation of Docker. Note that this is for Docker Toolbox on Windows 10 Home Edition.
- Follow everything exactly from Chapter 1 PP12 through to the end of PP26. Test with docker-compose up and STILL THE SAME ISSUE. CONTROL-C to quit out and run docker-compose down to ensure you are completely out.
- Back to PP12 and run this docker run -p 80:80 nginx INSTEAD OF the book code "docker run hello-world". (This seems to link to a different virtual connector - I am going to research this a bit more to understand it better!)
- Run this: docker-machine ip default to get the ip address --> 192.168.99.100
- Change hello_project.settings.py ALLOWED_HOSTS = [] to ALLOWED_HOSTS = ['*']
- Run docker-compose up. This time I GET THE LAST 3 LINES!!!
- On the browser, type http://192.168.99.100:8000/ and this returns Hello World!. I tested that it is the right one by changing the text of Hello World and it displayed the new text.
- Test again by stopping the Docker service - CONTROL-C / docker-compose down. Web page fails. Re-start with docker-compose up and refresh the web page - Hello World appears.
So I "THINK" this is now working but wherever the book mentions the web page 127.0.0.1:8000 I need to use http://192.168.99.100:8000/ instead.
Please let me know if this is something I SHOULD NOT be doing.
Regards,
GuyE
from djangoforprofessionals.
Final Update...
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4f7e5a5f3977 hello_web "python /code/manage…" 2 hours ago Up 2 hours 0.0.0.0:8000->8000/tcp hello_web_1
1e48ee26e188 nginx "nginx -g 'daemon of…" 2 hours ago Up 2 hours 0.0.0.0:80->80/tcp jovial_brattain
Shows that the expected "hello_web_1" and new "jovial_brattain" (thats a random generated name) container services are running.
Using docker-compose down ONLY stops the hello_web image. The nginx image is still running. If you want to stop that use the docker stop with a timeout command.
Thanks.
GuyE
from djangoforprofessionals.
when i access listview from our main products categories give "Cannot resolve keyword '' into field. Choices are: category, id, image, name"
from djangoforprofessionals.
Related Issues (20)
- Heroku Django media not loading HOT 2
- [Chapter 16 - Security] Issue with DJANGO_DEBUG HOT 3
- Unable to reset database HOT 1
- CH8 - Environment Variables - Import environs could not be resolved
- Chapter 11: Foreign Keys HOT 1
- Chapter 8: Environs import not working HOT 1
- Remove the file db.sqlite3 from the repo HOT 1
- Chapter 16 issues with CSRF tokens HOT 1
- Media Files directory HOT 1
- Chapter 8 aullauth logout redirect issue HOT 3
- Invalid Link HOT 1
- Typo in the book on page 258 HOT 1
- Published link to book cover is 404 HOT 1
- Home and About AssertTemplateUsed Tests Fail Starting In Chapter 16 HOT 1
- [ch 2] docker-compose.yml, permission denied HOT 2
- Chapter 10: Email // Clicking on the unique URL link in the email HOT 1
- Ch17, Page 256: "DJANGO_DEBUG=False" creates bugs HOT 1
- Accounts test fail after following steps for adding Social in Chapter 8 HOT 1
- Ch6 logout not working on django 5 HOT 1
- Chapter 2 creating superuser in Linux (root vs current user)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangoforprofessionals.