Django project, apps structure and folders

- apples
- mysite
- apples
- docker
- mysite
- apples
- docker
- mysite
- oranges
- apps
- docker
- mysite
'apps.your_app_name'
INSTALLED_APPS += ['apps.apples']
#!/usr/bin/env bash

if [ "$1" == "-h" ]; then
echo "This script will create an app inside the apps folder"
echo "To use type the following line:"
echo "bash start-app.sh app_name"
echo "Replace app_name with the actual name for your app"
elif [ "$1" != "" ]; then
if [ ! -d "apps" ]; then
mkdir apps
touch apps/__init__.py
fi
mkdir apps/$1
if [ -f /.dockerenv ]; then
python manage.py startapp $1 apps/$1
else
docker-compose run django python manage.py startapp $1 apps/$1
fi
echo "Success! The app $1 has been aded, don't forget to add INSTALLED_APPS += ['apps.$1'] in your project's settings.py"
else
echo "Error! One parameter is expected: app_name"
fi
bash start-app.sh app_name

--

--

Coder, Entrepreneur, Co-founder at SlowCode

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store