404 error

2020-09-12 Thread Spyke Lionel
I have this urlpatterns.. urlpatterns = [ path('', views.index, name='index'), path('/', views.detail, name='detail'), ] my index.html looks like this Albums to display {% for album in all_albums %} {{ album.album_title }} {% endfor %} #my index.html simply displays my alb

Re: 404 error

2020-09-12 Thread 'Amitesh Sahay' via Django users
At the first glance, I think you havn't created URL pattern for "music". May bejust saying. Regards, Amitesh  On Saturday, 12 September, 2020, 12:47:56 pm IST, Spyke Lionel wrote: I have this urlpatterns.. urlpatterns = [    path('', views.index, name='index'),    path('/', vie

Re: 404 error

2020-09-12 Thread Kunal Solanke
I think he have created the music url, But the {{album_id}} is not properly passed as context from view. On Sat, Sep 12, 2020, 12:52 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > At the first glance, I think you havn't created URL pattern for "music". > May bejus

Re: 404 error

2020-09-12 Thread Kunal Solanke
In your template it should be {{album.id}} or {{album.album_id}} depending how your models are.I am talling about href in anchor tag. On Sat, Sep 12, 2020, 12:54 Kunal Solanke wrote: > I think he have created the music url, > But the {{album_id}} is not properly passed as context from view. > >

Re: 404 error

2020-09-12 Thread 'Amitesh Sahay' via Django users
You are trying "http://127.0.0.1:8000/music//"; try something like http://127.0.0.1:8000// Regards, Amitesh  On Saturday, 12 September, 2020, 12:55:57 pm IST, Kunal Solanke wrote: I think he have created the music url,But the {{album_id}} is not properly passed as context from view

Environment Variables for Django Secret Key etc On Windows 10 and Heroku

2020-09-12 Thread dum dum
I tried to put my Django Secret Key in Environment Variables. SECRET_KEY = os.environ.get('SECRET_KEY') I did save the SECRET_KEY on env var windows 10 like this [image: image.png] When I tried to py manage.py runserver, I got this error django.core.exceptions.ImproperlyConfigured: The SECRET_

Re: 404 error

2020-09-12 Thread Spyke Lionel
I don't understand how the url became http://127.0.0.1:8000/music// Instead of http://127.0.0.1:8000/music// On Sat, Sep 12, 2020, 8:29 AM 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > You are trying "http://127.0.0.1:8000/music//"; >

Re: 404 error

2020-09-12 Thread Kunal Solanke
Did you try what I told? On Sat, Sep 12, 2020, 14:05 Spyke Lionel wrote: > I don't understand how the url became > http://127.0.0.1:8000/music// > Instead of http://127.0.0.1:8000/music// > > > On Sat, Sep 12, 2020, 8:29 AM 'Amitesh Sahay' via Django users < > django-users@googlegroups.com> wrot

Re: 404 error

2020-09-12 Thread Spyke Lionel
yes I did. it should work properly. I just wanna display a list of items after the link has been clicked. But it happens that I get http://127.0.0.1:8000/music// The last forward slash shouldn't have added. This work when the integer is inserted manually on the address. http://127.0.0.1:8000/music/

I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mislav Jurić
Hey guys, I added an EmailField to some of my already existing models. When I tried to run: *python manage.py makemigrations* I got the following prompt: *You are trying to add a non-nullable field 'email' to employee wit

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mohammad Ahshan Danish
you need to give default value in email. seems few records are already exist. else delete sqllite file and try again. On Sat, Sep 12, 2020 at 6:22 PM Mislav Jurić wrote: > Hey guys, > > I added an EmailField > to > some of my

Re: Environment Variables for Django Secret Key etc On Windows 10 and Heroku

2020-09-12 Thread Mbah Victor
Have you try googling your problem Victor On Sat, Sep 12, 2020, 9:34 AM dum dum wrote: > I tried to put my Django Secret Key in Environment Variables. > > SECRET_KEY = os.environ.get('SECRET_KEY') > > I did save the SECRET_KEY on env var windows 10 like this > [image: image.png] > > > When I tr

Installation errors

