question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parent view seen as a string in template

See original GitHub issue

Hi,
I’m trying to register user via django-unicorn but I’m having issue with session:

File "REDACTED/unicorn/app/components/email.py", line 57, in register_email  
    login(self.request, user)  
  File "REDACTED/.venv/lib/python3.9/site-packages/django/contrib/auth/__init__.py", line 102, in login  
    if SESSION_KEY in request.session:  
AttributeError: 'NoneType' object has no attribute 'session'

Here is the code I’m running:

def register_email(self):  # TODO: Add rate limiting
            pwd = get_random_string(32)
            user = CustomUser.objects.create_user(email=self.email, password=pwd)
            user = authenticate(email=self.email, password=pwd)
            login(self.request, user)
            print("logged")
            return redirect('/register')

Hope this helps.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
VivienGiraudcommented, Oct 9, 2021

Holy crap! The real problem I had since the beggining was the missing unicorn in the settings.py… I thought that only django_unicorn was needed 😕 Thanks a lot @adamghill !

1reaction
adamghillcommented, Oct 7, 2021

Thanks, I’ll take a look at this as soon as possible!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - display a string property, defined in Child... in the ...
This value is only read 'AfterViewInit'. The parent would need some sort of event to update the value when it gets changed in...
Read more >
Sharing data between child and parent directives ... - Angular
The $event contains the data that the user types into the <input> in the child template UI. To see the @Output() working, add...
Read more >
How to pass string to a component using Angular2
In angular2, a component is considered as a 'view' with its own logic and ... by the child component from the parent component...
Read more >
Props | Vue.js
So far, you've seen props passed as static values, like in: template <BlogPost title="My journey with Vue" />. You've also seen props assigned...
Read more >
Outputs in ARM template - Azure Resource Manager
Describes how to define output values in an Azure Resource Manager template (ARM template).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found