Re: Django Courier Management System Project

2018-11-12 Thread ramakurthy swamy
bro i also be a part of your project

On Tue, Nov 13, 2018 at 1:09 AM sakkhar saha 
wrote:

> Dear All,
> I am Sakkhar form Bangladesh. Now I have a project idea. And i am a single
> man. My Project is Courier Management in Djnago. Please help for the idea.
> How i start my project. And How i Design my database table.
> My Project Feature.
>
> 1. User Can Add Your Order and Track his order.
> 2. Admin Can Add Order and Order complete and pending.
> 3. Admin Approve User.
> 4. When user order confirm than user give an email notification.
> 5. And Finally when Admin deliver the order than user give an email
> notification.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cea6f464-55fb-43c8-bef6-b438212235e9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHa6oC9zqRYsgeJ4dKwxNH%2B84V2ap56BUoZQybyU_rfJ7Aor7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst
Another thought

Django admin has a built-in mechanism for password management. It includes 
forms with password widgets.Perhaps you could hack your own encryption of 
the cloud credentials based on the Django approach to passwords.

It is possible to add forms to the Admin and include your own logic. I have 
done that - without the extra credentials part - to create additional data 
based on converting a @domain added to a username into a company name and 
company profile.

Mike

On Monday, November 12, 2018 at 12:47:56 AM UTC+11, Lance Haig wrote:
>
> Hi, 
>
> I have a project I am working on https://github.com/lhaig/usery/ and 
> part of the roadmap of the project is to add more cloud types to the list. 
>
> I wanted to allow admins for these services to login and create records 
> for their different clouds in the DB and then use these when people 
> request access to these services. 
>
> I need to find a secure way to store these credentials so that even if 
> the DB is compromised that the credentials are safe. 
>
> Does anyone have suggestions on how I can accomplish this? 
>
> I would really appreciate some advice. 
>
> Regards 
>
> Lance 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df4e7fc2-cf4d-4742-9fd3-adc1e7d037c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PDF extarcting

2018-11-12 Thread Manjunath
I think regular expression would be a better option for your requirements.
If you provide some sample resume docs, we can help better.

On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801 Yadhav 
wrote:
>
> Hi everyone, there is a project given to us to develop an application 
> I need to extract data from resume only specific fields like name, mail, 
> dob, phone number   by importing a package pyPdf2 I can only extract a data 
> to text the whole part but there is no need of whole data only specific 
> data need to extract 
> if any were are familiar with pdPdf2 extracting the data please help me 
> .!!
>
>
> thanks
> Swathi
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Redesign

2018-11-12 Thread Phako Perez
If I remember correctly you can define your own templates under the template 
directory

Regards

Sent from my iPhone

> On Nov 12, 2018, at 4:49 PM, Zakriya Bilal  wrote:
> 
> I am starting a project in which one of the requirements is to have a custom 
> designed Admin panel. 
> 
> So my question is: Is it possible to redesign the Django Admin panel? 
> Majority of the requirements are related to Front-end design? Is it a good 
> idea to redesign the front-end or just create a new admin area from scratch?
> 
> I ask because the design of the admin panel is important. 
> 
> Just to put it out there, I am coming from Laravel World. 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5544f0cd-5be7-4c91-a2ae-83c4b77dcfa7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CD14A672-D2B0-477A-8CBE-85E2D6A1417F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Devender Kumar
Hi
Study about LDAP protocol
Regards
Dev

On Tue 13 Nov, 2018, 4:06 AM PASCUAL Eric  Hi Lance,
>
>
> Well, I was off topic. Sorry for this :/ I understand your need better
> now.
>
>
> There are chances you've already thought to this option, but what about
> storing the sensitive data encrypted with a key based on a passphrase the
> user must provide when logging, in addition to the usual credentials ? This
> passphrase would not be stored anywhere, so even if the DB is compromised,
> the sensitive data would not be usable.
>
>
> Eric
> --
> *From:* django-users@googlegroups.com  on
> behalf of Lance Haig 
> *Sent:* Monday, November 12, 2018 4:45:50 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: How do I store details securely with django?
>
>
> Hi Eric,
>
> I am sure I have not explained myself properly.
>
> The app does the following.
>
> It presents a user the ability to sign up to a cloud platform for a
> sandbox / playground account.
> The number of cloud services that are available will change over time.
>
> Each cloud platform has a set of credentials (username, password, domain
> etc...) These credentials will have elevated permissions within their own
> environments and so should be kept as safe as possible.
>
> Currently I use secrets and .env files to provide these credentials.
> This requires physical access to the platform to add new secrets etc...
>
> I want to enable editing (e.g. CRUD on the platform credentials) without
> having to redeploy the application or update the secrets.
> The idea was to enable an admin interface to the DB so that each cloud
> platform admin could add more or delete their platform from the solution.
> This requires a place to store secrets that can be updated deleted and
> created.
> I was hoping that there might be a standard way to store these that is
> secure other than adding secrets or updating the .env file.
>
> Thanks for trying to understand my vague question.
>
> Lance
>
>
>
> On 11/12/18 10:04 AM, PASCUAL Eric wrote:
>
> Hi Lance,
>
>
>  but I need for people who are admins for a particular cloud to add their
> cloud details to the app and then store their credentials securely.
>
>
> I'm not sure to understand the need for adding cloud details to the app
> for the admins.
>
>
> The suggestion I made assumed that sensitive information is managed as K8S
> secrets. As long as the admins have GCloud (for instance) credentials set
> (which are stored and managed at GCloud level), they can administrate the
> secrets resources by "applying" the corresponding YAML descriptors
> remotely from their workstation. The sensitive values are thus stored
> nowhere inside the application itself, but passed to the containers at
> runtime as environment variables.
>
>
> Maybe I've misunderstood your need and sorry in this case if my answer is
> off topic.
>
>
> Best
>
>
> Eric
> --
> *From:* django-users@googlegroups.com 
>  on behalf of Lance Haig 
> 
> *Sent:* Monday, November 12, 2018 9:07:30 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: How do I store details securely with django?
>
>
> Hi Eric,
>
>
> Thanks for the response.
>
>
> This idea has an end goal of being deployed in a resilient way so most
> probably docker with some form of orchestration, Docker swarm or Kubernetes.
>
>
> The credentials are mainly stored in a .env file at the moment and could
> be added to the secrets but I need for people who are admins for a
> particular cloud to add their cloud details to the app and then store their
> credentials securely.
>
>
> Unfortunately this will need a dynamic storage mechanism which i don't
> know how to do yet
>
>
> Regards
>
>
> Lance
>
>
>
> On 11/12/18 12:03 AM, PASCUAL Eric wrote:
>
> Hi,
>
>
> It can depend on which deployment option you plan to use for the
> application.
>
>
> For instance, a Docker deployment orchestrated by Kubernetes gives the
> option of using secrets for sensitive information, which a hoster such as
> GCP manages conveniently. In this kind of deployment, configuration (and
> secrets) are passed to the app as environment variables, on which
> Kubernetes configuration maps and secrets are mapped to. Thanks to this,
> values are stored nowhere in the app code, companion files or database.
>
>
> Regards
>
>
> Eric
> --
> *From:* django-users@googlegroups.com 
>  on behalf of Mike Dewhirst
>  
> *Sent:* Sunday, November 11, 2018 11:07:14 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: How do I store details securely with django?
>
> On 12/11/2018 12:47 AM, Lance Haig wrote:
> > Hi,
> >
> > I have a project I am working on https://github.com/lhaig/usery/ and
> > part of the roadmap of the project is to add more cloud types to the
> > list.
> >
> > I wanted to allow admins for these services to login and create
> > records for their different clouds in the DB and then use these when
> > people request access to these 

Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-11-12 Thread Jason
 path('login/', auth_views.LoginView, {'template_name':'accounts/login.html'} 
name='login'),


There's no comma to separate the kwarg dict from the `name` positional 
argument.  As you can see in the docs 
https://docs.djangoproject.com/en/2.1/ref/urls/#path, the path function 
takes four params:

path(route, view, kwargs=None, name=None)

you're providing route and view, but the dict and name are looking like two 
positional args instead of one.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c82620a-cd22-46c7-87ee-035a8901984b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does my Django project open the same home page irrespective or which url I type?

2018-11-12 Thread Jason
you have an ending slash on your login urls, and no ending slash in your 
links defined.  try adding a trailing slash

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b288b73f-f10b-4ca8-9de0-892cef0a800f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using Django middleware with web and mobile app

2018-11-12 Thread lakshitha kumara
Hello Guys,

I'm developing a mobile app and website with one Django backend. all web 
browser(mobile browser included) using session auth and mobile app using 
Rest API with OAuth 2 authentications.  I would like to know the best way 
to handle Django middleware with web and mobile app.

For example, there are using verification middleware. currently, I'm trying 
to do if user not verifies then redirect to the verification page but this 
method hard to handle mobile app.i cant check mobile device method also 
because of mobile also behaviour like a web browser.

one solution is using custom Django decorator 

Is there are any other solution for this method?

Thanks




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6087f0e9-7709-47ad-b50f-fe759fb72c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why does my Django project open the same home page irrespective or which url I type?

2018-11-12 Thread Alex Callaway
In my urlpatterns in the url.py file of my app, I have two pages:

from django.urls import path, re_path
from django.conf.urls import url
from . import views
from django.contrib.auth.views import LoginView

urlpatterns=[
re_path(r'^$',views.home, name='home'),
path('login/', LoginView.as_view(template_name='accounts/login.html'), name=
'login'),
]

When I visit : `http://127.0.0.1:8000/home` I see whats in my `index.html`. 

But when I visit : 

`http://127.0.0.1:8000/accounts/login` or 
`http://127.0.0.1:8000/accounts/login.html` or 
`http://127.0.0.1:8000/accounts/login/login` or 
`http://127.0.0.1:8000/accounts/login/login/login.html` 

I still see what's in my `index.html`. Wtf?


Ok. I did say in my views.py I have told it to render `home/index.html` 
like this :

def home(request):
return render(request, 'home/index.html')

But I also have this function in views.py as well :


def login(request):
c = {}
c.update(csrf(request))
return render(request, 'accounts/login.html', c)

So what's the problem? Why won't it render `accounts/login.html` page when 
I visit `http://127.0.0.1:8000/accounts/login`

By the way, In my main url.py file in the project, I have url patterns this 
way *(every django project has two urls.py)*:
urlpatterns = [
path('admin/', admin.site.urls),
path('home/', include('clientview.urls')),
path('accounts/login/', include('clientview.urls')),
]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b14297d2-a879-4642-9c75-82b103297f00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


PDF extarcting

2018-11-12 Thread swathi2801 Yadhav
Hi everyone, there is a project given to us to develop an application
I need to extract data from resume only specific fields like name, mail,
dob, phone number   by importing a package pyPdf2 I can only extract a data
to text the whole part but there is no need of whole data only specific
data need to extract
if any were are familiar with pdPdf2 extracting the data please help me
.!!


thanks
Swathi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGnx2uOSNfTJc7YEJbahW-6KvU%3DzNLNpza890AxZZXSOSRVOSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
import PyPDF2

