Skip to content
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

Smiley Link not working. #20

Closed
jefpadfi opened this issue Jun 19, 2018 · 10 comments
Closed

Smiley Link not working. #20

jefpadfi opened this issue Jun 19, 2018 · 10 comments

Comments

@jefpadfi
Copy link

I have added a smiley via the django admin area. THe issue is when I add it to my site using the code i created it does not show up. It cant even find it. I can find it on the local machine uploaded to the directory but it won't render on screen.

issuewithsmilies

being rendered

As you can see it was uploaded to the project folder. But it wont load..
inprojectfolder

@ellmetha
Copy link
Owner

I believe this is related to a problem in the way your project is configured. Check your media configuration 😉

@ellmetha
Copy link
Owner

Closing since this is not really related to the project itself.

@ViennaSand
Copy link

Dear ellmetha,
I wish you would be a bit more specific. I am undergoing the exact same problem and I have no clue what "check your media configuration" means. It would be helpful in your documentation to specify what we need to do in the install process not to undergo this problem.
Also, I wish I had more specific guidelines on how to have the buttons of the bbcode (just like here on github) in the admin area to enter the content of a blog post on top of the text area.
It may not be directly related to the project, but it is directly linked to the "getting started" doc.
Kind regards

@jefpadfi
Copy link
Author

jefpadfi commented Jul 10, 2018

The media settings are not part of the this project, which is what ellmetha was referring to. I forgot to set my media root and media url inside the settings.py. The following is what fixed my issue.

`# Media Root
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')

MEDIA_URL = '/media/'`

Make sure you edit root to fit your project needs.

@jefpadfi
Copy link
Author

Also as far as the editor ellmetha mentions it will not be part of this project in another issue located here

#13

@ViennaSand
Copy link

ViennaSand commented Jul 10, 2018 via email

@jefpadfi
Copy link
Author

jefpadfi commented Jul 10, 2018

Again you cant just copy and past. My MEDIA_ROOT has PROJECT_PATH which is a custom variable i have created in my settings.py file. You will need to set up media_root to fit your project.

Also i would change smilies back to media as all uploaded content would end up int eh folder smilies then.

@ViennaSand
Copy link

Thanks a lot with your hints, I could finally understand what I was missing:
once the MEDIA_ROOT and MEDIA_URL are setup in the settings.py

You have to go to urls.py and add the following:
from django.conf.urls.static import static
from my_project import settings (assuming that the MEDIA_ROOT is the my_porject folder)

and then url patterns =[
#whatever
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

With this correction, when I upload the smiley in the admin page, I have access to my smiley, at last.
Now, I can focus on the rendering.

All the best!

@jefpadfi
Copy link
Author

Oh yea. I forgot about the urls.py file. Sorry about that.

@ViennaSand
Copy link

No worries, it is also good to do part of the way in an autonomous way ;-) You've been so helpful! Thanks again

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

No branches or pull requests

3 participants