-
Notifications
You must be signed in to change notification settings - Fork 10
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
Comments
I believe this is related to a problem in the way your project is configured. Check your media configuration 😉 |
Closing since this is not really related to the project itself. |
Dear ellmetha, |
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_URL = '/media/'` Make sure you edit root to fit your project needs. |
Also as far as the editor ellmetha mentions it will not be part of this project in another issue located here |
Thank you very very much for your prompt answer.
At the moment I copied/paste in the following way,
MEDIA_ROOT = os.path.join(PROJECT_PATH, ’smilies') MEDIA_URL = ‘/my_app/'
But it still does not work.
The error I get is that I requested URL http://127.0.0.1:8000/my_app/precise_bbcode/smilies/my_smiley.gif <http://127.0.0.1:8000/my_app/precise_bbcode/smilies/my_smiley.gif>
It shows that it tried the URLS patterns which show the path to my file but it is not looking for my file but for the index page instead.
I don’t understand what I’ve done wrong.
… Le 10 juil. 2018 à 18:53, JR Padfield ***@***.***> a écrit :
The media settings are not part of the project. 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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#20 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANEoyaZHyleJrHw0uRzmcj45K0grbyyfks5uFNwFgaJpZM4Ut_Y2>.
|
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. |
Thanks a lot with your hints, I could finally understand what I was missing: You have to go to urls.py and add the following: and then url patterns =[ With this correction, when I upload the smiley in the admin page, I have access to my smiley, at last. All the best! |
Oh yea. I forgot about the urls.py file. Sorry about that. |
No worries, it is also good to do part of the way in an autonomous way ;-) You've been so helpful! Thanks again |
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.
As you can see it was uploaded to the project folder. But it wont load..
![inprojectfolder](https://user-images.githubusercontent.com/7916691/41615915-cf939c34-73b9-11e8-9a47-6b2a1c1f8e9a.png)
The text was updated successfully, but these errors were encountered: