Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## On windows
- ####################################################################
- @ECHO OFF
- # open command, activate your 'env' my 'env called' (salesenv)
- # then run the project by manage.py command
- start cmd.exe /k "D:\Django\win_envs\salesenv\Scripts\activate && cd D:\Django\projects\stock\stockapp\kmastock\ && python manage.py runserver 0.0.0.0:8000"
- # open Opera browser on windows 10
- start C:\Users\Root\AppData\Local\Programs\Opera\launcher.exe "http://localhost:8000"
- ##################################################################################
- ## On Linux
- ##################################################################################
- #!/bin/bash
- # activate the virtualenv
- source ~/Django_envs/eventenv/bin/activate
- # Restart Database service
- /etc/init.d/postgresql restart
- echo '.......... Activating the virtualenv..'
- echo '.................'
- echo '..Then execute main files'
- # Check if database is prepared
- python ~/challenge/mysite/manage.py makemigrations --settings=mysite.settings
- python ~/challenge/myproject/manage.py migrate --settings=mysite.settings
- # Collect static files
- python ~/challenge/mysite/manage.py collectstatic --settings=mysite.settings
- # execute the manage.py file
- python ~/challenge/mysite/manage.py runserver 0.0.0.0:8005 --settings=mysite.settings
Add Comment
Please, Sign In to add comment