pdfFileObj = open('C:/Users/SWATHI/Desktop/word-to-pdf.pdf', 'rb')

pdfReader = PyPDF2.PdfFileReader(pdfFileObj)

print(pdfReader.numPages)

p = pdfReader.getPage(0)


#pageObj1= pdfReader.getPage(1)

print(p.extractText())

#print(pageObj1.extractText())

pdfFileObj.close()


Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-11-12 Thread Alex Callaway

>
> path('login/', auth_views.LoginView.as_view(), name='login'),


How does it re-direct to which page to open in above method? How does it 
open the template the user wanted here? He is trying to open the page 
'users/login.html'  when users type: http://127.0.0.1/login/ on the browser.

I have the same issue as OP. I am never directed to open the page 
*login.html*. I am using Django version 2.1.2.

My* `urls.py` (in the app) *is like this :

from django.urls import path, re_path
from django.conf.urls import url
from . import views
from django.contrib.auth import views as auth_views
#from django.contrib.auth import login
from django.contrib.auth.views import LoginView

urlpatterns=[
re_path(r'^$',views.home, name='home'),
path('login/', auth_views.LoginView, {'template_name':'accounts/login.html'} 
name='login'),
]
And I get this error :


*TypeError at /accounts/login/login/__init__() takes 1 positional argument 
but 2 were given*

Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/login/login/
Django Version: 2.1.2
Exception Type: TypeError
Exception Value: __init__() takes 1 positional argument but 2 were given

Exception Location: 
C:\Python3\lib\site-packages\django\core\handlers\base.py in _get_response, 
line 124
Python Executable: C:\Python3\python.exe
Python Version: 3.6.4
Python Path: ['C:\\Git\\projects\\projectname', 
'C:\\Python3\\python36.zip', 'C:\\Python3\\DLLs', 'C:\\Python3\\lib', 
'C:\\Python3', 'C:\\Python3\\lib\\site-packages', 
'/projectname/projectname']

Server time: Tue, 13 Nov 2018 00:11:05 +
Traceback said :

File "C:\Python3\lib\site-packages\django\core\handlers\exception.py" in 
inner
  34. response = get_response(request)

File "C:\Python3\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  126. response = self.process_exception_by_middleware(e, 
request)

File "C:\Python3\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  124. response = wrapped_callback(request, *callback_args, 
**callback_kwargs)

