Development Without Docker
You can also work develop directly on your host OS. Be aware that your local development environment may be different from production. Which may cause your app to work unpredictably.
Create a virtual environment
We suggest using a virtual environment if you developing directly on your OS.
Example for Mac OS.
python3 -m venv .venv
source .venv/bin/activate
Install package requirements
cd 'your project'
pip install -r requirements.txt
Install redis
Caching and Huey, the task worker queue are set up to use redis.
-
Installation on Mac
text$ brew update brew install redis
-
Other OS - Visit redis.io to download and setup a local instance of redis.
-
Online redis instance - create an online instance redis.io [freee forever]
Install Postgres
Visit the PostgreSQL site to download and install Postgres.
If you have installed Postgres, edit the
DATABASES
value
config/base.py/settings.py
with the appropriate details.
You will also need to create a database for your project if you haven't already:
$ sudo -u postgres createdb {{ project_name }}
Running the app
Create database migrations
$ python ./manage.py makemigrations
Run database migrations
# python ./manage.py migrate
Run server
$ python ./manage.py runserver
Run tailwind cli tool
In another terminal, run the cli tool to compile your CSS and watch for changes
$ npm install
$ npm run watch
Go to http://localhost:8000 and you should see the default landing page!
Creating your first user
The Vanty Starter Kit Sign-up flow works out of the box. By default, you can already register and log in as a user.
However, for development, it is necessary to create a superuser that will be able to access the Django admin and Control Panel .
We added a modified createsuperuser command that will also create a tenant for the new superuser.
# make file
$ make verified_superuser
# cli
$ python -m cli dev start
The command above will prompt you to add a password and will automatically create a superuser that uses the email that you specified when building the project. To use another email run the command manually like below.
$ python manage.py create_verified_superuser email@example.com