Run command line and provide below commands (make sure you are in directory with manage.py file) :
$ python manage.py migrate # create necessary files for database manage (default database system is SQLite)
$ python manage.py runserver 8080 # run server with our application, should works at http://localhost:8080 in web browser
If your server is working use Ctrl + C (Cmd + C on Mac) to stop server, run this command :
$ python manage.py createsuperuser # it will adding admin user creator, provide necessary data (username, email and password)
start server:
$ python manage.py runserver 8080
Navigate to http://localhost:8080/admin and login with credits provided before
Please ensure that you have docker installed on your system (https://docs.docker.com/engine/installation/)
To run example in docker enviroment follow this steps:
- Download repository
git clone https://github.com/TRaffii/DjangoSimpleExampleProject.git
- Go to project directory
cd DjangoSimpleExampleProject
- Change chmod of docker-entrypoint.sh file
chmod u+x docker-entrypoint.sh
- Build docker image
sudo docker build -t <youruser>/mentor_candidate:latest .
Where is you unique username
- Run image
sudo docker run --publish=<yourip>:8080:8080 <youruser>/mentor_candidate
Where yourip is our computer ip for example 192.168.0.10
Then you should be able to login in http://192.168.0.10/admin with below credits:
- user: admin
- password: password12345