*Exception Type: TypeError at /accounts/login/login/*
*Exception Value: __init__() takes 1 positional argument but 2 were given*

My *url.py *in my project *(not in the app)* is like this :

urlpatterns = [
path('admin/', admin.site.urls),
path('home/', include('clientview.urls')),
path('accounts/login/', include('clientview.urls')),
]

On Monday, August 27, 2018 at 8:47:05 AM UTC-7, kimeualexis wrote:
>
> *#Import auth views*
>
> from django.contrib.auth import views as auth_views
>
> *#Use the views in the url*
>
> path('login/', auth_views.LoginView.as_view(), name='login'),
>
> Happy coding!
>
>
> On Mon, Aug 27, 2018 at 6:29 PM Tim Vogt (Tim Vogt)  > wrote:
>
>> Hi Jason, 
>> Thank !
>>
>> my urls.py in /users looks like this
>>
>> This is the error I get with amusement.
>>
>> How to change the old import? I suppose this is the way. Because the 
>> admin is imported from django. 
>>
>>
>>
>>
>>
>>
>> """Defines URL patterns for users"""
>>
>> from django.conf.urls import url
>> from . import views
>> # from django.contrib.auth import login
>> from django.contrib.auth.views import LoginView
>>
>> app_name='users'
>>
>>
>> urlpatterns = [
>>   # Login page
>> url('login/', LoginView, {'template_name': 'users/login.html'}, 
>> name='login'),
>> # Logout page
>> url('logout/', views.logout_view, name='logout'),
>> ]
>>
>>
>>
>>
>> TypeError at /users/login/
>>
>> __init__() takes 1 positional argument but 2 were given
>>
>> Request Method: GET
>> Request URL: http://localhost:8000/users/login/
>> Django Version: 2.0.7
>> Exception Type: TypeError
>> Exception Value: 
>>
>> __init__() takes 1 positional argument but 2 were given
>>
>> Exception Location: 
>> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py
>>  
>> in _get_response, line 126
>> Python Executable: 
>> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
>> Python Version: 3.6.5
>> Python Path: 
>>
>> ['/Users/timvogt/Software_projects/learning_log',
>>  '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip',
>>  '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6',
>>  
>> '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload',
>>  '/Users/timvogt/Library/Python/3.6/lib/python/site-packages',
>>  
>> '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']
>>
>> Server time: Mon, 27 Aug 2018 15:26:32 +
>> Traceback Switch to copy-and-paste view 
>> 
>>
>>- 
>>
>> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/exception.py
>> in inner
>>1. 
>>   
>>   response = get_response(request)
>>   
>>   ...
>>▶ Local vars 
>>- 
>>
>> 

Django Admin Redesign

2018-11-12 Thread Zakriya Bilal
I am starting a project in which one of the requirements is to have a 
custom designed Admin panel. 

So my question is: Is it possible to redesign the Django Admin panel? 
Majority of the requirements are related to Front-end design? Is it a good 
idea to redesign the front-end or just create a new admin area from scratch?

I ask because the design of the admin panel is important. 

Just to put it out there, I am coming from Laravel World. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5544f0cd-5be7-4c91-a2ae-83c4b77dcfa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels: Test case fails on async.sleep(X>0)

2018-11-12 Thread Zhiyu (Drew) Li
Hi there,

I was trying to write a test for a consumer. It is just a very simply
AsyncHttpConsumer subclass that awaits on asyncio.sleep(3) and returns a
"OK" in plain text.

The test case is:
@pytest.mark.asyncio
async def test_my_consumer():
communicator = HttpCommunicator(BasicHttpConsumer, "GET", "asynchttp")
response = await communicator.get_response()
assert response["status"] == 200
assert response["body"] == b"OK"

1) Error 1:
I run it with command "pytest .py"
The first error I got was:
django.core.exceptions.ImproperlyConfigured: Requested settings, but
settings are not configured. You must either define the environment
variable DJANGO_SETTINGS_MODULE or call settings.configure() before
accessing settings.

I google online and found this fix:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MODULE_PATH_TO.settings")


2) Error 2:
The new error I am getting is:
self = , exc_type = 

def _do_exit(self, exc_type: Type[BaseException]) -> None:
if exc_type is asyncio.CancelledError and self._cancelled:
self._cancel_handler = None
self._task = None
>   raise asyncio.TimeoutError
E   concurrent.futures._base.TimeoutError

But If I change async.sleep(3) to  async.sleep(0) the test passed. Not sure
why

Also how to test url mapping works correctly?

Thanks
Drew

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMmsbUk-3AemjcTxxidf4GBvKeWG7b72qwfUcs5owReTeOEMiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Toby McGuire

2018-11-12 Thread PASCUAL Eric
370 assembler


So I'm not the last dinosaur still alive and having written 370 ASM stuff in 
his former life 


Sure Django and Python are a big step from there, and welcome aboard ;) Which 
kind of project do you plan to work on, and what are your questions ?


Eric


From: django-users@googlegroups.com  on behalf 
of toby mac 
Sent: Monday, November 12, 2018 6:02:52 PM
To: Django users
Subject: Toby McGuire

Im a newbie to this. Used to program on COBOl, Fortran and 370 assembler, plus 
many others

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3cb81086-f190-41d6-889d-cda899e86b34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM6P193MB042193937FAB7EF71A2BE9C08CC10%40AM6P193MB0421.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread PASCUAL Eric
Hi Lance,


Well, I was off topic. Sorry for this :/ I understand your need better now.


There are chances you've already thought to this option, but what about storing 
the sensitive data encrypted with a key based on a passphrase the user must 
provide when logging, in addition to the usual credentials ? This passphrase 
would not be stored anywhere, so even if the DB is compromised, the sensitive 
data would not be usable.


Eric


From: django-users@googlegroups.com  on behalf 
of Lance Haig 
Sent: Monday, November 12, 2018 4:45:50 PM
To: django-users@googlegroups.com
Subject: Re: How do I store details securely with django?


Hi Eric,

I am sure I have not explained myself properly.

The app does the following.

It presents a user the ability to sign up to a cloud platform for a sandbox / 
playground account.
The number of cloud services that are available will change over time.

Each cloud platform has a set of credentials (username, password, domain 
etc...) These credentials will have elevated permissions within their own 
environments and so should be kept as safe as possible.

Currently I use secrets and .env files to provide these credentials.
This requires physical access to the platform to add new secrets etc...

I want to enable editing (e.g. CRUD on the platform credentials) without having 
to redeploy the application or update the secrets.
The idea was to enable an admin interface to the DB so that each cloud platform 
admin could add more or delete their platform from the solution.
This requires a place to store secrets that can be updated deleted and created.
I was hoping that there might be a standard way to store these that is secure 
other than adding secrets or updating the .env file.

Thanks for trying to understand my vague question.

Lance



On 11/12/18 10:04 AM, PASCUAL Eric wrote:

Hi Lance,


 but I need for people who are admins for a particular cloud to add their cloud 
details to the app and then store their credentials securely.


I'm not sure to understand the need for adding cloud details to the app for the 
admins.


The suggestion I made assumed that sensitive information is managed as K8S 
secrets. As long as the admins have GCloud (for instance) credentials set 
(which are stored and managed at GCloud level), they can administrate the 
secrets resources by "applying" the corresponding YAML descriptors remotely 
from their workstation. The sensitive values are thus stored nowhere inside the 
application itself, but passed to the containers at runtime as environment 
variables.


Maybe I've misunderstood your need and sorry in this case if my answer is off 
topic.


Best


Eric


From: django-users@googlegroups.com 
 on behalf 
of Lance Haig 
Sent: Monday, November 12, 2018 9:07:30 AM
To: django-users@googlegroups.com
Subject: Re: How do I store details securely with django?


Hi Eric,


Thanks for the response.


This idea has an end goal of being deployed in a resilient way so most probably 
docker with some form of orchestration, Docker swarm or Kubernetes.


The credentials are mainly stored in a .env file at the moment and could be 
added to the secrets but I need for people who are admins for a particular 
cloud to add their cloud details to the app and then store their credentials 
securely.


Unfortunately this will need a dynamic storage mechanism which i don't know how 
to do yet


Regards


Lance



On 11/12/18 12:03 AM, PASCUAL Eric wrote:

Hi,


It can depend on which deployment option you plan to use for the application.


For instance, a Docker deployment orchestrated by Kubernetes gives the option 
of using secrets for sensitive information, which a hoster such as GCP manages 
conveniently. In this kind of deployment, configuration (and secrets) are 
passed to the app as environment variables, on which Kubernetes configuration 
maps and secrets are mapped to. Thanks to this, values are stored nowhere in 
the app code, companion files or database.


Regards


Eric


From: django-users@googlegroups.com 
 on behalf 
of Mike Dewhirst 
Sent: Sunday, November 11, 2018 11:07:14 PM
To: django-users@googlegroups.com
Subject: Re: How do I store details securely with django?

On 12/11/2018 12:47 AM, Lance Haig wrote:
> Hi,
>
> I have a project I am working on https://github.com/lhaig/usery/ and
> part of the roadmap of the project is to add more cloud types to the
> list.
>
> I wanted to allow admins for these services to login and create
> records for their different clouds in the DB and then use these when
> people request access to these services.
>
> I need to find a secure way to store 

Re: Toby McGuire

2018-11-12 Thread Bob Gailer
On Nov 12, 2018 12:05 PM, "toby mac"  wrote:
>
> Im a newbie to this. Used to program on COBOl, Fortran and 370 assembler,
plus many others

Welcome to A Whole New World. How can we help you?

Bob Gailer

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP1rxO6i9UpXonLE%2BjT3ohjQGEei5Yj41o5dT%3D82LoQPzp4RWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Andreas,

I have fixed the issue. Here is how i achieved


   1. I removed the field reports_to and added a field report_new(with 
   foreign key)

-  reports_to = models.CharField(max_length=128, blank=True, null=
True)---(Removed this line)
+ report_new = models.ForeignKey("self", null=True, blank=True, 
related_name="employee_reports_to")



2. Altered the field name reports_new to reports_to
 changed this
 
report_new = models.ForeignKey("self", null=True, blank=True, related_name=
"employee_reports_to")
 
 to 
report_new = models.ForeignKey("self", null=True, blank=True, related_name=
"employee_reports_to")

Thank you very much for your response it helped me a lot.

Thanks,
Karthik


On Monday, November 12, 2018 at 2:07:18 PM UTC-5, Andréas Kühne wrote:
>
> Hi,
>
> Yes you can roll back your migrations (I think) But you weren't able 
> to get by that migration and it's only that migration that you need to 
> handle. The other migrations haven't yet been migrated and you can just 
> delete them from your disk in that case?
>
> Regards,
>
> Andréas
>
>
> Den mån 12 nov. 2018 kl 19:58 skrev china  >:
>
>> Hi Andreas,
>>
>> Thank you for you quick response
>>
>> Is it possible if remove my migration files and rollback my migration to 
>> three  migrations back..?
>>
>> Thanks,
>> Karthik
>>
>> On Monday, November 12, 2018 at 12:26:23 PM UTC-5, Andréas Kühne wrote:
>>>
>>> Hi,
>>>
>>> You are changing a CharField into a ForeignKey field with data present. 
>>> So when the migration tries to run, the reports_to field contains 
>>> information with a string in it - the database server then tries to set it 
>>> to a ForeignKey field, which is an integer field per default. This data 
>>> migration doesn't work and that is what the error is saying.
>>>
>>> This can't be migrated automatically without writing your own migrations 
>>> and even then it won't be easy,.
>>>
>>> If you don't care about the current value of the reports_to field, you 
>>> can do this in 2 migrations - one to remove the field and another to add 
>>> the foreign key field. Or you can just add a drop column for the old 
>>> reports to field in the same migration.
>>>
>>> If you do care, I would probably do something like this:
>>> 1. Rename the current field.
>>> 2. Add the new foreign key field
>>> 3. Migrate the data via a custom migration.
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> Den mån 12 nov. 2018 kl 17:39 skrev china :
>>>
 Hi Experts,

 I am trying to change the charfield to ForeignKey and I am running my 
 code I am getting the following error if do python manage.py migrate

 django.db.utils.DataError: invalid input syntax for integer: "Jeff"


 Here is my code


 BEFORE

 --


 reports_to = models.CharField(max_length=128, blank=True, null=True)


 in_country_manager = models.CharField(max_length=128, blank=True, null=
 True)

 After
 --

 reports_to = models.ForeignKey("self", null=True, blank=True, 
 related_name="employee_reports_to")


 Could any please help with this issue.


 Thanks,

 Karthik

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/20ca05ad-6486-489c-91fc-62adf615dee3%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/7414b861-7c76-4c23-8ede-c358a24c76fa%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to 

Re: Django Courier Management System Project

2018-11-12 Thread Christopher Medlin
https://www.djangoproject.com/start/

On Mon, Nov 12, 2018 at 11:38 AM sakkhar saha 
wrote:

> Dear All,
> I am Sakkhar form Bangladesh. Now I have a project idea. And i am a single
> man. My Project is Courier Management in Djnago. Please help for the idea.
> How i start my project. And How i Design my database table.
> My Project Feature.
>
> 1. User Can Add Your Order and Track his order.
> 2. Admin Can Add Order and Order complete and pending.
> 3. Admin Approve User.
> 4. When user order confirm than user give an email notification.
> 5. And Finally when Admin deliver the order than user give an email
> notification.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cea6f464-55fb-43c8-bef6-b438212235e9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOOJAOw3_UjOWBxtnvL-LWa2-19Ounak5qfwmXnPQ4qbw4bu6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Courier Management System Project

2018-11-12 Thread sakkhar saha
Dear All, 
I am Sakkhar form Bangladesh. Now I have a project idea. And i am a single 
man. My Project is Courier Management in Djnago. Please help for the idea. 
How i start my project. And How i Design my database table. 
My Project Feature. 

1. User Can Add Your Order and Track his order. 
2. Admin Can Add Order and Order complete and pending. 
3. Admin Approve User. 
4. When user order confirm than user give an email notification. 
5. And Finally when Admin deliver the order than user give an email 
notification. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cea6f464-55fb-43c8-bef6-b438212235e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration Issue in Django 1.9

2018-11-12 Thread Andréas Kühne
Hi,

Yes you can roll back your migrations (I think) But you weren't able to
get by that migration and it's only that migration that you need to handle.
The other migrations haven't yet been migrated and you can just delete them
from your disk in that case?

Regards,

Andréas


Den mån 12 nov. 2018 kl 19:58 skrev china :

> Hi Andreas,
>
> Thank you for you quick response
>
> Is it possible if remove my migration files and rollback my migration to
> three  migrations back..?
>
> Thanks,
> Karthik
>
> On Monday, November 12, 2018 at 12:26:23 PM UTC-5, Andréas Kühne wrote:
>>
>> Hi,
>>
>> You are changing a CharField into a ForeignKey field with data present.
>> So when the migration tries to run, the reports_to field contains
>> information with a string in it - the database server then tries to set it
>> to a ForeignKey field, which is an integer field per default. This data
>> migration doesn't work and that is what the error is saying.
>>
>> This can't be migrated automatically without writing your own migrations
>> and even then it won't be easy,.
>>
>> If you don't care about the current value of the reports_to field, you
>> can do this in 2 migrations - one to remove the field and another to add
>> the foreign key field. Or you can just add a drop column for the old
>> reports to field in the same migration.
>>
>> If you do care, I would probably do something like this:
>> 1. Rename the current field.
>> 2. Add the new foreign key field
>> 3. Migrate the data via a custom migration.
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den mån 12 nov. 2018 kl 17:39 skrev china :
>>
>>> Hi Experts,
>>>
>>> I am trying to change the charfield to ForeignKey and I am running my
>>> code I am getting the following error if do python manage.py migrate
>>>
>>> django.db.utils.DataError: invalid input syntax for integer: "Jeff"
>>>
>>>
>>> Here is my code
>>>
>>>
>>> BEFORE
>>>
>>> --
>>>
>>>
>>> reports_to = models.CharField(max_length=128, blank=True, null=True)
>>>
>>>
>>> in_country_manager = models.CharField(max_length=128, blank=True, null=
>>> True)
>>>
>>> After
>>> --
>>>
>>> reports_to = models.ForeignKey("self", null=True, blank=True,
>>> related_name="employee_reports_to")
>>>
>>>
>>> Could any please help with this issue.
>>>
>>>
>>> Thanks,
>>>
>>> Karthik
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/20ca05ad-6486-489c-91fc-62adf615dee3%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7414b861-7c76-4c23-8ede-c358a24c76fa%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCf8_oDQPXBTMnPAQ3A3MMghSEh%3DdbeXt%2Bk_zPx%2BnkzNCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Andreas,

Thank you for you quick response

Is it possible if remove my migration files and rollback my migration to 
three  migrations back..?

Thanks,
Karthik

On Monday, November 12, 2018 at 12:26:23 PM UTC-5, Andréas Kühne wrote:
>
> Hi,
>
> You are changing a CharField into a ForeignKey field with data present. So 
> when the migration tries to run, the reports_to field contains information 
> with a string in it - the database server then tries to set it to a 
> ForeignKey field, which is an integer field per default. This data 
> migration doesn't work and that is what the error is saying.
>
> This can't be migrated automatically without writing your own migrations 
> and even then it won't be easy,.
>
> If you don't care about the current value of the reports_to field, you can 
> do this in 2 migrations - one to remove the field and another to add the 
> foreign key field. Or you can just add a drop column for the old reports to 
> field in the same migration.
>
> If you do care, I would probably do something like this:
> 1. Rename the current field.
> 2. Add the new foreign key field
> 3. Migrate the data via a custom migration.
>
> Regards,
>
> Andréas
>
>
> Den mån 12 nov. 2018 kl 17:39 skrev china  >:
>
>> Hi Experts,
>>
>> I am trying to change the charfield to ForeignKey and I am running my 
>> code I am getting the following error if do python manage.py migrate
>>
>> django.db.utils.DataError: invalid input syntax for integer: "Jeff"
>>
>>
>> Here is my code
>>
>>
>> BEFORE
>>
>> --
>>
>>
>> reports_to = models.CharField(max_length=128, blank=True, null=True)
>>
>>
>> in_country_manager = models.CharField(max_length=128, blank=True, null=
>> True)
>>
>> After
>> --
>>
>> reports_to = models.ForeignKey("self", null=True, blank=True, 
>> related_name="employee_reports_to")
>>
>>
>> Could any please help with this issue.
>>
>>
>> Thanks,
>>
>> Karthik
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/20ca05ad-6486-489c-91fc-62adf615dee3%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7414b861-7c76-4c23-8ede-c358a24c76fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy django project using gunicorn

2018-11-12 Thread Yohandy Chiaawanda
I delete the models.py file since I am splitting all the models into 
separated files based on their name and import them in the __init__.py as 
the 2nd image i post before..
Should I keep the models.py file ? If yes, where should I keep them ? And 
what the content it should be ? 

Below I attach one of the model that I made
from django.db import models
from rest_framework import serializers

from Retailapp.models.MasterManagement.MasterItem_models import MasterItem
from Retailapp.models.MasterManagement.MasterUOM_models import MasterUOM


class ItemUnitConvercy(models.Model):
unit_convercy_id = models.BigAutoField(primary_key=True)
qty_convercy = models.CharField(max_length=50, blank=True)
master_item_id = models.ForeignKey(MasterItem, on_delete=models.CASCADE)
uom_id = models.OneToOneField(MasterUOM, on_delete=models.CASCADE)

class Meta:
db_table = 'ItemUnitConvercy'
app_label = 'Retailapp'


class ItemUnitConvercySerializer(serializers.ModelSerializer):
class Meta:
model = ItemUnitConvercy
fields = '__all__'




On Monday, November 12, 2018 at 10:28:17 PM UTC+7, amit pant wrote:
>
> check your models, might be there is some spelling error.
> if you share your models.py file then we could do more help. 
>
> On Mon, Nov 12, 2018 at 8:28 PM Yohandy Chiaawanda  > wrote:
>
>> Hello
>>
>> I am currently following this guide 
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>>  
>> to set up django into digitalocean, and I kinda stuck at one point when I 
>> want to use gunicorn
>> Whenever i type 'gunicorn --bind 0.0.0.0:8003 myproject.wsgi' ,there's 
>> always an ImportError showing up
>> Here's the screenshot showing the error
>> [image: error01.PNG]
>> And here's the file __init__.py looks like
>> [image: error02.PNG]
>>
>> Any suggestion and help is really appreciated 
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a8e3098f-465e-4986-aca3-f4f196645423%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c374b800-2f70-4618-9909-9ed1052ee604%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migration Issue in Django 1.9

2018-11-12 Thread Andréas Kühne
Hi,

You are changing a CharField into a ForeignKey field with data present. So
when the migration tries to run, the reports_to field contains information
with a string in it - the database server then tries to set it to a
ForeignKey field, which is an integer field per default. This data
migration doesn't work and that is what the error is saying.

This can't be migrated automatically without writing your own migrations
and even then it won't be easy,.

If you don't care about the current value of the reports_to field, you can
do this in 2 migrations - one to remove the field and another to add the
foreign key field. Or you can just add a drop column for the old reports to
field in the same migration.

If you do care, I would probably do something like this:
1. Rename the current field.
2. Add the new foreign key field
3. Migrate the data via a custom migration.

Regards,

Andréas


Den mån 12 nov. 2018 kl 17:39 skrev china :

> Hi Experts,
>
> I am trying to change the charfield to ForeignKey and I am running my code
> I am getting the following error if do python manage.py migrate
>
> django.db.utils.DataError: invalid input syntax for integer: "Jeff"
>
>
> Here is my code
>
>
> BEFORE
>
> --
>
>
> reports_to = models.CharField(max_length=128, blank=True, null=True)
>
>
> in_country_manager = models.CharField(max_length=128, blank=True, null=
> True)
>
> After
> --
>
> reports_to = models.ForeignKey("self", null=True, blank=True, related_name
> ="employee_reports_to")
>
>
> Could any please help with this issue.
>
>
> Thanks,
>
> Karthik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20ca05ad-6486-489c-91fc-62adf615dee3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcpCfsWvuTn0OZWD8tGY5_bhfeUVMr-SkJEB1nwfpWLFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Toby McGuire

2018-11-12 Thread toby mac
Im a newbie to this. Used to program on COBOl, Fortran and 370 assembler, 
plus many others

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3cb81086-f190-41d6-889d-cda899e86b34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-12 Thread Ansh Srivastava
Good to go with brackets for django projects !


On Mon, Nov 12, 2018 at 9:59 PM swathi2801 Yadhav <
swathi2801yad...@gmail.com> wrote:

>
> -- Forwarded message -
> From: swathi2801 Yadhav 
> Date: Mon, 12 Nov 2018, 9:26 p.m.
> Subject: Re: Setting up admin in visual studio
> To: 
>
>
> Hi Everyone
> by using module  pyPdf2 I need to extract only certain data only  by using
> python
> example : resume.pdf should be extracted to text only certain fields like
> name, phone number, email id, skills, qualifications
>
>
> On Sun, Nov 11, 2018 at 8:07 PM Aditya Bohra 
> wrote:
>
>> In urls.py from app_name.views import blog
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/14cfacea-26e3-4438-b1ce-48281c9747b4%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGnx2uNvbMgauU8hsUq%2Box41QUw8UWYrSiQa8Kx2sBSg3KTPxw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHMQ532FGTfSC_rCzVVKF%3D2KhnNKsJhoEo1cPmY1YyfH-R25Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Experts,

I am trying to change the charfield to ForeignKey and I am running my code 
I am getting the following error if do python manage.py migrate

django.db.utils.DataError: invalid input syntax for integer: "Jeff"


Here is my code


BEFORE

--


reports_to = models.CharField(max_length=128, blank=True, null=True)


in_country_manager = models.CharField(max_length=128, blank=True, null=True)

After
--

reports_to = models.ForeignKey("self", null=True, blank=True, related_name=
"employee_reports_to")


Could any please help with this issue.


Thanks,

Karthik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20ca05ad-6486-489c-91fc-62adf615dee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Setting up admin in visual studio

2018-11-12 Thread swathi2801 Yadhav
-- Forwarded message -
From: swathi2801 Yadhav 
Date: Mon, 12 Nov 2018, 9:26 p.m.
Subject: Re: Setting up admin in visual studio
To: 


Hi Everyone
by using module  pyPdf2 I need to extract only certain data only  by using
python
example : resume.pdf should be extracted to text only certain fields like
name, phone number, email id, skills, qualifications


On Sun, Nov 11, 2018 at 8:07 PM Aditya Bohra 
wrote:

> In urls.py from app_name.views import blog
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/14cfacea-26e3-4438-b1ce-48281c9747b4%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGnx2uNvbMgauU8hsUq%2Box41QUw8UWYrSiQa8Kx2sBSg3KTPxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-12 Thread swathi2801 Yadhav
Hi Everyone
by using module  pyPdf2 I need to extract only certain data only  by using
python
example : resume.pdf should be extracted to text only certain fields like
name, phone number, email id, skills, qualifications


On Sun, Nov 11, 2018 at 8:07 PM Aditya Bohra 
wrote:

> In urls.py from app_name.views import blog
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/14cfacea-26e3-4438-b1ce-48281c9747b4%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGnx2uP%3DsNzLTcoqnEfW9MnjoZ2SZ27OZiJBcyUabH0mQ1w3Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig

Hi Mike,

Thank you for taking the time to read this.

I have highlighted these sentences in your response

*The bottom line question: What is lost if temporary creds are 
compromised?*


The credentials have high level access to the backed system think e.g  
kubernetes admin so compromise would mean full access to kubernetes to 
add remove delete anything.



*What plan do you have to execute to recover from the feared event 
when/if it happens?*


This is a valid question, The recovery for these would be rebuild of a 
cluster or service. depending on the damage caused.



It seems my idea of making these options configurable via a web UI will 
not easily be done.


I will have to stay with the current deployment plan.

Thanks


Lance



On 11/12/18 9:30 AM, Mike Dewhirst wrote:

On 12/11/2018 7:02 PM, Lance Haig wrote:

Hi,

Thanks for responding.

My answers inline


On 11/11/18 11:07 PM, Mike Dewhirst wrote:

On 12/11/2018 12:47 AM, Lance Haig wrote:

Hi,

I have a project I am working on https://github.com/lhaig/usery/ 
and part of the roadmap of the project is to add more cloud types 
to the list.


I wanted to allow admins for these services to login and create 
records for their different clouds in the DB and then use these 
when people request access to these services.


I need to find a secure way to store these credentials so that even 
if the DB is compromised that the credentials are safe.


I agree credentials should not be stored in the database but what 
are your other assumptions about the threats?


How many sets of credentials will there be?



it could potentially be 5 to 10 per admin account




In future, will you be using simple credentials or tokens, 
certificates, multi factor auth?



These credentials are access details to other clouds.

The application is a user sandbox portal to allow admins to grant X 
number of days access to a cloud for testing and discovery.


It currently is focused on openstack but he roadmap plan is to add 
docker Kubernetes etc..


So I need to have the ability for the cloud admins to add or remove 
authentication details as they are needed.


I haven't thought deeply about this because it is not my project but 
on the surface, if they are temporary credentials I cannot see much 
need for heavy duty security.


If the perceived risk is database compromise it might be better to 
configure the database or the database server with an ACL including 
only the Django server IP address and perhaps one or two trusted people.


Maybe Kubernetes secrets is the eventual way forward but scalability 
is assured if you can keep the creds in the database.


What about a separate non-public schema (assuming Postgres) for creds? 
I'm sure you could lock that down to particular permission groups 
which ought keep things secure enough.


The bottom line question: What is lost if temporary creds are 
compromised?


Risk is hazard multiplied by likelihood/opportunity

If you can reduce either side of that equation you reduce risk.

What plan do you have to execute to recover from the feared event 
when/if it happens?


When all things are considered the answer to that last question 
determines how much effort is warranted.








If this is a prototype and only a few sets are involved you can 
store credentials in a file or one file per set and write a method 
to fetch them as required. That will keep them out of the database 
and let you rejig the method after you have decided how it should 
really work.


I currently use the .env file to hold these credentials but that does 
not scale very well when you need to add more and more.





Does anyone have suggestions on how I can accomplish this?

I would really appreciate some advice.

Regards

Lance











--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d96ad464-ae03-59ad-0227-ff0feb9a177d%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig

Hi Eric,


I am sure I have not explained myself properly.

The app does the following.

It presents a user the ability to sign up to a cloud platform for a 
sandbox / playground account.

The number of cloud services that are available will change over time.

Each cloud platform has a set of credentials (username, password, domain 
etc...) These credentials will have elevated permissions within their 
own environments and so should be kept as safe as possible.


Currently I use secrets and .env files to provide these credentials.
This requires physical access to the platform to add new secrets etc...

I want to enable editing (e.g. CRUD on the platform credentials) without 
having to redeploy the application or update the secrets.
The idea was to enable an admin interface to the DB so that each cloud 
platform admin could add more or delete their platform from the solution.
This requires a place to store secrets that can be updated deleted and 
created.
I was hoping that there might be a standard way to store these that is 
secure other than adding secrets or updating the .env file.


Thanks for trying to understand my vague question.

Lance



On 11/12/18 10:04 AM, PASCUAL Eric wrote:


Hi Lance,


 but I need for people who are admins for a particular cloud to add 
their cloud details to the app and then store their credentials securely.



I'm not sure to understand the need for adding cloud details to the 
app for the admins.



The suggestion I made assumed that sensitive information is managed as 
K8S secrets. As long as the admins have GCloud (for instance) 
credentials set (which are stored and managed at GCloud level), they 
can administrate the secrets resources by "applying" the corresponding 
YAML descriptors remotely from their workstation. The sensitive values 
are thus stored nowhere inside the application itself, but passed to 
the containers at runtime as environment variables.



Maybe I've misunderstood your need and sorry in this case if my answer 
is off topic.



Best


Eric


*From:* django-users@googlegroups.com  
on behalf of Lance Haig 

*Sent:* Monday, November 12, 2018 9:07:30 AM
*To:* django-users@googlegroups.com
*Subject:* Re: How do I store details securely with django?

Hi Eric,


Thanks for the response.


This idea has an end goal of being deployed in a resilient way so most 
probably docker with some form of orchestration, Docker swarm or 
Kubernetes.



The credentials are mainly stored in a .env file at the moment and 
could be added to the secrets but I need for people who are admins for 
a particular cloud to add their cloud details to the app and then 
store their credentials securely.



Unfortunately this will need a dynamic storage mechanism which i don't 
know how to do yet



Regards


Lance



On 11/12/18 12:03 AM, PASCUAL Eric wrote:


Hi,


It can depend on which deployment option you plan to use for the 
application.



For instance, a Docker deployment orchestrated by Kubernetes gives 
the option of using secrets for sensitive information, which a hoster 
such as GCP manages conveniently. In this kind of deployment, 
configuration (and secrets) are passed to the app as environment 
variables, on which Kubernetes configuration maps and secrets are 
mapped to. Thanks to this, values are stored nowhere in the app code, 
companion files or database.



Regards


Eric


*From:* django-users@googlegroups.com 
 
 
 on behalf of Mike Dewhirst 
 

*Sent:* Sunday, November 11, 2018 11:07:14 PM
*To:* django-users@googlegroups.com 


*Subject:* Re: How do I store details securely with django?
On 12/11/2018 12:47 AM, Lance Haig wrote:
> Hi,
>
> I have a project I am working on https://github.com/lhaig/usery/ and
> part of the roadmap of the project is to add more cloud types to the
> list.
>
> I wanted to allow admins for these services to login and create
> records for their different clouds in the DB and then use these when
> people request access to these services.
>
> I need to find a secure way to store these credentials so that even if
> the DB is compromised that the credentials are safe.

I agree credentials should not be stored in the database but what are
your other assumptions about the threats?

How many sets of credentials will there be?

In future, will you be using simple credentials or tokens, certificates,
multi factor auth?

If this is a prototype and only a few sets are involved you can store
credentials in a file or one file per set and write a method to fetch
them as required. That will keep them out of the database and let you
rejig the method after you have decided how it should really work.

>
> Does anyone have suggestions on how I can accomplish this?
>
> I 

Re: Why I can't pass anything to my html? Django 2.1

2018-11-12 Thread amit pant
you need to make dictionary for display variables using html

On Mon, Nov 12, 2018 at 6:57 PM Cuneyt Mertayak  wrote:

> vvv Typo: read "context" instead of "content" vvv
>
> On Monday, November 12, 2018 at 5:26:48 AM UTC-8, Cuneyt Mertayak wrote:
>>
>> The content for the `render` method is supposed to be a dictionary:
>> https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments
>>
>> So change it to this render(requset, "FrounterWeb/body.html",{'tank':
>> tank})
>>
>> Also in the template file you want to display the properties of the ORM
>> (tank_system) object I guess, change them to {{tank.EC}}, 
>> {{tank. temp}}, respectively.
>>
>> Hope it helps!
>>
>> On Monday, November 12, 2018 at 4:13:21 AM UTC-8, Rookies DJ wrote:
>>>
>>> I been trying 2 weeks on trying to pass variables form Django views into
>>> html, but every time I run my code, it works but it doesn't display the
>>> variable I see
>>>
>>> from django.shortcuts import render
>>> from zigview.models import tank_system
>>>
>>> def index(request):
>>> return render(request,'FrounterWeb/includes.html')
>>>
>>> def login(requset):
>>> return render(requset, 'FrounterWeb/login.html')
>>>
>>>
>>> def timedex(requset):
>>> tank = tank_system.object.get(id(5))
>>> print(tank)
>>> return render(requset, "FrounterWeb/body.html",tank)
>>>
>>>
>>> Here my models
>>>
>>> from django.db import models
>>>
>>>
>>> class user(models.Model):
>>> username = models.CharField(max_length=50)
>>> password = models.CharField(max_length=50)
>>>
>>>
>>> class tank_system(models.Model):
>>> Ph = models.DecimalField(max_digits=2, decimal_places=1)
>>> EC = models.DecimalField(max_digits=2, decimal_places=1)
>>> temp = models.DecimalField(max_digits=2, decimal_places=0)
>>> level = models.IntegerField(primary_key=True, default=0)
>>> data = models.DateTimeField(auto_now=True)
>>>
>>>
>>> Here my HTML that i try pass variable in
>>>
>>> 
>>> 
>>>   Time
>>>   Tank level
>>>   EC
>>>   pH
>>>   room temptures
>>>   Water temptrure
>>> 
>>> 
>>>   22.30
>>>   900 lits
>>>   {{tank}}
>>>   7.3
>>>   {{tank}}
>>>   24
>>> 
>>>
>>> 
>>>
>>>
>>> My HTML body structures
>>>
>>> Web
>>>
>>> ├── templates
>>> │   ├── index.hmtl
>>> │   │   └── includes
>>> │   ├── body.hml
>>> │   ├── header.html
>>>
>>>   This my urls files;
>>>
>>> from django.contrib import admin
>>> from django.urls import include, path
>>> from django.views.generic.base import TemplateView
>>>
>>> urlpatterns = [
>>> path(r'^admin/$', admin.site.urls),
>>> path('account', include('django.contrib.auth.urls')),
>>> path('', include('zigview.urls')),
>>> path(r'', TemplateView.as_view(template_name='index.html'), name = 
>>> 'myapp'),
>>> ]
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0ccdcf5d-1d90-41e4-be33-f3684dace2b1%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF2Ah_H%3DP7sJDXYPsg2SMiqVKUFe9cUFRkej%3DQ-rn_2XdkgSRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy django project using gunicorn

2018-11-12 Thread amit pant
check your models, might be there is some spelling error.
if you share your models.py file then we could do more help.

On Mon, Nov 12, 2018 at 8:28 PM Yohandy Chiaawanda 
wrote:

> Hello
>
> I am currently following this guide
> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
> to set up django into digitalocean, and I kinda stuck at one point when I
> want to use gunicorn
> Whenever i type 'gunicorn --bind 0.0.0.0:8003 myproject.wsgi' ,there's
> always an ImportError showing up
> Here's the screenshot showing the error
> [image: error01.PNG]
> And here's the file __init__.py looks like
> [image: error02.PNG]
>
> Any suggestion and help is really appreciated
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a8e3098f-465e-4986-aca3-f4f196645423%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF2Ah_F%2BGR9F7WQVKtvEV7-R_v49HwAVOaeAkRggDjn-buRjzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: can't save data to the database

2018-11-12 Thread Andréas Kühne
No, I meant like this:

def Contact(request):
if request.method == 'POST':
form = ContactUsForm(request.POST)
if form.is_valid():
form.save()
context = {'form': form}

return redirect('contactus.html')
else:
form = ContactUsForm()

return render(request,  'contactus.html', {'form': form})


Also - the redirect should go to a valid django route - What is the route
that you want to redirect to after a successful posting?

Another thing you should also look into is using class based views instead
of function based views, because then you don't need to write as much code
- but get this working first! :-)

Regards,

Andréas


Den mån 12 nov. 2018 kl 15:38 skrev Tosin Ayoola :

> you mean i should have it like this
> def Contact(request):
> if request.method == 'POST':
> form = ContactUsForm(request.POST)
> if form.is_valid():
> form.save()
> context = {'form': form}
>
> return redirect('contactus.html')
>
>
>
> else:
> form = ContactUsForm()
> return( 'contactus.html', ) or .
>
>
> On Mon, Nov 12, 2018 at 3:31 PM Andréas Kühne 
> wrote:
>
>> Just move the return render part from the get request path to always
>> return. That way you will get the form with the correct information when
>> the form isn't valid.
>>
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den mån 12 nov. 2018 kl 15:20 skrev Tosin Ayoola > >:
>>
>>> yes the form is valid and the issue is the form doesn't display any
>>> error if the required field are not filled
>>> even when i use just the form = ContactUsForm(request.POST), it still
>>> doesn't work
>>> as for the third wat do you suggest i do ?
>>>
>>> On Mon, Nov 12, 2018 at 3:06 PM Andréas Kühne <
>>> andreas.ku...@hypercode.se> wrote:
>>>
 Hi,

 First of all - are you sure that the form is valid? You don't show the
 ContactUs model, but I'm guessing that all fields are required? Are they
 all filled in?
 Second - in the contact method you first check if it is a POST and then
 populate with: form = ContactUsForm(request.POST or None).
 The "or None" part won't do anything - it will never be called.
 Finally - if the form ISN'T valid - the user won't get any response at
 all? It'll just go to en empty page?

 Regards,

 Andréas


 Den mån 12 nov. 2018 kl 14:31 skrev Tosin Ayoola <
 tosinayoo...@gmail.com>:

> halo,
> working on a contact us form to receive information from the user but
> my issue is the data doesn't get save to the database and i'm not getting
> any error message can anyone help out
> below is my view an forms.py
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHLKn70gTCa98GpXiYfm1kJqqQZHYiaYz4U39ocBCuGa4n-3Lw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAK4qSCfjemsyhhfOiDEB1oXFrPL47ixb_Vvq2624Pwv1ddBeuw%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK4qSCcSp_L%2BNpHCqM4Yf04%2Byftm9t_DBXe05grHEGMTgrrv4w%40mail.gmail.com
>> 

Deploy django project using gunicorn

2018-11-12 Thread Yohandy Chiaawanda
Hello

I am currently following this 
guide 
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
 
to set up django into digitalocean, and I kinda stuck at one point when I 
want to use gunicorn
Whenever i type 'gunicorn --bind 0.0.0.0:8003 myproject.wsgi' ,there's 
always an ImportError showing up
Here's the screenshot showing the error
[image: error01.PNG]
And here's the file __init__.py looks like
[image: error02.PNG]

Any suggestion and help is really appreciated 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a8e3098f-465e-4986-aca3-f4f196645423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: can't save data to the database

2018-11-12 Thread Andréas Kühne
Just move the return render part from the get request path to always
return. That way you will get the form with the correct information when
the form isn't valid.


Regards,

Andréas


Den mån 12 nov. 2018 kl 15:20 skrev Tosin Ayoola :

> yes the form is valid and the issue is the form doesn't display any error
> if the required field are not filled
> even when i use just the form = ContactUsForm(request.POST), it still
> doesn't work
> as for the third wat do you suggest i do ?
>
> On Mon, Nov 12, 2018 at 3:06 PM Andréas Kühne 
> wrote:
>
>> Hi,
>>
>> First of all - are you sure that the form is valid? You don't show the
>> ContactUs model, but I'm guessing that all fields are required? Are they
>> all filled in?
>> Second - in the contact method you first check if it is a POST and then
>> populate with: form = ContactUsForm(request.POST or None).
>> The "or None" part won't do anything - it will never be called.
>> Finally - if the form ISN'T valid - the user won't get any response at
>> all? It'll just go to en empty page?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den mån 12 nov. 2018 kl 14:31 skrev Tosin Ayoola > >:
>>
>>> halo,
>>> working on a contact us form to receive information from the user but my
>>> issue is the data doesn't get save to the database and i'm not getting any
>>> error message can anyone help out
>>> below is my view an forms.py
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAHLKn70gTCa98GpXiYfm1kJqqQZHYiaYz4U39ocBCuGa4n-3Lw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK4qSCfjemsyhhfOiDEB1oXFrPL47ixb_Vvq2624Pwv1ddBeuw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcSp_L%2BNpHCqM4Yf04%2Byftm9t_DBXe05grHEGMTgrrv4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: can't save data to the database

2018-11-12 Thread Andréas Kühne
Hi,

First of all - are you sure that the form is valid? You don't show the
ContactUs model, but I'm guessing that all fields are required? Are they
all filled in?
Second - in the contact method you first check if it is a POST and then
populate with: form = ContactUsForm(request.POST or None).
The "or None" part won't do anything - it will never be called.
Finally - if the form ISN'T valid - the user won't get any response at all?
It'll just go to en empty page?

Regards,

Andréas


Den mån 12 nov. 2018 kl 14:31 skrev Tosin Ayoola :

> halo,
> working on a contact us form to receive information from the user but my
> issue is the data doesn't get save to the database and i'm not getting any
> error message can anyone help out
> below is my view an forms.py
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHLKn70gTCa98GpXiYfm1kJqqQZHYiaYz4U39ocBCuGa4n-3Lw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfjemsyhhfOiDEB1oXFrPL47ixb_Vvq2624Pwv1ddBeuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


dfsga

2018-11-12 Thread siyabulela batyi
Enter code here...

siyabulelabatyi@gmail.
Attach a filecom 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3f9a8c9-37b4-4f04-82e6-fbb28a91ef6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


can't save data to the database

2018-11-12 Thread Tosin Ayoola
halo,
working on a contact us form to receive information from the user but my
issue is the data doesn't get save to the database and i'm not getting any
error message can anyone help out
below is my view an forms.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn70gTCa98GpXiYfm1kJqqQZHYiaYz4U39ocBCuGa4n-3Lw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why I can't pass anything to my html? Django 2.1

2018-11-12 Thread Cuneyt Mertayak
vvv Typo: read "context" instead of "content" vvv

On Monday, November 12, 2018 at 5:26:48 AM UTC-8, Cuneyt Mertayak wrote:
>
> The content for the `render` method is supposed to be a dictionary: 
> https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments
>
> So change it to this render(requset, "FrounterWeb/body.html",{'tank': 
> tank})
>
> Also in the template file you want to display the properties of the ORM 
> (tank_system) object I guess, change them to {{tank.EC}}, 
> {{tank. temp}}, respectively.
>
> Hope it helps!
>
> On Monday, November 12, 2018 at 4:13:21 AM UTC-8, Rookies DJ wrote:
>>
>> I been trying 2 weeks on trying to pass variables form Django views into 
>> html, but every time I run my code, it works but it doesn't display the 
>> variable I see 
>>
>> from django.shortcuts import render
>> from zigview.models import tank_system
>>
>> def index(request):
>> return render(request,'FrounterWeb/includes.html')
>>
>> def login(requset):
>> return render(requset, 'FrounterWeb/login.html')
>>
>>
>> def timedex(requset):
>> tank = tank_system.object.get(id(5))
>> print(tank)
>> return render(requset, "FrounterWeb/body.html",tank)
>>
>>
>> Here my models
>>
>> from django.db import models
>>
>>
>> class user(models.Model):
>> username = models.CharField(max_length=50)
>> password = models.CharField(max_length=50)
>>
>>
>> class tank_system(models.Model):
>> Ph = models.DecimalField(max_digits=2, decimal_places=1)
>> EC = models.DecimalField(max_digits=2, decimal_places=1)
>> temp = models.DecimalField(max_digits=2, decimal_places=0)
>> level = models.IntegerField(primary_key=True, default=0)
>> data = models.DateTimeField(auto_now=True)
>>
>>
>> Here my HTML that i try pass variable in 
>>
>> 
>> 
>>   Time
>>   Tank level
>>   EC
>>   pH
>>   room temptures
>>   Water temptrure
>> 
>> 
>>   22.30
>>   900 lits
>>   {{tank}}
>>   7.3
>>   {{tank}}
>>   24
>> 
>>
>> 
>>
>>
>> My HTML body structures
>>
>> Web
>>
>> ├── templates
>> │   ├── index.hmtl
>> │   │   └── includes
>> │   ├── body.hml
>> │   ├── header.html
>>
>>   This my urls files;
>>
>> from django.contrib import admin
>> from django.urls import include, path
>> from django.views.generic.base import TemplateView
>>
>> urlpatterns = [
>> path(r'^admin/$', admin.site.urls),
>> path('account', include('django.contrib.auth.urls')),
>> path('', include('zigview.urls')),
>> path(r'', TemplateView.as_view(template_name='index.html'), name = 
>> 'myapp'),
>> ]
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0ccdcf5d-1d90-41e4-be33-f3684dace2b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why I can't pass anything to my html? Django 2.1

2018-11-12 Thread Cuneyt Mertayak
The content for the `render` method is supposed to be a 
dictionary: 
https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments

So change it to this render(requset, "FrounterWeb/body.html",{'tank': tank})

Also in the template file you want to display the properties of the ORM 
(tank_system) object I guess, change them to {{tank.EC}}, 
{{tank. temp}}, respectively.

Hope it helps!

On Monday, November 12, 2018 at 4:13:21 AM UTC-8, Rookies DJ wrote:
>
> I been trying 2 weeks on trying to pass variables form Django views into 
> html, but every time I run my code, it works but it doesn't display the 
> variable I see 
>
> from django.shortcuts import render
> from zigview.models import tank_system
>
> def index(request):
> return render(request,'FrounterWeb/includes.html')
>
> def login(requset):
> return render(requset, 'FrounterWeb/login.html')
>
>
> def timedex(requset):
> tank = tank_system.object.get(id(5))
> print(tank)
> return render(requset, "FrounterWeb/body.html",tank)
>
>
> Here my models
>
> from django.db import models
>
>
> class user(models.Model):
> username = models.CharField(max_length=50)
> password = models.CharField(max_length=50)
>
>
> class tank_system(models.Model):
> Ph = models.DecimalField(max_digits=2, decimal_places=1)
> EC = models.DecimalField(max_digits=2, decimal_places=1)
> temp = models.DecimalField(max_digits=2, decimal_places=0)
> level = models.IntegerField(primary_key=True, default=0)
> data = models.DateTimeField(auto_now=True)
>
>
> Here my HTML that i try pass variable in 
>
> 
> 
>   Time
>   Tank level
>   EC
>   pH
>   room temptures
>   Water temptrure
> 
> 
>   22.30
>   900 lits
>   {{tank}}
>   7.3
>   {{tank}}
>   24
> 
>
> 
>
>
> My HTML body structures
>
> Web
>
> ├── templates
> │   ├── index.hmtl
> │   │   └── includes
> │   ├── body.hml
> │   ├── header.html
>
>   This my urls files;
>
> from django.contrib import admin
> from django.urls import include, path
> from django.views.generic.base import TemplateView
>
> urlpatterns = [
> path(r'^admin/$', admin.site.urls),
> path('account', include('django.contrib.auth.urls')),
> path('', include('zigview.urls')),
> path(r'', TemplateView.as_view(template_name='index.html'), name = 
> 'myapp'),
> ]
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7973bb6a-6b32-468f-9c21-a2c5c47e8880%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is Django REST framework a part of Django?

2018-11-12 Thread Jason
DRF is separate from django, despite the name.  From what I understand, the 
author and maintainers have decided to keep it from being bound to the 
django release cycle and allow their own schedule of updates and releases.

FWIW, DRF is great, I work with it daily on services that average a 
cumulative total of around 2500 requests/minute, and a number of FE 
applications are implemented in react to consume the data.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cecfe161-6e46-45d5-9af9-ce5823958d72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why I can't pass anything to my html? Django 2.1

2018-11-12 Thread Tosin Ayoola
halo,
working on a contact us form to receive information from the user but my
issue is the data doesn't get save to the database and i'm not getting any
error message can anyone help out
below is my view an forms.py

On Mon, Nov 12, 2018 at 1:12 PM Rookies DJ  wrote:

> I been trying 2 weeks on trying to pass variables form Django views into
> html, but every time I run my code, it works but it doesn't display the
> variable I see
>
> from django.shortcuts import render
> from zigview.models import tank_system
>
> def index(request):
> return render(request,'FrounterWeb/includes.html')
>
> def login(requset):
> return render(requset, 'FrounterWeb/login.html')
>
>
> def timedex(requset):
> tank = tank_system.object.get(id(5))
> print(tank)
> return render(requset, "FrounterWeb/body.html",tank)
>
>
> Here my models
>
> from django.db import models
>
>
> class user(models.Model):
> username = models.CharField(max_length=50)
> password = models.CharField(max_length=50)
>
>
> class tank_system(models.Model):
> Ph = models.DecimalField(max_digits=2, decimal_places=1)
> EC = models.DecimalField(max_digits=2, decimal_places=1)
> temp = models.DecimalField(max_digits=2, decimal_places=0)
> level = models.IntegerField(primary_key=True, default=0)
> data = models.DateTimeField(auto_now=True)
>
>
> Here my HTML that i try pass variable in
>
> 
> 
>   Time
>   Tank level
>   EC
>   pH
>   room temptures
>   Water temptrure
> 
> 
>   22.30
>   900 lits
>   {{tank}}
>   7.3
>   {{tank}}
>   24
> 
>
> 
>
>
> My HTML body structures
>
> Web
>
> ├── templates
> │   ├── index.hmtl
> │   │   └── includes
> │   ├── body.hml
> │   ├── header.html
>
>   This my urls files;
>
> from django.contrib import admin
> from django.urls import include, path
> from django.views.generic.base import TemplateView
>
> urlpatterns = [
> path(r'^admin/$', admin.site.urls),
> path('account', include('django.contrib.auth.urls')),
> path('', include('zigview.urls')),
> path(r'', TemplateView.as_view(template_name='index.html'), name = 
> 'myapp'),
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8123c3d9-e972-426f-9b1f-46a463b98548%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHLKn72vc8NQ1OvR46Dg3Uf_EZEfp2zfNbwCRHja%2B6XHZqWx5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Update profile on login

2018-11-12 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Fri, Nov 09, 2018 at 08:32:28AM -0800, pastrufazio wrote:
> Il giorno venerdì 9 novembre 2018 11:37:23 UTC+1, Michal Petrucha ha 
> scritto:
> 
> Found it. :) The error lies in the filter() call: 
> >
> > Thank you very much. I fixed it using  
> 
> @receiver(user_logged_in, sender=User)
> def user_logged_in_callback(sender, user, request, **kwargs):
> Profile.objects.filter(user=user).exclude(date_activation__isnull=False
> ).update(date_activation=datetime.now())
> 
>  
> 
> > By the way, I suggest that you use django.utils.timezone.now() instead 
> > of datetime.now; it's usually a good idea to use timezone-aware 
> > timestamps. And side note, you need to call the function; 
> >
> I will try it out, thanks.
> 
> QuerySet.update doesn't accept callables. 
> >
> Sorry, what does it mean? 

Callables in Python are objects that you can call – typically a
function, but it can also be some other object that defines __call__.

Here I was just pointing out that your original code was
“.update(date_activation=datetime.now)”, meaning that you were passing
the function datetime.now to update, rather than the result of calling
it, and that wouldn't work. However, I can see that you fixed that in
your updated code, so nothing to see here. ;)

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJb6W/oAAoJEHA7T/IPM/klaRUP/3Jwvq9cCzzFL40pnZAZeGON
OeMxriJOnvLa/P3AiAa4cuUhqMmOnJDdWMGsozxVcY3QH7cQ0DgUVu1zl+ZZv0gj
ErPFzARvRaRhvfaYB01BhDRyj06Sgbufe20JmKqQDaUqo1ZcFEG4bEloq2Lp/Y6W
RcPLM/2Q4zH8AjfYD0F/RXFs4ktLVZ2esoOWtW8sqwFHAdOnB3hj1Kb1p8hPm5WD
ZZHrDkRajL/o0f1D29qQVXKoByQktWk0Gg47syztc1+CsdwmxDA6uwruHtajwILg
pQ84HnDy9YjoE1EAM9/DchjfrccrzZVUhtZtshAAvvEL90NpqDawepv+9Y2y6XZS
qS1cG0FTTyoRlVNBmSGbB1CxXy+26vFKKz56seorOUWS0vJ6OwoawMtngkoVEzU8
k8HDZ9iVbmtuY9TsjoDPfpfJJlZAEO45cay3Hu0Bm5ianon37sauagvS8RlHPSuB
V74hvySKLuaxHx0BShX+tHfOsXetFj+yEnNOCzKAps/Q1NlCE9NaHE43AmtUMlL/
+3LEM5LScg1HdGFufIsALf0cZi5hFCxEOoMFFGtcNETgw4Xhd+XAbqxf1a8EmhUT
gbTyS1aTrYhGr2ubpzIa5dE6UhlTsPA2AeAZCBt2DGvV8Ai7SvC7v6oYWGzPJFRX
8Ld48aT5Aa7U0NugUghn
=UII/
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20181112121953.GD8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Is Django REST framework a part of Django?

2018-11-12 Thread Bill Watkins
Good day, 

I've read an article about Django REST framework, and have a question: is 
this framework a part of Django?
I'm actually going to use it only for REST, cause we are using 
microservices architecture, and UI container is a separate part. 
Is it good idea? What do you think?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d041ab7b-b926-4071-affe-0859cea5b48a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: hi everyone

2018-11-12 Thread Balaji Sijapati
Hi Ramakurthy,

you can get a sample django-Rest webservice project from internet and
customize it little bit [U can include same requirement you might have done
in Java or any other previous project] and put it in your Resume.  I hope
this helps.

Thanks & Regards
Balaji

On Sun, Nov 11, 2018 at 7:23 PM ramakurthy swamy 
wrote:

> i am looking for real time project based on python and django plz help `me
> and i want to keep that project in my resume plz help me guiess
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B2YGoh9EmLn6c-k2jNkm8f16YtaLgjD3D3k0jLAa7OLM9K9dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Why I can't pass anything to my html? Django 2.1

2018-11-12 Thread Rookies DJ
I been trying 2 weeks on trying to pass variables form Django views into 
html, but every time I run my code, it works but it doesn't display the 
variable I see 

from django.shortcuts import render
from zigview.models import tank_system

def index(request):
return render(request,'FrounterWeb/includes.html')

def login(requset):
return render(requset, 'FrounterWeb/login.html')


def timedex(requset):
tank = tank_system.object.get(id(5))
print(tank)
return render(requset, "FrounterWeb/body.html",tank)


Here my models

from django.db import models


class user(models.Model):
username = models.CharField(max_length=50)
password = models.CharField(max_length=50)


class tank_system(models.Model):
Ph = models.DecimalField(max_digits=2, decimal_places=1)
EC = models.DecimalField(max_digits=2, decimal_places=1)
temp = models.DecimalField(max_digits=2, decimal_places=0)
level = models.IntegerField(primary_key=True, default=0)
data = models.DateTimeField(auto_now=True)


Here my HTML that i try pass variable in 



  Time
  Tank level
  EC
  pH
  room temptures
  Water temptrure


  22.30
  900 lits
  {{tank}}
  7.3
  {{tank}}
  24





My HTML body structures

Web

├── templates
│   ├── index.hmtl
│   │   └── includes
│   ├── body.hml
│   ├── header.html

  This my urls files;

from django.contrib import admin
from django.urls import include, path
from django.views.generic.base import TemplateView

urlpatterns = [
path(r'^admin/$', admin.site.urls),
path('account', include('django.contrib.auth.urls')),
path('', include('zigview.urls')),
path(r'', TemplateView.as_view(template_name='index.html'), name = 'myapp'),
]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8123c3d9-e972-426f-9b1f-46a463b98548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Pradeep Singh
can i develop real estate web application using python+ django

On Mon, 12 Nov 2018 at 14:35, PASCUAL Eric  wrote:

> Hi Lance,
>
>
>  but I need for people who are admins for a particular cloud to add their
> cloud details to the app and then store their credentials securely.
>
>
> I'm not sure to understand the need for adding cloud details to the app
> for the admins.
>
>
> The suggestion I made assumed that sensitive information is managed as K8S
> secrets. As long as the admins have GCloud (for instance) credentials set
> (which are stored and managed at GCloud level), they can administrate the
> secrets resources by "applying" the corresponding YAML descriptors
> remotely from their workstation. The sensitive values are thus stored
> nowhere inside the application itself, but passed to the containers at
> runtime as environment variables.
>
>
> Maybe I've misunderstood your need and sorry in this case if my answer is
> off topic.
>
>
> Best
>
>
> Eric
> --
> *From:* django-users@googlegroups.com  on
> behalf of Lance Haig 
> *Sent:* Monday, November 12, 2018 9:07:30 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: How do I store details securely with django?
>
>
> Hi Eric,
>
>
> Thanks for the response.
>
>
> This idea has an end goal of being deployed in a resilient way so most
> probably docker with some form of orchestration, Docker swarm or Kubernetes.
>
>
> The credentials are mainly stored in a .env file at the moment and could
> be added to the secrets but I need for people who are admins for a
> particular cloud to add their cloud details to the app and then store their
> credentials securely.
>
>
> Unfortunately this will need a dynamic storage mechanism which i don't
> know how to do yet
>
>
> Regards
>
>
> Lance
>
>
>
> On 11/12/18 12:03 AM, PASCUAL Eric wrote:
>
> Hi,
>
>
> It can depend on which deployment option you plan to use for the
> application.
>
>
> For instance, a Docker deployment orchestrated by Kubernetes gives the
> option of using secrets for sensitive information, which a hoster such as
> GCP manages conveniently. In this kind of deployment, configuration (and
> secrets) are passed to the app as environment variables, on which
> Kubernetes configuration maps and secrets are mapped to. Thanks to this,
> values are stored nowhere in the app code, companion files or database.
>
>
> Regards
>
>
> Eric
> --
> *From:* django-users@googlegroups.com 
>  on behalf of Mike Dewhirst
>  
> *Sent:* Sunday, November 11, 2018 11:07:14 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: How do I store details securely with django?
>
> On 12/11/2018 12:47 AM, Lance Haig wrote:
> > Hi,
> >
> > I have a project I am working on https://github.com/lhaig/usery/ and
> > part of the roadmap of the project is to add more cloud types to the
> > list.
> >
> > I wanted to allow admins for these services to login and create
> > records for their different clouds in the DB and then use these when
> > people request access to these services.
> >
> > I need to find a secure way to store these credentials so that even if
> > the DB is compromised that the credentials are safe.
>
> I agree credentials should not be stored in the database but what are
> your other assumptions about the threats?
>
> How many sets of credentials will there be?
>
> In future, will you be using simple credentials or tokens, certificates,
> multi factor auth?
>
> If this is a prototype and only a few sets are involved you can store
> credentials in a file or one file per set and write a method to fetch
> them as required. That will keep them out of the database and let you
> rejig the method after you have decided how it should really work.
>
> >
> > Does anyone have suggestions on how I can accomplish this?
> >
> > I would really appreciate some advice.
> >
> > Regards
> >
> > Lance
> >
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c8819341-7c60-56ee-6298-3a6a7897e9b1%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 

Re: How do I store details securely with django?

2018-11-12 Thread PASCUAL Eric
Hi Lance,


 but I need for people who are admins for a particular cloud to add their cloud 
details to the app and then store their credentials securely.


I'm not sure to understand the need for adding cloud details to the app for the 
admins.


The suggestion I made assumed that sensitive information is managed as K8S 
secrets. As long as the admins have GCloud (for instance) credentials set 
(which are stored and managed at GCloud level), they can administrate the 
secrets resources by "applying" the corresponding YAML descriptors remotely 
from their workstation. The sensitive values are thus stored nowhere inside the 
application itself, but passed to the containers at runtime as environment 
variables.


Maybe I've misunderstood your need and sorry in this case if my answer is off 
topic.


Best


Eric


From: django-users@googlegroups.com  on behalf 
of Lance Haig 
Sent: Monday, November 12, 2018 9:07:30 AM
To: django-users@googlegroups.com
Subject: Re: How do I store details securely with django?


Hi Eric,


Thanks for the response.


This idea has an end goal of being deployed in a resilient way so most probably 
docker with some form of orchestration, Docker swarm or Kubernetes.


The credentials are mainly stored in a .env file at the moment and could be 
added to the secrets but I need for people who are admins for a particular 
cloud to add their cloud details to the app and then store their credentials 
securely.


Unfortunately this will need a dynamic storage mechanism which i don't know how 
to do yet


Regards


Lance



On 11/12/18 12:03 AM, PASCUAL Eric wrote:

Hi,


It can depend on which deployment option you plan to use for the application.


For instance, a Docker deployment orchestrated by Kubernetes gives the option 
of using secrets for sensitive information, which a hoster such as GCP manages 
conveniently. In this kind of deployment, configuration (and secrets) are 
passed to the app as environment variables, on which Kubernetes configuration 
maps and secrets are mapped to. Thanks to this, values are stored nowhere in 
the app code, companion files or database.


Regards


Eric


From: django-users@googlegroups.com 
 on behalf 
of Mike Dewhirst 
Sent: Sunday, November 11, 2018 11:07:14 PM
To: django-users@googlegroups.com
Subject: Re: How do I store details securely with django?

On 12/11/2018 12:47 AM, Lance Haig wrote:
> Hi,
>
> I have a project I am working on https://github.com/lhaig/usery/ and
> part of the roadmap of the project is to add more cloud types to the
> list.
>
> I wanted to allow admins for these services to login and create
> records for their different clouds in the DB and then use these when
> people request access to these services.
>
> I need to find a secure way to store these credentials so that even if
> the DB is compromised that the credentials are safe.

I agree credentials should not be stored in the database but what are
your other assumptions about the threats?

How many sets of credentials will there be?

In future, will you be using simple credentials or tokens, certificates,
multi factor auth?

If this is a prototype and only a few sets are involved you can store
credentials in a file or one file per set and write a method to fetch
them as required. That will keep them out of the database and let you
rejig the method after you have decided how it should really work.

>
> Does anyone have suggestions on how I can accomplish this?
>
> I would really appreciate some advice.
>
> Regards
>
> Lance
>
>
>

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8819341-7c60-56ee-6298-3a6a7897e9b1%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: hi everyone

2018-11-12 Thread PASCUAL Eric
Hi,


I didn't understand the explanation you gave about the reference to "real time" 
 in the context of your project. Please, have a look at this page for instance 
(https://en.wikipedia.org/wiki/Real-time_computing) to understand what "real 
time" means in computing.

With respect to having a complete Django project as an example for learning, 
the "poll" application used in the series of tutorials which are part of the 
official documentation should answer your expectation. Did you study this 
tutorials ? Almost (if not all) Django users have started their learning 
journey there. Have also a look at Django girls web site 
(https://djangogirls.org/). Don't be fooled by its name, this site is one of 
the best places to stop at when it comes to find serious help about Django.

Best


Eric


From: django-users@googlegroups.com  on behalf 
of akash kandpal <9654263057akashkand...@gmail.com>
Sent: Monday, November 12, 2018 7:56:16 AM
To: django-users@googlegroups.com
Subject: Re: hi everyone

I mean we can see some working projects and learn from it by implementing them 
ourselves and thus it will be more of a learning opportunity for us.


Regards,
Akash Kandpal.

On Mon, Nov 12, 2018, 12:22 PM Joel mailto:j...@eyrie.in> wrote:
I don't really understand what you mean. How can you put something on your 
resume when you haven't contributed to it?

On Mon, 12 Nov, 2018, 12:06 PM ramakurthy swamy 
mailto:veeraswam...@gmail.com> wrote:
hi sir thank u for giving reply and the real time means what the present 
projects are going on company based on python and django,,,
And i have a two years gap in my academic period based on that project i want 
to fill-up that gap so plz kindly help

On Sun, Nov 11, 2018 at 7:45 PM PASCUAL Eric 
mailto:eric.pasc...@cstb.fr>> wrote:

Hi,


What do you mean exactly by "real time" ? Can you describe the project you are 
thinking about ?


"Real time" relates to a very specific class of software, which one of the 
characteristics is to react to external events in a (most often) short and, 
deterministic time. For sure, neither Python nor Django fulfill the involved 
technical requirements, especially considering the deterministic property which 
is one of the RT non negotiable aspect.


BTW can you elaborate a bit on what you mean by "i want to keep that project in 
my resume" ?


Regards


Eric


From: django-users@googlegroups.com 
mailto:django-users@googlegroups.com>> on behalf 
of ramakurthy swamy mailto:veeraswam...@gmail.com>>
Sent: Sunday, November 11, 2018 2:29:51 PM
To: Django users
Subject: hi everyone

i am looking for real time project based on python and django plz help `me and 
i want to keep that project in my resume plz help me guiess


--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f7b6adcd-4d1a-4f3a-abc7-b659be3c842c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/VI1P193MB04326D4B9AAA3A7EA2A856348CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: solve problem to load template

2018-11-12 Thread PASCUAL Eric
Hi,


Is the directory where your template file resides included in the list of paths 
configured in the settings of your application ?


Regards


Eric


From: django-users@googlegroups.com  on behalf 
of Mohammad Shareef M 
Sent: Monday, November 12, 2018 6:48:14 AM
To: django-users@googlegroups.com
Subject: solve problem to load template


template = get_template('reports_base.html')

{TemplateDoesNotExist}common_email_templates/partial_display_marketing_msg.html

Pls help to solve this problem
Thanks & Regards,
Mahammad Shareef M
[https://docs.google.com/uc?export=download=1wRZggGgvC7aSRZr21VAUfps9COVQmgOo=0Bzqees_1E8QUYzBxS0c5MUhwMGlnQlhTZitBKyszY2hKbDE0PQ]
 +919741482617
[https://docs.google.com/uc?export=download=1JLoMU48d8YKWmpuk2AEeyEq8yU4fSYMB=0Bzqees_1E8QUSDhiY1RueldsUi9STlNiTmxqV1JQUVlDZk9NPQ]
 +971501340618
[https://docs.google.com/uc?export=download=1JLoMU48d8YKWmpuk2AEeyEq8yU4fSYMB=0Bzqees_1E8QUSDhiY1RueldsUi9STlNiTmxqV1JQUVlDZk9NPQ]
 +971581756035

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUAdBEceLjivAqq0_3SUGFBMj5kFdqU52UCrZYO_1UA3MQt%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/VI1P193MB043206106A26140AE3803A0F8CC10%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst

On 12/11/2018 7:02 PM, Lance Haig wrote:

Hi,

Thanks for responding.

My answers inline


On 11/11/18 11:07 PM, Mike Dewhirst wrote:

On 12/11/2018 12:47 AM, Lance Haig wrote:

Hi,

I have a project I am working on https://github.com/lhaig/usery/ and 
part of the roadmap of the project is to add more cloud types to the 
list.


I wanted to allow admins for these services to login and create 
records for their different clouds in the DB and then use these when 
people request access to these services.


I need to find a secure way to store these credentials so that even 
if the DB is compromised that the credentials are safe.


I agree credentials should not be stored in the database but what are 
your other assumptions about the threats?


How many sets of credentials will there be?



it could potentially be 5 to 10 per admin account




In future, will you be using simple credentials or tokens, 
certificates, multi factor auth?



These credentials are access details to other clouds.

The application is a user sandbox portal to allow admins to grant X 
number of days access to a cloud for testing and discovery.


It currently is focused on openstack but he roadmap plan is to add 
docker Kubernetes etc..


So I need to have the ability for the cloud admins to add or remove 
authentication details as they are needed.


I haven't thought deeply about this because it is not my project but on 
the surface, if they are temporary credentials I cannot see much need 
for heavy duty security.


If the perceived risk is database compromise it might be better to 
configure the database or the database server with an ACL including only 
the Django server IP address and perhaps one or two trusted people.


Maybe Kubernetes secrets is the eventual way forward but scalability is 
assured if you can keep the creds in the database.


What about a separate non-public schema (assuming Postgres) for creds? 
I'm sure you could lock that down to particular permission groups which 
ought keep things secure enough.


The bottom line question: What is lost if temporary creds are compromised?

Risk is hazard multiplied by likelihood/opportunity

If you can reduce either side of that equation you reduce risk.

What plan do you have to execute to recover from the feared event 
when/if it happens?


When all things are considered the answer to that last question 
determines how much effort is warranted.








If this is a prototype and only a few sets are involved you can store 
credentials in a file or one file per set and write a method to fetch 
them as required. That will keep them out of the database and let you 
rejig the method after you have decided how it should really work.


I currently use the .env file to hold these credentials but that does 
not scale very well when you need to add more and more.





Does anyone have suggestions on how I can accomplish this?

I would really appreciate some advice.

Regards

Lance









--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6bb90c6-3f28-b190-d631-3f7b20fd2f99%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig

Hi Eric,


Thanks for the response.


This idea has an end goal of being deployed in a resilient way so most 
probably docker with some form of orchestration, Docker swarm or Kubernetes.



The credentials are mainly stored in a .env file at the moment and could 
be added to the secrets but I need for people who are admins for a 
particular cloud to add their cloud details to the app and then store 
their credentials securely.



Unfortunately this will need a dynamic storage mechanism which i don't 
know how to do yet



Regards


Lance



On 11/12/18 12:03 AM, PASCUAL Eric wrote:


Hi,


It can depend on which deployment option you plan to use for the 
application.



For instance, a Docker deployment orchestrated by Kubernetes gives the 
option of using secrets for sensitive information, which a hoster such 
as GCP manages conveniently. In this kind of deployment, configuration 
(and secrets) are passed to the app as environment variables, on which 
Kubernetes configuration maps and secrets are mapped to. Thanks to 
this, values are stored nowhere in the app code, companion files or 
database.



Regards


Eric


*From:* django-users@googlegroups.com  
on behalf of Mike Dewhirst 

*Sent:* Sunday, November 11, 2018 11:07:14 PM
*To:* django-users@googlegroups.com
*Subject:* Re: How do I store details securely with django?
On 12/11/2018 12:47 AM, Lance Haig wrote:
> Hi,
>
> I have a project I am working on https://github.com/lhaig/usery/ and
> part of the roadmap of the project is to add more cloud types to the
> list.
>
> I wanted to allow admins for these services to login and create
> records for their different clouds in the DB and then use these when
> people request access to these services.
>
> I need to find a secure way to store these credentials so that even if
> the DB is compromised that the credentials are safe.

I agree credentials should not be stored in the database but what are
your other assumptions about the threats?

How many sets of credentials will there be?

In future, will you be using simple credentials or tokens, certificates,
multi factor auth?

If this is a prototype and only a few sets are involved you can store
credentials in a file or one file per set and write a method to fetch
them as required. That will keep them out of the database and let you
rejig the method after you have decided how it should really work.

>
> Does anyone have suggestions on how I can accomplish this?
>
> I would really appreciate some advice.
>
> Regards
>
> Lance
>
>
>

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8819341-7c60-56ee-6298-3a6a7897e9b1%40dewhirst.com.au.

For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/VI1P193MB043243D0747282C2D96F60E38CC00%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/478ff804-4204-54c2-ba62-c0e4f9d64f89%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I store details securely with django?

2018-11-12 Thread Lance Haig

Hi,

Thanks for responding.

My answers inline


On 11/11/18 11:07 PM, Mike Dewhirst wrote:

On 12/11/2018 12:47 AM, Lance Haig wrote:

Hi,

I have a project I am working on https://github.com/lhaig/usery/ and 
part of the roadmap of the project is to add more cloud types to the 
list.


I wanted to allow admins for these services to login and create 
records for their different clouds in the DB and then use these when 
people request access to these services.


I need to find a secure way to store these credentials so that even 
if the DB is compromised that the credentials are safe.


I agree credentials should not be stored in the database but what are 
your other assumptions about the threats?


How many sets of credentials will there be?



it could potentially be 5 to 10 per admin account




In future, will you be using simple credentials or tokens, 
certificates, multi factor auth?



These credentials are access details to other clouds.

The application is a user sandbox portal to allow admins to grant X 
number of days access to a cloud for testing and discovery.


It currently is focused on openstack but he roadmap plan is to add 
docker Kubernetes etc..


So I need to have the ability for the cloud admins to add or remove 
authentication details as they are needed.





If this is a prototype and only a few sets are involved you can store 
credentials in a file or one file per set and write a method to fetch 
them as required. That will keep them out of the database and let you 
rejig the method after you have decided how it should really work.


I currently use the .env file to hold these credentials but that does 
not scale very well when you need to add more and more.





Does anyone have suggestions on how I can accomplish this?

I would really appreciate some advice.

Regards

Lance







--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9fa91ea9-58dc-bbc6-4e3c-e4142170cc7b%40gmail.com.
For more options, visit https://groups.google.com/d/optout.