Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Interacting with Django#61

hiwigiwi started this conversation inGeneral
Mar 3, 2025· 1 comments· 1 reply
Discussion options

Thank you for this repo, some great insights for me on how thingsshould be done!

I come from a non-Docker background, in which I used to run Django inside a python venv. If I wanted to interact with Django, for example creating a new app, I would activate the venv and then run commands in the terminal. How am I supposed to do that here? As far as I can see there is no venv here, as Docker kinda replaces that. Am I supposed to create a venv from the requirements.txt locally and then use that? Or is there a way to do this in the running Docker container?

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

I found that this is a way to do it:
docker exec -ti container_name /bin/bash.
Then I can run, for example:python manage.py startapp newApp
Is that the recommended way?

You must be logged in to vote
1 reply
@nickjj
Comment options

Hi,

Yep, and this project creates shortcuts for you to do things like that. If you check the beginning of the readme file it calls out to run commands like./run manage migrate. That is ultimately a wrapper to rundocker compose exec web python3 manage.py migrate. You can replacemigrate with whatever manage command you want.

There's also./run shell which is a shortcut to open a Bash shell. You can run./run to get a list of all commands and add your own. There's also./run cmd <anything> so you can run any arbitrary command that's not defined in therun script.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@hiwigiwi@nickjj

[8]ページ先頭

©2009-2025 Movatter.jp