2020-09-12 Thread Odeyale Kehinde
I want to install Django on my system but getting these errors. C:\Users\odeya>pip install Django==3.1.1 Collecting Django==3.1.1 Downloading https://files.pythonhosted.org/packages/01/a5/fb3dad18422fcd4241d18460a1fe17542bfdeadcf74e3861d1a2dfc9e459/Django-3.1.1-py3-none-any.whl (7.8MB) |

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mislav Jurić
Hey Danish, I was able to resolve the error by deleting the *db.sqlite3* file from my project root directory and all of the *migrations* folders from all of my apps. Thank you for responding. Best, Mislav Dana subota, 12. rujna 2020. u 14:56:13 UTC+2 korisnik mailto...@gmail.com napisao je:

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mislav Jurić
Hey Danish, I was able to resolve the error by deleting the *db.sqlite3* file from my project root directory and all of the *migration* folders from all of my apps. Thank you for responding. Best, Mislav Dana subota, 12. rujna 2020. u 14:56:13 UTC+2 korisnik mailto...@gmail.com napisao je:

Re: Installation errors

2020-09-12 Thread Kasper Laudrup
Hi Odeyale, On 12/09/2020 16.33, Odeyale Kehinde wrote: I want to install Django on my system but getting these errors. socket.timeout: The read operation timed out I assume you must have an extremely slow internet connection. Try increasing the timeout to the pip command as documented here:

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread coolguy
just FYI... You didn't have to delete the db.sqllite3 file rather would have followed on-screen direction and provided a default value to persist in the existing records in your database. Later you could have edited the info through your program and make correction. This is pretty normal situa

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mohammad Ahshan Danish
yes it works after deletion because old records get deleted. but better approach is to do changes in migration.py files On Sat, Sep 12, 2020 at 8:14 PM Mislav Jurić wrote: > Hey Danish, > > I was able to resolve the error by deleting the *db.sqlite3* file from my > project root directory and al

Re: Installation errors

2020-09-12 Thread Mohammad Ahshan Danish
*trying using virtual env* *>pipenv install* *>pipenv shell* *>pipenv install django* On Sat, Sep 12, 2020 at 8:07 PM Odeyale Kehinde wrote: > I want to install Django on my system but getting these errors. > > C:\Users\odeya>pip install Django==3.1.1 > Collecting Django==3.1.1 > Downloading >

Re: I am getting this error while I click on comment button which i mention in line 51 in html file.

2020-09-12 Thread coolguy
Can't see the line number in your provided screens. However, i can see you have additional id id={{ i.id }}added to your button line. (remove it) You have already provided the id in href="{% url 'userpage:post_detail' i.id %}" attribute. On Saturday, September 12, 2020 at 4:34:10 AM UTC-4 yashla

Re: Environment Variables for Django Secret Key etc On Windows 10 and Heroku

2020-09-12 Thread dum dum
Yes, I've seen so many tutorials. I did the same thing, and didn't work. I believe there is something wrong with my Django Project. I don't know what it is. Still tinkering. On Sat, Sep 12, 2020 at 9:38 PM Mbah Victor wrote: > Have you try googling your problem > > Victor > > On Sat, Sep 12, 20

Re: I am getting this error while I mention all syntax properly.plz help me out.

2020-09-12 Thread coolguy
Please provide the template screen shot since error is generated from there... also send separate screen so i viewable. On Saturday, September 12, 2020 at 4:35:10 AM UTC-4 yashlan...@gmail.com wrote: > [image: 5.PNG] > [image: 6.PNG] > [image: 7.PNG] > [image: 8.PNG] > -- You received this me

Re: I am getting this error while I mention all syntax properly.plz help me out.

2020-09-12 Thread coolguy
Please provide the template screen shot since error is generated from there... also send separate screen so its viewable. On Saturday, September 12, 2020 at 4:35:10 AM UTC-4 yashlan...@gmail.com wrote: > [image: 5.PNG] > [image: 6.PNG] > [image: 7.PNG] > [image: 8.PNG] > -- You received thi

Re: Help with payment processing in django

