Giter Club home page Giter Club logo

opensalve's People

Contributors

123vivekr avatar agzuniverse avatar aswinmprabhu avatar de-sh avatar raeeska avatar subins2000 avatar tomahawk-pilot avatar

Watchers

 avatar

opensalve's Issues

Django production deployment check is displaying warnings

Please run the command below:

$ ./manage.py check --deploy
System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W006) Your SECURE_CONTENT_TYPE_NOSNIFF setting is not set to True, so your pages will not be served with an 'x-content-type-options: nosniff' header. You should consider enabling this header to prevent the browser from identifying content types incorrectly.
?: (security.W007) Your SECURE_BROWSER_XSS_FILTER setting is not set to True, so your pages will not be served with an 'x-xss-protection: 1; mode=block' header. You should consider enabling this header to activate the browser's XSS filtering and help prevent XSS attacks.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W016) You have 'django.middleware.csrf.CsrfViewMiddleware' in your MIDDLEWARE, but you have not set CSRF_COOKIE_SECURE to True. Using a secure-only CSRF cookie makes it more difficult for network traffic sniffers to steal the CSRF token.
?: (security.W018) You should not have DEBUG set to True in deployment.
?: (security.W019) You have 'django.middleware.clickjacking.XFrameOptionsMiddleware' in your MIDDLEWARE, but X_FRAME_OPTIONS is not set to 'DENY'. The default is 'SAMEORIGIN', but unless there is a good reason for your site to serve other parts of itself in a frame, you should change it to 'DENY'.

System check identified 8 issues (0 silenced).

Location Storage Method

From subins2000#12

Currently, In the Requests Table, the location (lat, long) is stored in CharField , Change all of them to Geolocation fields, take a look at PostGIS for implementation.

Comment Model Error

From subins2000#13

The Comments Model designed to comment on the status of a particular Request by a user does not have a logical connection to a Requests Model.

A Foreign key is required from the Comments table onto the Requests table.

Date Modified for Requests Table

From subins2000#14

Add a date_modified column into the Requests Model, it should be updated as the status changes, that way we can know exactly when the status was changed, calculate the time taken to reflect on the request and all that valuable info.

Cant run makemigrations

while running python3 manage.py makemigrations && python manage.py i am getting the following error:

$ pipenv run python manage.py makemigrations
Loading .env environment variables…
Traceback (most recent call last):
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/rest_framework/settings.py", line 177, in import_from_string
    return import_string(val)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/utils/module_loading.py", line 17, in import_string
    module = import_module(module_path)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/drf_yasg/generators.py", line 11, in <module>
    from rest_framework.schemas.generators import SchemaGenerator, endpoint_ordering
ImportError: cannot import name 'SchemaGenerator'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/base.py", line 350, in execute
    self.check()
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/base.py", line 379, in check
    include_deployment_checks=include_deployment_checks,
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/base.py", line 366, in _run_checks
    return checks.run_checks(**kwargs)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/checks/registry.py", line 71, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/urls/resolvers.py", line 396, in check
    for pattern in self.url_patterns:
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/urls/resolvers.py", line 533, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/urls/resolvers.py", line 526, in urlconf_module
    return import_module(self.urlconf_name)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/gautam/workspace/OpenSlaveAPI/opensalve/urls.py", line 19, in <module>
    from drf_yasg.views import get_schema_view
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/drf_yasg/views.py", line 48, in <module>
    generator_class=swagger_settings.DEFAULT_GENERATOR_CLASS,
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/drf_yasg/app_settings.py", line 111, in __getattr__
    val = perform_import(val, attr)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/rest_framework/settings.py", line 166, in perform_import
    return import_from_string(val, setting_name)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/rest_framework/settings.py", line 180, in import_from_string
    raise ImportError(msg)
ImportError: Could not import 'drf_yasg.generators.OpenAPISchemaGenerator' for API setting 'DEFAULT_GENERATOR_CLASS'. ImportError: cannot import name 'SchemaGenerator'.

cannot use .env to set DJANGO_SECRET_KEY

While running migration script it is throwing the error:

(OpenSlaveAPI) gautam@api:~/workspace/OpenSlaveAPI$ cat .env
DJANGO_SECRET_KEY='D^#c09H&zwaCjJ!*l0PYr%q!iSToS=jGZlvl(dfXqds2m%W8fW9@_+_JIKBCJrpsf)Xc+5t6J6X$j$&vFGq1wO8Ic1hw7px'

(OpenSlaveAPI) gautam@api:~/workspace/OpenSlaveAPI$ python3 manage.py makemigrations && python manage.py migrate
Traceback (most recent call last):
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/environ/environ.py", line 273, in get_value
    value = self.ENVIRON[var]
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'D^#c09H&zwaCjJ!*l0PYr%q!iSToS=jGZlvl(dfXqds2m%W8fW9@_+_JIKBCJrpsf)Xc+5t6J6X$j$&vFGq1wO8Ic1hw7px'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/__init__.py", line 36, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py", line 12, in <module>
    from django.db.migrations.autodetector import MigrationAutodetector
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 11, in <module>
    from django.db.migrations.questioner import MigrationQuestioner
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/migrations/questioner.py", line 9, in <module>
    from .loader import MigrationLoader
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/migrations/loader.py", line 8, in <module>
    from django.db.migrations.recorder import MigrationRecorder
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 9, in <module>
    class MigrationRecorder:
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 22, in MigrationRecorder
    class Migration(models.Model):
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/db/models/base.py", line 87, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/apps/registry.py", line 249, in get_containing_app_config
    self.check_apps_ready()
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/apps/registry.py", line 131, in check_apps_ready
    settings.INSTALLED_APPS
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
    self._setup(name)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/django/conf/__init__.py", line 107, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/gautam/workspace/OpenSlaveAPI/opensalve/settings.py", line 34, in <module>
    SECRET_KEY = env('DJANGO_SECRET_KEY')
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/environ/environ.py", line 123, in __call__
    return self.get_value(var, cast=cast, default=default, parse_default=parse_default)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/environ/environ.py", line 284, in get_value
    value = self.get_value(value, cast=cast, default=default)
  File "/home/gautam/.local/share/virtualenvs/OpenSlaveAPI-WVGInhZm/lib/python3.6/site-packages/environ/environ.py", line 277, in get_value
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the D^#c09H&zwaCjJ!*l0PYr%q!iSToS=jGZlvl(dfXqds2m%W8fW9@_+_JIKBCJrpsf)Xc+5t6J6X$j$&vFGq1wO8Ic1hw7px environment variable

Python version: 3.6.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.