Skip to content

accounts/signup/ not loading form #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue May 26, 2018 · 3 comments
Open

accounts/signup/ not loading form #11

ghost opened this issue May 26, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented May 26, 2018

@dfurtado

After creating the views for user creation, when I try to test at http://127.0.0.1:8000/accounts/signup/,
the 'SignUp' form is not loading. I have cross-checked every bit of my code with your code and couldn't find any difference or errors. Any idea why my user signup page not loading the signup form? Stuck here since two days and can't move forward until it resolved. I have attached the screen shot of my blank page.
signup_not_loading_form

Appreciate your help.

Regards

@ghost
Copy link
Author

ghost commented May 26, 2018

User login page is working fine though! My code https://github.com/armaanreza/django-store/tree/main-app

@dfurtado
Copy link
Collaborator

hi @armaanreza
I've had a quick look at your code and I noticed that you are using double quotes in the extends and block tags in the template. I cloned your project to test it out and when I changed it to single quotes it worked fine, have a look at https://github.com/PacktPublishing/Python-Programming-Blueprints/blob/master/Chapter07/gamestore/main/templates/main/signup.html

Let me know how it goes.

Regards,

//Daniel

@ghost
Copy link
Author

ghost commented May 28, 2018

Hey @dfurtado

Thanks for the response.

I apologies for the typo but after fixing it, both signup page and login page got screwed up!
Look at the screenshot below.

1

2

So, just wanted to ask you for my reference that most developers are not using any quote at {% block content %} but we are using single quote i.e 'content' , why is that? Is this a Django2.0 requirement? You can see that 'PyCharm' is not so happy about it and saying "Block identifier expected" as shown above in first image right side.

Since I was trying to fix the form element alignment problem in signup.html as shown above that padding issue below Username input, I have figured out that if I use {{ form.as_p }} in signup.html then it fixes the issue but still not prettier than yours one that mentioned in your book. Your User name input box is aligned with First name input box which is kind of look prettier. I was trying to achieve it but failed.

3

I have pushed the code again to github so that you can review and help me to find about these form alignment issues in both login and signup page. I have changed all to ' ' except one mismatch. I think it should be 'placeholder': 'User name' instead of 'First name' in your code. I have changed mine to 'User name'

`class SignupForm(forms.Form):

username = forms.CharField(
    max_length=10,
    widget=forms.TextInput({
        'class': 'form_control',
        'placeholder': 'User name'
    })
)`

I greatly appreciate your time and support to look into these code issues. It means a lot to me.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant