Comments (3)
For Docker we're going to use environment variables passed through to the container to configure things like this, would what work for Vagrant too?
from gettogether.
Yes, we can. There are two options
- we can use the env line like below
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
# config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 8000, host: 8080
# config.vm.network "public_network"
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get upgrade -y
apt-get install -y python3 python3-pip
SHELL
config.vm.provision "shell",
env: {"DEBUG" => "#{ENV['DEBUG']}"},
run: "always",
inline: <<-SHELL
cd /vagrant
pip3 install -r requirements.txt
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000
SHELL
end
- We could create an env file to load:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
# config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 8000, host: 8080
# config.vm.network "public_network"
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get upgrade -y
apt-get install -y python3 python3-pip
SHELL
config.vm.provision "shell",
run: "always",
inline: <<-SHELL
cd /vagrant
source envfile
pip3 install -r requirements.txt
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000
SHELL
end
While both of these examples would work, they're not perfect (I knocked them up in a couple of minutes) :)
from gettogether.
I've added an environ_settings.py that will let you set certain config values from your environment variables. You can use it either by adding --settings=get_together.environ_settings
to the end of your manage.py command, or by setting DJANGO_SETTINGS_MODULE=get_together.environ_settings
in your environment.
And example command would be:
DJANGO_SETTINGS_MODULE='get_together.environ_settings' DATABASE_URL='sqlite:////path/to/your/db.sqlite3' SECRET_KEY='foobar' python3 manage.py runserver 0.0.0.0:8000
DATABASE_URL follows this project's spec and requires pip installing dj-database-url (which is now in the requirements.txt).
I hope this does what you need it to do. If not, let me know what's missing.
from gettogether.
Related Issues (20)
- Requesting too broad OAuth permissions from Twitter
- After login: not enough arguments for format string HOT 3
- Event Comment loses line formatting in the email
- doesnt delete events HOT 3
- Cancelled events still appear in ics
- Pack for Debian
- iCal lacks time zone information HOT 4
- Telegram link in README shows invalid or expired, does not seem to exist HOT 1
- Locations no longer working on the main site (gettogether.community) HOT 1
- Github login yields server error on main site HOT 1
- "error: pathspec 'master' did not match any file(s) known to git" when running pre-commit
- Telegram Link expired (on gettogether.community/about/)
- GetTogether.community content is used to train LLMs
- Escape new lines from JSON-ld data
- gettogether.community is currently returning a 500 Internal Error
- Maintenance and moving GetTogether forward HOT 11
- Display timezone for Profiles and Events when creating, editing and viewing them
- Option to report spam events / block accounts.
- Viewing all teams on gettogether.community results in an error.
- Home health care tampa
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gettogether.