Skip to content

Demo webapp with Selenium, Docker, Django, Postgresql, Celery, RabbitMQ, Django channels and Redis.

Notifications You must be signed in to change notification settings

Aleksi44/django-selenium-docker

Repository files navigation

Django Selenium Docker

Here is a webapp that displays the Selenium window preview in a Django Admin.

Selenium Docker preview

In this simple example, we display the urls of the following pages:

This minimalist webapp was designed to help you configure the Python ecosystem with Selenium.

The webapp uses the following services :

Run the webapp

Run with Docker

1 - Check and stop all the following services if they are running on your local machine :

service rabbitmq-server stop
service postgresql stop
service redis-server stop

2 - And run :

docker-compose up
docker-compose exec -T app python manage.py on_start --settings=settings.production

3 - Login with django:selenium at :

http://127.0.0.1:8001/

Or run locally

1 - You need to run/install these services :

sudo service rabbitmq-server start
sudo service redis-server start
sudo service postgresql start

2 - Then configure your database by following the Django settings.dev configuration :

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'app',
        'USER': 'app_user',
        'PASSWORD': 'changeme',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

3 - Then launch the webapp and the worker :

export DJANGO_SETTINGS_MODULE=settings.dev
pip install -r requirements.txt
python manage.py on_start --settings=settings.dev
python manage.py runserver 127.0.0.1:4243 -v 3 --settings=settings.dev
celery -A app.core worker -l info

4 - Login with django:selenium at :

http://127.0.0.1:4243/