diff --git a/CACHEDIR.TAG b/CACHEDIR.TAG new file mode 100644 index 000000000..837feeff9 --- /dev/null +++ b/CACHEDIR.TAG @@ -0,0 +1,4 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by Python virtualenv. +# For information about cache directory tags, see: +# https://bford.info/cachedir/ \ No newline at end of file diff --git a/WeVoteServerCheatSheet.md b/WeVoteServerCheatSheet.md index 8904cfa4c..0c2ba4b3d 100644 --- a/WeVoteServerCheatSheet.md +++ b/WeVoteServerCheatSheet.md @@ -26,7 +26,7 @@ psql (PostgreSQL) 14.0 #### Setting up ngrok to send stripe webhooks to your local python server ``` -(WeVoteServerPy3.7) Steves-MacBook-Pro-32GB-Oct-2018:PycharmProjects stevepodell$ ~/PythonProjects/ngrok http 8000 -host-header="localhost:8000" +(WeVoteServerPy3.7) Steves-MacBook-Pro-32GB-Oct-2018:PycharmProjects stevepodell$ ~/PythonProjects/ngrok http 8000 -host-header="https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:8000" ``` A very useful http inspector is made available by ngrok at [http://127.0.0.1:4040/inspect/http](http://127.0.0.1:4040/inspect/http) @@ -109,15 +109,15 @@ There has to be a better way to do this, but this is what I went through... 2020-04-03 21:34:14.414 PDT [13229] HINT: Is another postmaster (PID 13133) running in data directory "/usr/local/var/postgres"? (WeVoteServerPy3.7) stevepodell@Steves-MacBook-Pro-32GB-Oct-2018 var % !lsof lsof -i -P | grep post - postgres 13133 stevepodell 5u IPv6 0x9139afcc2c95ec77 0t0 TCP localhost:5432 (LISTEN) - postgres 13133 stevepodell 6u IPv4 0x9139afcc08c6d697 0t0 TCP localhost:5432 (LISTEN) - postgres 13133 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13135 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13136 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13137 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13138 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13139 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 - postgres 13140 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP localhost:57308->localhost:57308 + postgres 13133 stevepodell 5u IPv6 0x9139afcc2c95ec77 0t0 TCP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:5432 (LISTEN) + postgres 13133 stevepodell 6u IPv4 0x9139afcc08c6d697 0t0 TCP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:5432 (LISTEN) + postgres 13133 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13135 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13136 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13137 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13138 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13139 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 + postgres 13140 stevepodell 10u IPv6 0x9139afcc016b2ecf 0t0 UDP https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308->https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:57308 (WeVoteServerPy3.7) stevepodell@Steves-MacBook-Pro-32GB-Oct-2018 var % ``` #### Adding a new "app" (directory of Python classes) to the WeVoteServer diff --git a/apis_v1/documentation_source/site_configuration_retrieve_doc.py b/apis_v1/documentation_source/site_configuration_retrieve_doc.py index dcfc71edc..089a26207 100644 --- a/apis_v1/documentation_source/site_configuration_retrieve_doc.py +++ b/apis_v1/documentation_source/site_configuration_retrieve_doc.py @@ -34,7 +34,7 @@ def site_configuration_retrieve_doc_template_values(url_root): }, ] try_now_link_variables_dict = { - 'hostname': 'localhost', + 'hostname': 'https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev', } api_response = '{\n' \ diff --git a/apis_v1/urls.py b/apis_v1/urls.py index 10db01df2..45dd9bc32 100644 --- a/apis_v1/urls.py +++ b/apis_v1/urls.py @@ -9,6 +9,8 @@ from django.conf import settings from django.conf.urls import re_path from django.conf.urls.static import static +from django.contrib import admin +from django.urls import path from apis_v1.views import views_activity, views_apple, views_docs, views_analytics, views_ballot, \ views_campaign, views_candidate, views_donation, \ @@ -33,6 +35,7 @@ from voter_guide.views_admin import voter_guides_sync_out_view urlpatterns = [ + path('admin/', admin.site.urls), # Actual API Calls re_path(r'^activityCommentSave/', views_activity.activity_comment_save_view, name='activityCommentSaveView'), diff --git a/apis_v1/views/views_activity.py b/apis_v1/views/views_activity.py index e05e507e9..9cff16372 100644 --- a/apis_v1/views/views_activity.py +++ b/apis_v1/views/views_activity.py @@ -2,8 +2,11 @@ # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- + from datetime import datetime, timedelta from django.http import HttpResponse + +from django.core.exceptions import ImproperlyConfigured import json import threading import time @@ -21,11 +24,27 @@ from voter.models import fetch_voter_we_vote_id_from_voter_device_link, VoterManager, VoterDeviceLinkManager, \ VoterDeviceLink from wevote_functions.functions import get_voter_device_id, positive_value_exists, wevote_functions +import os +from django.core.exceptions import ImproperlyConfigured +from wevote_functions.functions import wevote_functions -logger = wevote_functions.admin.get_logger(__name__) +def get_environment_variable(var_name): + try: + return os.environ[var_name] + except KeyError: + error_msg = f"ERROR: Unable to set the {var_name} variable from os.environ or JSON file" + raise ImproperlyConfigured(error_msg) +# Use the correct environment variable names WE_VOTE_SERVER_ROOT_URL = get_environment_variable("WE_VOTE_SERVER_ROOT_URL") +STRIPE_SECRET_KEY = get_environment_variable("STRIPE_SECRET_KEY") +if not STRIPE_SECRET_KEY.startswith('sk_'): + raise ImproperlyConfigured("Configuration error, the stripe secret key, must begin with 'sk_' -- don't use the publishable key on the server!") + + + +logger = wevote_functions.admin.get_logger(__name__) def activity_comment_save_view(request): # activityCommentSave """ diff --git a/apis_v1/views/views_organization.py b/apis_v1/views/views_organization.py index f8322a1e4..a666677a1 100644 --- a/apis_v1/views/views_organization.py +++ b/apis_v1/views/views_organization.py @@ -234,7 +234,7 @@ def organization_index_view(request, organization_incoming_domain='', campaign_m else: req_url = 'https://wevote.us/main.name.html' - verify_bool = not ('localhost' in organization_incoming_domain or '127.0.0.1' in organization_incoming_domain) + verify_bool = not ('https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev' in organization_incoming_domain or '127.0.0.1' in organization_incoming_domain) text = requests.get(req_url, verify=verify_bool).text main_js = re.search(r"
(.*?)<\/body>", text)[1] diff --git a/apis_v1/views/views_voter.py b/apis_v1/views/views_voter.py index 463721b06..dc51913ad 100644 --- a/apis_v1/views/views_voter.py +++ b/apis_v1/views/views_voter.py @@ -929,6 +929,7 @@ def voter_email_address_retrieve_view(request): # voterEmailAddressRetrieve 'email_address_list': results['email_address_list'], } return HttpResponse(json.dumps(json_data), content_type='application/json') + def voter_email_address_save_view(request): # voterEmailAddressSave diff --git a/backend/backend/__init__.py b/backend/backend/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/backend/__pycache__/__init__.cpython-313.pyc b/backend/backend/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..55e5a773e Binary files /dev/null and b/backend/backend/__pycache__/__init__.cpython-313.pyc differ diff --git a/backend/backend/__pycache__/settings.cpython-313.pyc b/backend/backend/__pycache__/settings.cpython-313.pyc new file mode 100644 index 000000000..572c23c5b Binary files /dev/null and b/backend/backend/__pycache__/settings.cpython-313.pyc differ diff --git a/backend/backend/__pycache__/urls.cpython-313.pyc b/backend/backend/__pycache__/urls.cpython-313.pyc new file mode 100644 index 000000000..9d20cc767 Binary files /dev/null and b/backend/backend/__pycache__/urls.cpython-313.pyc differ diff --git a/backend/backend/__pycache__/wsgi.cpython-313.pyc b/backend/backend/__pycache__/wsgi.cpython-313.pyc new file mode 100644 index 000000000..3814be99f Binary files /dev/null and b/backend/backend/__pycache__/wsgi.cpython-313.pyc differ diff --git a/backend/backend/asgi.py b/backend/backend/asgi.py new file mode 100644 index 000000000..ed01e6acf --- /dev/null +++ b/backend/backend/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for backend project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_asgi_application() diff --git a/backend/backend/settings.py b/backend/backend/settings.py new file mode 100644 index 000000000..76d714a8a --- /dev/null +++ b/backend/backend/settings.py @@ -0,0 +1,144 @@ +""" +Django settings for backend project. + +Generated by 'django-admin startproject' using Django 5.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path +import os + +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +STATIC_URL = '/static/' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'frontend/build/static'), +] + + + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-+_!0maxfp^0v=nfo-=%x_pho-=(negl=9w97!mw!7*3369=sna' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + + # own apps + 'greetings', + 'rest_framework', + 'corsheaders', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'corsheaders.middleware.CorsMiddleware', +] + +CORS_ORIGIN_WHITELIST = [ + 'http://localhost:3000', + +] + +ROOT_URLCONF = 'backend.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'frontend/build')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'backend.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/backend/backend/urls.py b/backend/backend/urls.py new file mode 100644 index 000000000..787d8734f --- /dev/null +++ b/backend/backend/urls.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from django.urls import path, include +from django.views.generic import TemplateView + +urlpatterns = [ + path('admin/', admin.site.urls), + path('api/', include('greetings.urls')), + path('', TemplateView.as_view(template_name='index.html')), +] diff --git a/backend/backend/wsgi.py b/backend/backend/wsgi.py new file mode 100644 index 000000000..07bda9da7 --- /dev/null +++ b/backend/backend/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for backend project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_wsgi_application() diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 new file mode 100644 index 000000000..6efdfddbc Binary files /dev/null and b/backend/db.sqlite3 differ diff --git a/backend/greetings/__init__.py b/backend/greetings/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/greetings/__pycache__/__init__.cpython-313.pyc b/backend/greetings/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..36f408c41 Binary files /dev/null and b/backend/greetings/__pycache__/__init__.cpython-313.pyc differ diff --git a/backend/greetings/__pycache__/admin.cpython-313.pyc b/backend/greetings/__pycache__/admin.cpython-313.pyc new file mode 100644 index 000000000..7949b70c1 Binary files /dev/null and b/backend/greetings/__pycache__/admin.cpython-313.pyc differ diff --git a/backend/greetings/__pycache__/apps.cpython-313.pyc b/backend/greetings/__pycache__/apps.cpython-313.pyc new file mode 100644 index 000000000..2fd40a96c Binary files /dev/null and b/backend/greetings/__pycache__/apps.cpython-313.pyc differ diff --git a/backend/greetings/__pycache__/models.cpython-313.pyc b/backend/greetings/__pycache__/models.cpython-313.pyc new file mode 100644 index 000000000..cf16c4c38 Binary files /dev/null and b/backend/greetings/__pycache__/models.cpython-313.pyc differ diff --git a/backend/greetings/__pycache__/urls.cpython-313.pyc b/backend/greetings/__pycache__/urls.cpython-313.pyc new file mode 100644 index 000000000..59530b469 Binary files /dev/null and b/backend/greetings/__pycache__/urls.cpython-313.pyc differ diff --git a/backend/greetings/__pycache__/views.cpython-313.pyc b/backend/greetings/__pycache__/views.cpython-313.pyc new file mode 100644 index 000000000..9c50ba1e5 Binary files /dev/null and b/backend/greetings/__pycache__/views.cpython-313.pyc differ diff --git a/backend/greetings/admin.py b/backend/greetings/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/backend/greetings/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/backend/greetings/apps.py b/backend/greetings/apps.py new file mode 100644 index 000000000..42a4adeaf --- /dev/null +++ b/backend/greetings/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class GreetingsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'greetings' diff --git a/backend/greetings/migrations/__init__.py b/backend/greetings/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/greetings/migrations/__pycache__/__init__.cpython-313.pyc b/backend/greetings/migrations/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 000000000..be2bdf464 Binary files /dev/null and b/backend/greetings/migrations/__pycache__/__init__.cpython-313.pyc differ diff --git a/backend/greetings/models.py b/backend/greetings/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/backend/greetings/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/backend/greetings/tests.py b/backend/greetings/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/backend/greetings/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/backend/greetings/urls.py b/backend/greetings/urls.py new file mode 100644 index 000000000..2db375028 --- /dev/null +++ b/backend/greetings/urls.py @@ -0,0 +1,16 @@ +# from django.urls import path +# from .views import greet + + +# urlpatterns = [ +# path('greet/', greet, name='greet'), +# ] + +from django.urls import path +from django.views.generic import TemplateView +from . import views # Eğer views.py'deki greet fonksiyonunu kullanıyorsanız + +urlpatterns = [ + path('', TemplateView.as_view(template_name="index.html")), # React'in index.html'i + path('greet/', views.greet, name='greet'), # Greet API endpoint'i +] diff --git a/backend/greetings/views.py b/backend/greetings/views.py new file mode 100644 index 000000000..6adf07821 --- /dev/null +++ b/backend/greetings/views.py @@ -0,0 +1,11 @@ +#from django.shortcuts import render + +# Create your views here. +from rest_framework.decorators import api_view +from rest_framework.response import Response + +@api_view(['POST']) +def greet(request): + name = request.data.get('name', 'Guest') + return Response({'message': f'Hello, {name}!'}) + diff --git a/backend/manage.py b/backend/manage.py new file mode 100644 index 000000000..eb6431e2c --- /dev/null +++ b/backend/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/bin/activate b/bin/activate new file mode 100644 index 000000000..abf1b539f --- /dev/null +++ b/bin/activate @@ -0,0 +1,87 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + +deactivate () { + unset -f pydoc >/dev/null 2>&1 || true + + # reset old environment variables + # ! [ -z ${VAR+_} ] returns true if VAR is declared at all + if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then + PATH="$_OLD_VIRTUAL_PATH" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then + PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # The hash command must be called to get it to forget past + # commands. Without forgetting past commands the $PATH changes + # we made may not be respected + hash -r 2>/dev/null + + if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then + PS1="$_OLD_VIRTUAL_PS1" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV=/workspaces/WeVoteServer +if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then + VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV") +fi +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/"bin":$PATH" +export PATH + +if [ "x"'' != x ] ; then + VIRTUAL_ENV_PROMPT='' +else + VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV") +fi +export VIRTUAL_ENV_PROMPT + +# unset PYTHONHOME if set +if ! [ -z "${PYTHONHOME+_}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1-}" + PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}" + export PS1 +fi + +# Make sure to unalias pydoc if it's already there +alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true + +pydoc () { + python -m pydoc "$@" +} + +# The hash command must be called to get it to forget past +# commands. Without forgetting past commands the $PATH changes +# we made may not be respected +hash -r 2>/dev/null || true diff --git a/bin/activate.csh b/bin/activate.csh new file mode 100644 index 000000000..b03925530 --- /dev/null +++ b/bin/activate.csh @@ -0,0 +1,55 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi
9. Switch to "Connection" tab, and enter the following information:
- * Host name: localhost
+ * Host name: https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev
* Port: 5432
* Maintenance database: postgres
* User name: postgres
@@ -450,7 +450,7 @@ this step. To see if postgres is already running, check with lsof in a terminal
At WeVote, we call end users "voters". This new "voter" will have all the
rights that you (as a developer) need to log in to
- [http://localhost:8000/admin/](http://localhost:8000/admin/). Once logged in you can start synchronizing data (downloading ballot and issue
+ [https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:8000/admin/](https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:8000/admin/). Once logged in you can start synchronizing data (downloading ballot and issue
data from the master server in the cloud, to your local server).
The usage is: `python manage.py create_dev_user first_name last_name email password`
@@ -462,7 +462,7 @@ this step. To see if postgres is already running, check with lsof in a terminal
(WeVoteServer3.7) admin$
```
-1. Navigate to [http://localhost:8000/admin/](http://localhost:8000/admin/) and sign in with your new username/password.
+1. Navigate to [https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:8000/admin/](https://super-lamp-44gw5w5jjwp3jrpr-8000.app.github.dev:8000/admin/) and sign in with your new username/password.
1. Your local instance of the WeVoteServer is now setup and running (although there is no election
data stored in your Postgres instance, for it to serve to clients at this point).
diff --git a/docs/README_WORKING_WITH_WE_VOTE_SERVER.md b/docs/README_WORKING_WITH_WE_VOTE_SERVER.md
index 3329f7d0f..12acc076c 100644
--- a/docs/README_WORKING_WITH_WE_VOTE_SERVER.md
+++ b/docs/README_WORKING_WITH_WE_VOTE_SERVER.md
@@ -26,15 +26,15 @@ Here are some commands we use quite a lot:
$ source /Users/
+
+