civictechindex / cti-website-backend Goto Github PK
View Code? Open in Web Editor NEWPython-Django based backend for Civic Tech Index
License: MIT License
Python-Django based backend for Civic Tech Index
License: MIT License
We should not be using DEBUG=True in our containers on AWS. But if we turn that to False with our current set up, we don't get any of the static files served. Install nginx in the container and serve static files from that and the dynamic stuff by proxying to gunicorn.
Hello there!
The Ops team is changing the way we deploy applications in Incubator, and we need the help of someone on this project to accomplish that. Thanks in advance!
There was a project.hcl
file created and edited by a member of this project at one point - they'll need to be the one to participate.
There's an epic issue that describes the overall process: hackforla/incubator#20
Please follow the guide there to effect the Terraform migration of this project's deployment!
The Issue above has all the details you should need. We're using it as a central clearinghouse, so we'll updating it with any new information or clarifications so that we can help everybody.
Please reach out to @nyarly (@judson on slack) or @JasonEb (same handle) with any questions.
# django-admin dumpdata faqs
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 8, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 368, in execute
self.check()
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 392, in check
all_issues = checks.run_checks(
File "/usr/local/lib/python3.8/site-packages/django/core/checks/registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/usr/local/lib/python3.8/site-packages/django/core/checks/security/base.py", line 236, in check_default_hashing_algorithm
if settings.DEFAULT_HASHING_ALGORITHM not in {'sha1', 'sha256'}:
File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
self._setup(name)
File "/usr/local/lib/python3.8/site-packages/django/conf/__init__.py", line 63, in _setup
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_HASHING_ALGORITHM, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
#
Export environment variable pointing to settings file. It seems that for cti-website-backend_web
container configuration is located in /CTI-website-backend/config/settings.py
file
We need to create an API for Index Contributors filter so it can be used on the Organizations page.
civictechindex
Based on the experience adding Alias
API/Model to the backend provide a step-by-step summary.
To Do:
We have some work to do deploying the site to H4LA's new incubator infrastructure (AWS, terraform, terragrunt). We need to do some GitHub Actions work to automate deploying there. And there are a couple of scripts that need writing to fill in data from GitHub APIs; it's probably most convenient to do those in Python so we can use the Django ORM to put things into the database.
Samples:
hack-for-la
, hackforla
, hack4la
, hack-4-la
code-for-america
, codeforamerica
, code-4-america
, code4america
civictechindex
, civic-tech-index
We need to put a try/except around saving the org and then return sensible error messages in JSON format.
Example of an error we need to catch and report:
IntegrityError at /api/organizations/
duplicate key value violates unique constraint "data_organization_name_key"
DETAIL: Key (name)=(test org 2) already exists.
Request Method: POST
Request URL: http://localhost:8888/api/organizations/
Django Version: 3.1.8
Exception Type: IntegrityError
Exception Value:
duplicate key value violates unique constraint "data_organization_name_key"
DETAIL: Key (name)=(test org 2) already exists.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.