2020-09-12 Thread coolguy
Buddy... did you design your project or you want us to design it for you... did you create models, views... On Friday, September 11, 2020 at 6:52:31 AM UTC-4 shyam.ac...@gmail.com wrote: > > Hi guys, I am working on a project which offers contents and every > content has a different price. i

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mislav Jurić
A question to coolguy: *What should I have done if I selected option 1?* I get the Python shell and if I input a default value - let's say "t...@test.com", what else do I need to do? I tried to just provide the default value, but it wouldn't accept it, complaining that it was invalid Python (as

AttributeError: object has no attribute 'user' while trying to access instance.user.id

2020-09-12 Thread Mislav Jurić
Hey guys, I have the following code in models.py file in one of my apps: def get_upload_path(instance, filename): extension = filename.split('.')[-1] return "employees/media/users/{0}/profile_picture.{1}".format( instance.user.id, extension) class Employee(models.Model): # some attri

Re: AttributeError: object has no attribute 'user' while trying to access instance.user.id

2020-09-12 Thread coolguy
Please share the complete employee model. It seems you are missing User foreign key in it. On Saturday, September 12, 2020 at 2:03:20 PM UTC-4 mislav@gmail.com wrote: > Hey guys, > > I have the following code in models.py file in one of my apps: > > def get_upload_path(instance, filename):

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread coolguy
Interesting... did you try the email with quotes or without it On Saturday, September 12, 2020 at 1:43:37 PM UTC-4 mislav@gmail.com wrote: > A question to coolguy: > > *What should I have done if I selected option 1?* I get the Python shell > and if I input a default value - let's say "

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread coolguy
Keep this handy as well... https://docs.djangoproject.com/en/3.1/ref/migration-operations/#addfield On Saturday, September 12, 2020 at 1:43:37 PM UTC-4 mislav@gmail.com wrote: > A question to coolguy: > > *What should I have done if I selected option 1?* I get the Python shell > and if I

Re: I am getting an error message about a non-nullable field in existing rows, even though I dropped all rows via the admin interface

2020-09-12 Thread Mislav Jurić
coolguy: I tried it without the quotes. Maybe that was the issue. Dana subota, 12. rujna 2020. u 20:33:52 UTC+2 korisnik coolguy napisao je: > Keep this handy as well... > > https://docs.djangoproject.com/en/3.1/ref/migration-operations/#addfield > > On Saturday, September 12, 2020 at 1:43:37 P

Re: help me it shows error.

2020-09-12 Thread coolguy
change post:pk to i.id also fix line and delete id={{ i.id }} On Saturday, September 12, 2020 at 2:54:16 PM UTC-4 yashlan...@gmail.com wrote: > [image: 5.PNG] > [image: 8.PNG] > [image: 9.PNG] > [image: 10.PNG] > -- You received this message because you are subscribed to the Google Groups "D

Re: AttributeError: object has no attribute 'user' while trying to access instance.user.id

2020-09-12 Thread Mislav Jurić
coolguy here is the complete Employee model: class Employee(models.Model): #TODO: Double-check this username = models.CharField(max_length=50, unique=True) email = models.EmailField() password = models.CharField(max_length=50) first_name = models.CharField(max_length=150) last_

Re: AttributeError: object has no attribute 'user' while trying to access instance.user.id

2020-09-12 Thread coolguy
I wanted to see your model to understand but i realized after my last post that you are using "instance.user.id" while your employee instance does not have user field. (had to go somewhere urgently) >>> return "employees/media/users/{0}/profile_picture.{1}".format(instance.user.id, extension)

Re: I got this error "ValueError: attempted relative import beyond top-level package "

2020-09-12 Thread dum dum
Another problem now.. I don't know why, in local localhost:8000/sitemap.xml will generate sitemap.xml. But on heroku, domain/sitemap.xml will error h13. Any suggestions? Thanks. On Wed, Sep 9, 2020 at 11:31 AM hans alexander wrote: > Thanks guys.. Already solved it. > I guess the main reason

Django Sitemap on heroku error h13

2020-09-12 Thread dum dum
I don't know why, in local localhost:8000/sitemap.xml will generate sitemap.xml. But on heroku, domain/sitemap.xml will error h13. I followed this tutorial https://jawaban.online/scope/outlink/6442/django-sitemap-tutorial-help-crawlers-understand-your-website-2018-youtube/ and https://medium.com/